From: Matt Corallo Date: Sat, 15 Jan 2022 20:33:07 +0000 (+0000) Subject: [TS] Update auto-generated TypeScript Bindings X-Git-Tag: v0.0.105.0~5^2~2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=c629a01650402c8e2f9b9db8ced9ed63ce687727;p=ldk-java [TS] Update auto-generated TypeScript Bindings --- diff --git a/ts/bindings.c b/ts/bindings.c index 6aa245a3..33eb9094 100644 --- a/ts/bindings.c +++ b/ts/bindings.c @@ -23,6 +23,7 @@ void *malloc(size_t size); void free(void *ptr); #define MALLOC(a, _) malloc(a) +#define do_MALLOC(a, _b, _c) malloc(a) #define FREE(p) if ((unsigned long)(p) > 4096) { free(p); } #define DO_ASSERT(a) (void)(a) #define CHECK(a) @@ -42,8 +43,8 @@ _Static_assert(sizeof(void*) == 4, "Pointers mut be 32 bits"); ty elems[]; \ }; \ typedef struct name##array * name##Array; \ - static inline name##Array init_##name##Array(size_t arr_len) { \ - name##Array arr = (name##Array)MALLOC(arr_len * sizeof(ty) + sizeof(uint32_t), "##name array init"); \ + static inline name##Array init_##name##Array(size_t arr_len, int lineno) { \ + name##Array arr = (name##Array)do_MALLOC(arr_len * sizeof(ty) + sizeof(uint32_t), #name" array init", lineno); \ arr->arr_len = arr_len; \ return arr; \ } @@ -56,7 +57,7 @@ DECL_ARR_TYPE(char, char); typedef charArray jstring; static inline jstring str_ref_to_ts(const char* chars, size_t len) { - charArray arr = init_charArray(len); + charArray arr = init_charArray(len, __LINE__); memcpy(arr->elems, chars, len); return arr; } @@ -80,6 +81,18 @@ uint32_t __attribute__((export_name("TS_malloc"))) TS_malloc(uint32_t size) { void __attribute__((export_name("TS_free"))) TS_free(uint32_t ptr) { FREE((void*)ptr); } + +jstring __attribute__((export_name("TS_get_ldk_c_bindings_version"))) TS_get_ldk_c_bindings_version() { + const char *res = check_get_ldk_bindings_version(); + if (res == NULL) return NULL; + return str_ref_to_ts(res, strlen(res)); +} +jstring __attribute__((export_name("TS_get_ldk_version"))) get_ldk_version() { + const char *res = check_get_ldk_version(); + if (res == NULL) return NULL; + return str_ref_to_ts(res, strlen(res)); +} +#include "version.c" static inline struct LDKThirtyTwoBytes ThirtyTwoBytes_clone(const struct LDKThirtyTwoBytes *orig) { struct LDKThirtyTwoBytes ret; memcpy(ret.data, orig->data, 32); return ret; } static inline LDKAccessError LDKAccessError_from_js(int32_t ord) { switch (ord) { @@ -215,7 +228,7 @@ static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) { 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(uint32_t thing) { LDKTxOut* thing_conv = (LDKTxOut*)(thing & ~1); LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -234,11 +247,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(owner & ~1); LDKChannelConfig ret_var = CResult_ChannelConfigDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -252,11 +265,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_err"))) TS_CResult_ChannelConfigDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -270,11 +283,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_ok"))) TS_CResult_OutPointDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)(owner & ~1); LDKOutPoint ret_var = CResult_OutPointDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -288,11 +301,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_err"))) TS_CResult_OutPointDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_OutPointDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -305,7 +318,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_ok"))) TS_CResult_SecretKeyErrorZ_get_ok(uint32_t owner) { LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes, 32); return ret_arr; } @@ -326,7 +339,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_ok"))) TS_CResult_PublicKeyErrorZ_get_ok(uint32_t owner) { LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form, 33); return ret_arr; } @@ -348,11 +361,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(owner & ~1); LDKTxCreationKeys ret_var = CResult_TxCreationKeysDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -366,11 +379,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -384,11 +397,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(owner & ~1); LDKChannelPublicKeys ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -402,11 +415,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -420,11 +433,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_ok"))) TS_CResult_TxCreationKeysErrorZ_get_ok(uint32_t owner) { LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)(owner & ~1); LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -461,11 +474,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(owner & ~1); LDKHTLCOutputInCommitment ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -479,11 +492,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -497,11 +510,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(owner & ~1); LDKCounterpartyChannelTransactionParameters ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -515,11 +528,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -533,11 +546,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(owner & ~1); LDKChannelTransactionParameters ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -551,11 +564,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -569,11 +582,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKHolderCommitmentTransaction ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -587,11 +600,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -605,11 +618,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKBuiltCommitmentTransaction ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -623,11 +636,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -641,11 +654,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_get_ok(uint32_t owner) { LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)(owner & ~1); LDKTrustedClosingTransaction ret_var = *CResult_TrustedClosingTransactionNoneZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner & ~1; + ret_ref = (uintptr_t)ret_var.inner & ~1; return ret_ref; } @@ -665,11 +678,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKCommitmentTransaction ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -683,11 +696,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -701,11 +714,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok(uint32_t owner) { LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(owner & ~1); LDKTrustedCommitmentTransaction ret_var = *CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner & ~1; + ret_ref = (uintptr_t)ret_var.inner & ~1; return ret_ref; } @@ -726,10 +739,10 @@ ptrArray __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_ok"))) LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)(owner & ~1); LDKCVec_SignatureZ ret_var = CResult_CVec_SignatureZNoneZ_get_ok(owner_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { - int8_tArray ret_conv_12_arr = init_int8_tArray(64); + int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__); memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64); ret_arr_ptr[m] = ret_conv_12_arr; } @@ -753,11 +766,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(owner & ~1); LDKShutdownScript ret_var = CResult_ShutdownScriptDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -771,11 +784,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -789,11 +802,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(uint32_t owner) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(owner & ~1); LDKShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -807,11 +820,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(uint32_t owner) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(owner & ~1); LDKInvalidShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -844,7 +857,7 @@ LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) { LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(ret_ref.data, ret->elems, ret_ref.datalen); + memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); return ret_ref; } static void LDKType_JCalls_cloned(LDKType* new_obj) { @@ -872,7 +885,7 @@ long __attribute__((export_name("TS_LDKType_new"))) TS_LDKType_new(JSValue o) { return (long)res_ptr; } int16_t __attribute__((export_name("TS_Type_type_id"))) TS_Type_type_id(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKType* this_arg_conv = (LDKType*)this_arg_ptr; int16_t ret_val = (this_arg_conv->type_id)(this_arg_conv->this_arg); @@ -880,7 +893,7 @@ int16_t __attribute__((export_name("TS_Type_type_id"))) TS_Type_type_id(uint32_ } jstring __attribute__((export_name("TS_Type_debug_str"))) TS_Type_debug_str(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKType* this_arg_conv = (LDKType*)this_arg_ptr; LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg); @@ -890,11 +903,11 @@ jstring __attribute__((export_name("TS_Type_debug_str"))) TS_Type_debug_str(uin } int8_tArray __attribute__((export_name("TS_Type_write"))) TS_Type_write(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKType* this_arg_conv = (LDKType*)this_arg_ptr; LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -913,7 +926,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_TypeZ_Some_get_some"))) TS_LD assert(obj->tag == LDKCOption_TypeZ_Some); LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType"); *some_ret = Type_clone(&obj->some); - return (uint64_t)some_ret; + return (uintptr_t)some_ret; } static inline struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); @@ -923,7 +936,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_o LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(owner & ~1); LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -934,11 +947,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_err"))) TS_CResult_COption_TypeZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -973,11 +986,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(owner & ~1); LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -991,11 +1004,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -1016,33 +1029,33 @@ uint32_t __attribute__((export_name("TS_LDKMonitorEvent_HTLCEvent_get_htlc_event LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); assert(obj->tag == LDKMonitorEvent_HTLCEvent); LDKHTLCUpdate htlc_event_var = obj->htlc_event; - uint64_t htlc_event_ref = 0; - CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t htlc_event_ref = 0; + CHECK((((uintptr_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); - htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1; + htlc_event_ref = (uintptr_t)htlc_event_var.inner & ~1; return htlc_event_ref; } uint32_t __attribute__((export_name("TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed"))) TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(uint32_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); assert(obj->tag == LDKMonitorEvent_CommitmentTxConfirmed); LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed; - uint64_t commitment_tx_confirmed_ref = 0; - CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t commitment_tx_confirmed_ref = 0; + CHECK((((uintptr_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); - commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1; + commitment_tx_confirmed_ref = (uintptr_t)commitment_tx_confirmed_var.inner & ~1; return commitment_tx_confirmed_ref; } uint32_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo"))) TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo(uint32_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); assert(obj->tag == LDKMonitorEvent_UpdateCompleted); LDKOutPoint funding_txo_var = obj->update_completed.funding_txo; - uint64_t funding_txo_ref = 0; - CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t funding_txo_ref = 0; + CHECK((((uintptr_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); - funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1; + funding_txo_ref = (uintptr_t)funding_txo_var.inner & ~1; return funding_txo_ref; } int64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id"))) TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(uint32_t ptr) { @@ -1054,11 +1067,11 @@ uint32_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateFailed_get_update_ LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); assert(obj->tag == LDKMonitorEvent_UpdateFailed); LDKOutPoint update_failed_var = obj->update_failed; - uint64_t update_failed_ref = 0; - CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t update_failed_ref = 0; + CHECK((((uintptr_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); - update_failed_ref = (uint64_t)update_failed_var.inner & ~1; + update_failed_ref = (uintptr_t)update_failed_var.inner & ~1; return update_failed_ref; } uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_ty_from_ptr"))) TS_LDKCOption_MonitorEventZ_ty_from_ptr(uint32_t ptr) { @@ -1072,7 +1085,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_ty_from_ptr"))) uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_Some_get_some"))) TS_LDKCOption_MonitorEventZ_Some_get_some(uint32_t ptr) { LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)(ptr & ~1); assert(obj->tag == LDKCOption_MonitorEventZ_Some); - uint64_t some_ref = ((uint64_t)&obj->some) | 1; + uintptr_t some_ref = ((uintptr_t)&obj->some) | 1; return some_ref; } static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){ @@ -1083,7 +1096,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErro LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(owner & ~1); LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -1094,11 +1107,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -1112,11 +1125,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(owner & ~1); LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -1130,11 +1143,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -1165,11 +1178,11 @@ static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPoi uint32_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_a"))) TS_C2Tuple_OutPointScriptZ_get_a(uint32_t owner) { LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)(owner & ~1); LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -1182,7 +1195,7 @@ static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPoi int8_tArray __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_b"))) TS_C2Tuple_OutPointScriptZ_get_b(uint32_t owner) { LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)(owner & ~1); LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -1203,7 +1216,7 @@ static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ int8_tArray __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_b"))) TS_C2Tuple_u32ScriptZ_get_b(uint32_t owner) { LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)(owner & ~1); LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_get_b(owner_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -1214,7 +1227,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get } int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(uint32_t owner) { LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -1226,12 +1239,12 @@ uint32_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32Script LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(owner & ~1); LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t v = 0; v < ret_var.datalen; v++) { LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = &ret_var.data[v]; // Warning: we really need to clone here, but no clone is available for LDKC2Tuple_u32ScriptZ - ret_arr_ptr[v] = ((uint64_t)ret_conv_21_conv) | 1; + ret_arr_ptr[v] = ((uintptr_t)ret_conv_21_conv) | 1; } return ret_arr; @@ -1255,21 +1268,21 @@ uint32_t __attribute__((export_name("TS_LDKPaymentPurpose_ty_from_ptr"))) TS_LDK int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(uint32_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); assert(obj->tag == LDKPaymentPurpose_InvoicePayment); - int8_tArray payment_preimage_arr = init_int8_tArray(32); + int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__); memcpy(payment_preimage_arr->elems, obj->invoice_payment.payment_preimage.data, 32); return payment_preimage_arr; } int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret(uint32_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); assert(obj->tag == LDKPaymentPurpose_InvoicePayment); - int8_tArray payment_secret_arr = init_int8_tArray(32); + int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); memcpy(payment_secret_arr->elems, obj->invoice_payment.payment_secret.data, 32); return payment_secret_arr; } int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment"))) TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(uint32_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); assert(obj->tag == LDKPaymentPurpose_SpontaneousPayment); - int8_tArray spontaneous_payment_arr = init_int8_tArray(32); + int8_tArray spontaneous_payment_arr = init_int8_tArray(32, __LINE__); memcpy(spontaneous_payment_arr->elems, obj->spontaneous_payment.data, 32); return spontaneous_payment_arr; } @@ -1299,11 +1312,11 @@ uint32_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelUpdateMessage_ge LDKNetworkUpdate *obj = (LDKNetworkUpdate*)(ptr & ~1); assert(obj->tag == LDKNetworkUpdate_ChannelUpdateMessage); LDKChannelUpdate msg_var = obj->channel_update_message.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelClosed_get_short_channel_id"))) TS_LDKNetworkUpdate_ChannelClosed_get_short_channel_id(uint32_t ptr) { @@ -1319,7 +1332,7 @@ jboolean __attribute__((export_name("TS_LDKNetworkUpdate_ChannelClosed_get_is_pe int8_tArray __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_node_id"))) TS_LDKNetworkUpdate_NodeFailure_get_node_id(uint32_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)(ptr & ~1); assert(obj->tag == LDKNetworkUpdate_NodeFailure); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->node_failure.node_id.compressed_form, 33); return node_id_arr; } @@ -1339,7 +1352,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_ty_from_ptr")) uint32_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_Some_get_some"))) TS_LDKCOption_NetworkUpdateZ_Some_get_some(uint32_t ptr) { LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)(ptr & ~1); assert(obj->tag == LDKCOption_NetworkUpdateZ_Some); - uint64_t some_ref = ((uint64_t)&obj->some) | 1; + uintptr_t some_ref = ((uintptr_t)&obj->some) | 1; return some_ref; } static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) { @@ -1362,39 +1375,39 @@ uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutpu LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)(ptr & ~1); assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput); LDKOutPoint outpoint_var = obj->static_output.outpoint; - uint64_t outpoint_ref = 0; - CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t outpoint_ref = 0; + CHECK((((uintptr_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); - outpoint_ref = (uint64_t)outpoint_var.inner & ~1; + outpoint_ref = (uintptr_t)outpoint_var.inner & ~1; return outpoint_ref; } uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_output"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_output(uint32_t ptr) { LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)(ptr & ~1); assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput); - uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1; - return (uint64_t)output_ref; + uintptr_t output_ref = ((uintptr_t)&obj->static_output.output) | 1; + return (uintptr_t)output_ref; } uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output"))) TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(uint32_t ptr) { LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)(ptr & ~1); assert(obj->tag == LDKSpendableOutputDescriptor_DelayedPaymentOutput); LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output; - uint64_t delayed_payment_output_ref = 0; - CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t delayed_payment_output_ref = 0; + CHECK((((uintptr_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var); - delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1; + delayed_payment_output_ref = (uintptr_t)delayed_payment_output_var.inner & ~1; return delayed_payment_output_ref; } uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output"))) TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output(uint32_t ptr) { LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)(ptr & ~1); assert(obj->tag == LDKSpendableOutputDescriptor_StaticPaymentOutput); LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output; - uint64_t static_payment_output_ref = 0; - CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t static_payment_output_ref = 0; + CHECK((((uintptr_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var); - static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1; + static_payment_output_ref = (uintptr_t)static_payment_output_var.inner & ~1; return static_payment_output_ref; } static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) { @@ -1452,7 +1465,7 @@ uint32_t __attribute__((export_name("TS_LDKEvent_ty_from_ptr"))) TS_LDKEvent_ty_ int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_FundingGenerationReady); - int8_tArray temporary_channel_id_arr = init_int8_tArray(32); + int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__); memcpy(temporary_channel_id_arr->elems, obj->funding_generation_ready.temporary_channel_id.data, 32); return temporary_channel_id_arr; } @@ -1465,7 +1478,7 @@ int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_o LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_FundingGenerationReady); LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; - int8_tArray output_script_arr = init_int8_tArray(output_script_var.datalen); + int8_tArray output_script_arr = init_int8_tArray(output_script_var.datalen, __LINE__); memcpy(output_script_arr->elems, output_script_var.data, output_script_var.datalen); return output_script_arr; } @@ -1477,7 +1490,7 @@ int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_user_ int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_payment_hash"))) TS_LDKEvent_PaymentReceived_get_payment_hash(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentReceived); - int8_tArray payment_hash_arr = init_int8_tArray(32); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); memcpy(payment_hash_arr->elems, obj->payment_received.payment_hash.data, 32); return payment_hash_arr; } @@ -1489,47 +1502,47 @@ int64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_amt"))) TS_L uint32_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_purpose"))) TS_LDKEvent_PaymentReceived_get_purpose(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentReceived); - uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; + uintptr_t purpose_ref = ((uintptr_t)&obj->payment_received.purpose) | 1; return purpose_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_id"))) TS_LDKEvent_PaymentSent_get_payment_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentSent); - int8_tArray payment_id_arr = init_int8_tArray(32); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, obj->payment_sent.payment_id.data, 32); return payment_id_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_preimage"))) TS_LDKEvent_PaymentSent_get_payment_preimage(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentSent); - int8_tArray payment_preimage_arr = init_int8_tArray(32); + int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__); memcpy(payment_preimage_arr->elems, obj->payment_sent.payment_preimage.data, 32); return payment_preimage_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_hash"))) TS_LDKEvent_PaymentSent_get_payment_hash(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentSent); - int8_tArray payment_hash_arr = init_int8_tArray(32); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); memcpy(payment_hash_arr->elems, obj->payment_sent.payment_hash.data, 32); return payment_hash_arr; } uint32_t __attribute__((export_name("TS_LDKEvent_PaymentSent_get_fee_paid_msat"))) TS_LDKEvent_PaymentSent_get_fee_paid_msat(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentSent); - uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; + uintptr_t fee_paid_msat_ref = ((uintptr_t)&obj->payment_sent.fee_paid_msat) | 1; return fee_paid_msat_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_id"))) TS_LDKEvent_PaymentPathFailed_get_payment_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathFailed); - int8_tArray payment_id_arr = init_int8_tArray(32); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, obj->payment_path_failed.payment_id.data, 32); return payment_id_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_hash"))) TS_LDKEvent_PaymentPathFailed_get_payment_hash(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathFailed); - int8_tArray payment_hash_arr = init_int8_tArray(32); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); memcpy(payment_hash_arr->elems, obj->payment_path_failed.payment_hash.data, 32); return payment_hash_arr; } @@ -1541,7 +1554,7 @@ jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_rejected_ uint32_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_network_update"))) TS_LDKEvent_PaymentPathFailed_get_network_update(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathFailed); - uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; + uintptr_t network_update_ref = ((uintptr_t)&obj->payment_path_failed.network_update) | 1; return network_update_ref; } jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_all_paths_failed"))) TS_LDKEvent_PaymentPathFailed_get_all_paths_failed(uint32_t ptr) { @@ -1554,15 +1567,15 @@ uint32_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_path assert(obj->tag == LDKEvent_PaymentPathFailed); LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; uint32_tArray path_arr = NULL; - path_arr = init_uint32_tArray(path_var.datalen); + path_arr = init_uint32_tArray(path_var.datalen, __LINE__); uint32_t *path_arr_ptr = (uint32_t*)(((uint8_t*)path_arr) + 4); for (size_t k = 0; k < path_var.datalen; k++) { LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner & ~1; path_arr_ptr[k] = path_conv_10_ref; } @@ -1571,33 +1584,33 @@ uint32_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_path uint32_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_short_channel_id"))) TS_LDKEvent_PaymentPathFailed_get_short_channel_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathFailed); - uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; + uintptr_t short_channel_id_ref = ((uintptr_t)&obj->payment_path_failed.short_channel_id) | 1; return short_channel_id_ref; } uint32_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_retry"))) TS_LDKEvent_PaymentPathFailed_get_retry(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathFailed); LDKRouteParameters retry_var = obj->payment_path_failed.retry; - uint64_t retry_ref = 0; - if ((uint64_t)retry_var.inner > 4096) { - CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t retry_ref = 0; + if ((uintptr_t)retry_var.inner > 4096) { + CHECK((((uintptr_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var); - retry_ref = (uint64_t)retry_var.inner & ~1; + retry_ref = (uintptr_t)retry_var.inner & ~1; } return retry_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_id"))) TS_LDKEvent_PaymentFailed_get_payment_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentFailed); - int8_tArray payment_id_arr = init_int8_tArray(32); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, obj->payment_failed.payment_id.data, 32); return payment_id_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_hash"))) TS_LDKEvent_PaymentFailed_get_payment_hash(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentFailed); - int8_tArray payment_hash_arr = init_int8_tArray(32); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); memcpy(payment_hash_arr->elems, obj->payment_failed.payment_hash.data, 32); return payment_hash_arr; } @@ -1611,10 +1624,10 @@ uint32_tArray __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_outpu assert(obj->tag == LDKEvent_SpendableOutputs); LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; uint32_tArray outputs_arr = NULL; - outputs_arr = init_uint32_tArray(outputs_var.datalen); + outputs_arr = init_uint32_tArray(outputs_var.datalen, __LINE__); uint32_t *outputs_arr_ptr = (uint32_t*)(((uint8_t*)outputs_arr) + 4); for (size_t b = 0; b < outputs_var.datalen; b++) { - uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; + uintptr_t outputs_conv_27_ref = ((uintptr_t)&outputs_var.data[b]) | 1; outputs_arr_ptr[b] = outputs_conv_27_ref; } @@ -1623,7 +1636,7 @@ uint32_tArray __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_outpu uint32_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_fee_earned_msat"))) TS_LDKEvent_PaymentForwarded_get_fee_earned_msat(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentForwarded); - uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; + uintptr_t fee_earned_msat_ref = ((uintptr_t)&obj->payment_forwarded.fee_earned_msat) | 1; return fee_earned_msat_ref; } jboolean __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx"))) TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(uint32_t ptr) { @@ -1634,7 +1647,7 @@ jboolean __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_claim_from int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_channel_id"))) TS_LDKEvent_ChannelClosed_get_channel_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_ChannelClosed); - int8_tArray channel_id_arr = init_int8_tArray(32); + int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); memcpy(channel_id_arr->elems, obj->channel_closed.channel_id.data, 32); return channel_id_arr; } @@ -1646,13 +1659,13 @@ int64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_user_channel_i uint32_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_reason"))) TS_LDKEvent_ChannelClosed_get_reason(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_ChannelClosed); - uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; + uintptr_t reason_ref = ((uintptr_t)&obj->channel_closed.reason) | 1; return reason_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_channel_id"))) TS_LDKEvent_DiscardFunding_get_channel_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_DiscardFunding); - int8_tArray channel_id_arr = init_int8_tArray(32); + int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); memcpy(channel_id_arr->elems, obj->discard_funding.channel_id.data, 32); return channel_id_arr; } @@ -1660,21 +1673,21 @@ int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_transacti LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_DiscardFunding); LDKTransaction transaction_var = obj->discard_funding.transaction; - int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen); + int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen, __LINE__); memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen); return transaction_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_id"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathSuccessful); - int8_tArray payment_id_arr = init_int8_tArray(32); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, obj->payment_path_successful.payment_id.data, 32); return payment_id_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_hash"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_hash(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathSuccessful); - int8_tArray payment_hash_arr = init_int8_tArray(32); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); memcpy(payment_hash_arr->elems, obj->payment_path_successful.payment_hash.data, 32); return payment_hash_arr; } @@ -1683,15 +1696,15 @@ uint32_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_ assert(obj->tag == LDKEvent_PaymentPathSuccessful); LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path; uint32_tArray path_arr = NULL; - path_arr = init_uint32_tArray(path_var.datalen); + path_arr = init_uint32_tArray(path_var.datalen, __LINE__); uint32_t *path_arr_ptr = (uint32_t*)(((uint8_t*)path_arr) + 4); for (size_t k = 0; k < path_var.datalen; k++) { LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner & ~1; path_arr_ptr[k] = path_conv_10_ref; } @@ -1707,9 +1720,9 @@ static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ return owner->a; } -int64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_a"))) TS_C2Tuple_usizeTransactionZ_get_a(uint32_t owner) { +intptr_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_a"))) TS_C2Tuple_usizeTransactionZ_get_a(uint32_t owner) { LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); - int64_t ret_val = C2Tuple_usizeTransactionZ_get_a(owner_conv); + intptr_t ret_val = C2Tuple_usizeTransactionZ_get_a(owner_conv); return ret_val; } @@ -1719,7 +1732,7 @@ static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_u int8_tArray __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_b"))) TS_C2Tuple_usizeTransactionZ_get_b(uint32_t owner) { LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -1747,7 +1760,7 @@ uint32_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_b"))) TS_C2Tuple_ LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)(owner & ~1); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); *ret_ref = C2Tuple_u32TxOutZ_get_b(owner_conv); - return (uint64_t)ret_ref; + return (uintptr_t)ret_ref; } static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) { @@ -1762,7 +1775,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_ } int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(uint32_t owner) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -1774,12 +1787,12 @@ uint32_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(owner & ~1); LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t u = 0; u < ret_var.datalen; u++) { LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); *ret_conv_20_conv = ret_var.data[u]; - ret_arr_ptr[u] = ((uint64_t)ret_conv_20_conv); + ret_arr_ptr[u] = ((uintptr_t)ret_conv_20_conv); } FREE(ret_var.data); @@ -1857,7 +1870,7 @@ static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2T } int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_a"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_a(uint32_t owner) { LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form, 64); return ret_arr; } @@ -1869,10 +1882,10 @@ ptrArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_b LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { - int8_tArray ret_conv_12_arr = init_int8_tArray(64); + int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__); memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64); ret_arr_ptr[m] = ret_conv_12_arr; } @@ -1888,7 +1901,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_Signature LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(owner & ~1); LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){ @@ -1906,7 +1919,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_SignatureNoneZ_get_ok"))) TS_CResult_SignatureNoneZ_get_ok(uint32_t owner) { LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form, 64); return ret_arr; } @@ -1935,7 +1948,7 @@ LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, ui int8_tArray ret = (int8_tArray)js_invoke_function_1(j_calls->instance_ptr, 3, (uint32_t)idx); LDKPublicKey ret_ref; CHECK(ret->arr_len == 33); - memcpy(ret_ref.compressed_form, ret->elems, 33); + memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret); return ret_ref; } LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) { @@ -1943,23 +1956,23 @@ LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_a int8_tArray ret = (int8_tArray)js_invoke_function_1(j_calls->instance_ptr, 4, (uint32_t)idx); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); - memcpy(ret_ref.data, ret->elems, 32); + memcpy(ret_ref.data, ret->elems, 32); FREE(ret); return ret_ref; } LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKHolderCommitmentTransaction holder_tx_var = *holder_tx; - uint64_t holder_tx_ref = 0; + uintptr_t holder_tx_ref = 0; holder_tx_var = HolderCommitmentTransaction_clone(holder_tx); - CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); - holder_tx_ref = (uint64_t)holder_tx_var.inner; + holder_tx_ref = (uintptr_t)holder_tx_var.inner; if (holder_tx_var.is_owned) { holder_tx_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 5, (uint32_t)holder_tx_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); FREE((void*)ret); @@ -1970,23 +1983,23 @@ LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) { int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 6); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); - memcpy(ret_ref.data, ret->elems, 32); + memcpy(ret_ref.data, ret->elems, 32); FREE(ret); return ret_ref; } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKCommitmentTransaction commitment_tx_var = *commitment_tx; - uint64_t commitment_tx_ref = 0; + uintptr_t commitment_tx_ref = 0; commitment_tx_var = CommitmentTransaction_clone(commitment_tx); - CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); - commitment_tx_ref = (uint64_t)commitment_tx_var.inner; + commitment_tx_ref = (uintptr_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 7, (uint32_t)commitment_tx_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); FREE((void*)ret); @@ -1994,10 +2007,10 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L } LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; - int8_tArray secret_arr = init_int8_tArray(32); + int8_tArray secret_arr = init_int8_tArray(32, __LINE__); memcpy(secret_arr->elems, *secret, 32); uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 8, (uint32_t)idx, (uint32_t)secret_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2006,17 +2019,17 @@ LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const vo LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx; - uint64_t commitment_tx_ref = 0; + uintptr_t commitment_tx_ref = 0; commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx); - CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); - commitment_tx_ref = (uint64_t)commitment_tx_var.inner; + commitment_tx_ref = (uintptr_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 9, (uint32_t)commitment_tx_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2025,13 +2038,13 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl 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]) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKTransaction justice_tx_var = justice_tx; - int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen); + int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__); memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen); Transaction_free(justice_tx_var); - int8_tArray per_commitment_key_arr = init_int8_tArray(32); + int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__); memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32); uint32_t ret = js_invoke_function_4(j_calls->instance_ptr, 10, (uint32_t)justice_tx_arr, (uint32_t)input, (uint32_t)amount, (uint32_t)per_commitment_key_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2040,23 +2053,23 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo 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) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKTransaction justice_tx_var = justice_tx; - int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen); + int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__); memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen); Transaction_free(justice_tx_var); - int8_tArray per_commitment_key_arr = init_int8_tArray(32); + int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__); memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32); LDKHTLCOutputInCommitment htlc_var = *htlc; - uint64_t htlc_ref = 0; + uintptr_t htlc_ref = 0; htlc_var = HTLCOutputInCommitment_clone(htlc); - CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); - htlc_ref = (uint64_t)htlc_var.inner; + htlc_ref = (uintptr_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; } uint32_t ret = js_invoke_function_5(j_calls->instance_ptr, 11, (uint32_t)justice_tx_arr, (uint32_t)input, (uint32_t)amount, (uint32_t)per_commitment_key_arr, (uint32_t)htlc_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2065,23 +2078,23 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void 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) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKTransaction htlc_tx_var = htlc_tx; - int8_tArray htlc_tx_arr = init_int8_tArray(htlc_tx_var.datalen); + int8_tArray htlc_tx_arr = init_int8_tArray(htlc_tx_var.datalen, __LINE__); memcpy(htlc_tx_arr->elems, htlc_tx_var.data, htlc_tx_var.datalen); Transaction_free(htlc_tx_var); - int8_tArray per_commitment_point_arr = init_int8_tArray(33); + int8_tArray per_commitment_point_arr = init_int8_tArray(33, __LINE__); memcpy(per_commitment_point_arr->elems, per_commitment_point.compressed_form, 33); LDKHTLCOutputInCommitment htlc_var = *htlc; - uint64_t htlc_ref = 0; + uintptr_t htlc_ref = 0; htlc_var = HTLCOutputInCommitment_clone(htlc); - CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); - htlc_ref = (uint64_t)htlc_var.inner; + htlc_ref = (uintptr_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; } uint32_t ret = js_invoke_function_5(j_calls->instance_ptr, 12, (uint32_t)htlc_tx_arr, (uint32_t)input, (uint32_t)amount, (uint32_t)per_commitment_point_arr, (uint32_t)htlc_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2090,17 +2103,17 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKClosingTransaction closing_tx_var = *closing_tx; - uint64_t closing_tx_ref = 0; + uintptr_t closing_tx_ref = 0; closing_tx_var = ClosingTransaction_clone(closing_tx); - CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var); - closing_tx_ref = (uint64_t)closing_tx_var.inner; + closing_tx_ref = (uintptr_t)closing_tx_var.inner; if (closing_tx_var.is_owned) { closing_tx_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 13, (uint32_t)closing_tx_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2109,17 +2122,17 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKUnsignedChannelAnnouncement msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UnsignedChannelAnnouncement_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 14, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2128,12 +2141,12 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKChannelTransactionParameters channel_parameters_var = *channel_parameters; - uint64_t channel_parameters_ref = 0; + uintptr_t channel_parameters_ref = 0; channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters); - CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var); - channel_parameters_ref = (uint64_t)channel_parameters_var.inner; + channel_parameters_ref = (uintptr_t)channel_parameters_var.inner; if (channel_parameters_var.is_owned) { channel_parameters_ref |= 1; } @@ -2180,25 +2193,25 @@ long __attribute__((export_name("TS_LDKBaseSign_new"))) TS_LDKBaseSign_new(JSVa return (long)res_ptr; } int8_tArray __attribute__((export_name("TS_BaseSign_get_per_commitment_point"))) TS_BaseSign_get_per_commitment_point(uint32_t this_arg, int64_t idx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33); return ret_arr; } int8_tArray __attribute__((export_name("TS_BaseSign_release_commitment_secret"))) TS_BaseSign_release_commitment_secret(uint32_t this_arg, int64_t idx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32); return ret_arr; } uint32_t __attribute__((export_name("TS_BaseSign_validate_holder_commitment"))) TS_BaseSign_validate_holder_commitment(uint32_t this_arg, uint32_t holder_tx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKHolderCommitmentTransaction holder_tx_conv; @@ -2207,20 +2220,20 @@ uint32_t __attribute__((export_name("TS_BaseSign_validate_holder_commitment"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_BaseSign_channel_keys_id"))) TS_BaseSign_channel_keys_id(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32); return ret_arr; } uint32_t __attribute__((export_name("TS_BaseSign_sign_counterparty_commitment"))) TS_BaseSign_sign_counterparty_commitment(uint32_t this_arg, uint32_t commitment_tx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKCommitmentTransaction commitment_tx_conv; @@ -2229,24 +2242,24 @@ uint32_t __attribute__((export_name("TS_BaseSign_sign_counterparty_commitment") CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_BaseSign_validate_counterparty_revocation"))) TS_BaseSign_validate_counterparty_revocation(uint32_t this_arg, int64_t idx, int8_tArray secret) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; unsigned char secret_arr[32]; CHECK(secret->arr_len == 32); - memcpy(secret_arr, secret->elems, 32); + memcpy(secret_arr, secret->elems, 32); FREE(secret); unsigned char (*secret_ref)[32] = &secret_arr; LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_BaseSign_sign_holder_commitment_and_htlcs"))) TS_BaseSign_sign_holder_commitment_and_htlcs(uint32_t this_arg, uint32_t commitment_tx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKHolderCommitmentTransaction commitment_tx_conv; @@ -2255,39 +2268,39 @@ uint32_t __attribute__((export_name("TS_BaseSign_sign_holder_commitment_and_htl CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -uint32_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_output"))) TS_BaseSign_sign_justice_revoked_output(uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); +uint32_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_output"))) TS_BaseSign_sign_justice_revoked_output(uint32_t this_arg, int8_tArray justice_tx, intptr_t input, int64_t amount, int8_tArray per_commitment_key) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKTransaction justice_tx_ref; justice_tx_ref.datalen = justice_tx->arr_len; justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); + memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx); justice_tx_ref.data_is_owned = true; unsigned char per_commitment_key_arr[32]; CHECK(per_commitment_key->arr_len == 32); - memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); + memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key); unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr; LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -uint32_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_htlc"))) TS_BaseSign_sign_justice_revoked_htlc(uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, uint32_t htlc) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); +uint32_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_htlc"))) TS_BaseSign_sign_justice_revoked_htlc(uint32_t this_arg, int8_tArray justice_tx, intptr_t input, int64_t amount, int8_tArray per_commitment_key, uint32_t htlc) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKTransaction justice_tx_ref; justice_tx_ref.datalen = justice_tx->arr_len; justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); + memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx); justice_tx_ref.data_is_owned = true; unsigned char per_commitment_key_arr[32]; CHECK(per_commitment_key->arr_len == 32); - memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); + memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key); unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr; LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); @@ -2295,32 +2308,32 @@ uint32_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_htlc"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *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); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -uint32_t __attribute__((export_name("TS_BaseSign_sign_counterparty_htlc_transaction"))) TS_BaseSign_sign_counterparty_htlc_transaction(uint32_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, uint32_t htlc) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); +uint32_t __attribute__((export_name("TS_BaseSign_sign_counterparty_htlc_transaction"))) TS_BaseSign_sign_counterparty_htlc_transaction(uint32_t this_arg, int8_tArray htlc_tx, intptr_t input, int64_t amount, int8_tArray per_commitment_point, uint32_t htlc) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKTransaction htlc_tx_ref; htlc_tx_ref.datalen = htlc_tx->arr_len; htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(htlc_tx_ref.data, htlc_tx->elems, htlc_tx_ref.datalen); + memcpy(htlc_tx_ref.data, htlc_tx->elems, htlc_tx_ref.datalen); FREE(htlc_tx); htlc_tx_ref.data_is_owned = true; LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *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); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_BaseSign_sign_closing_transaction"))) TS_BaseSign_sign_closing_transaction(uint32_t this_arg, uint32_t closing_tx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKClosingTransaction closing_tx_conv; @@ -2329,11 +2342,11 @@ uint32_t __attribute__((export_name("TS_BaseSign_sign_closing_transaction"))) T CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_BaseSign_sign_channel_announcement"))) TS_BaseSign_sign_channel_announcement(uint32_t this_arg, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKUnsignedChannelAnnouncement msg_conv; @@ -2342,11 +2355,11 @@ uint32_t __attribute__((export_name("TS_BaseSign_sign_channel_announcement"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_BaseSign_ready_channel"))) TS_BaseSign_ready_channel(uint32_t this_arg, uint32_t channel_parameters) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKChannelTransactionParameters channel_parameters_conv; @@ -2362,15 +2375,15 @@ LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) { return this_arg->pubkeys; } uint32_t __attribute__((export_name("TS_BaseSign_get_pubkeys"))) TS_BaseSign_get_pubkeys(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2394,7 +2407,7 @@ LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) { LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(ret_ref.data, ret->elems, ret_ref.datalen); + memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); return ret_ref; } static void LDKSign_JCalls_cloned(LDKSign* new_obj) { @@ -2428,11 +2441,11 @@ long __attribute__((export_name("TS_LDKSign_new"))) TS_LDKSign_new(JSValue o, J return (long)res_ptr; } int8_tArray __attribute__((export_name("TS_Sign_write"))) TS_Sign_write(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr; LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -2443,7 +2456,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LD } int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_a"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_a(uint32_t owner) { LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_BlockHashChannelMonitorZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -2454,11 +2467,11 @@ static inline struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LD uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_b"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_b(uint32_t owner) { LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(owner & ~1); LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2473,7 +2486,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitor LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(owner & ~1); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){ @@ -2483,11 +2496,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2501,11 +2514,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHopDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)(owner & ~1); LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2519,11 +2532,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_err"))) TS_CResult_RouteHopDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RouteHopDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2544,11 +2557,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_ok"))) TS_CResult_RouteDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)(owner & ~1); LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2562,11 +2575,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_err"))) TS_CResult_RouteDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RouteDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2580,11 +2593,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_ok"))) TS_CResult_RouteParametersDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(owner & ~1); LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2598,11 +2611,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_err"))) TS_CResult_RouteParametersDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2623,11 +2636,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_get_ok"))) TS_CResult_PayeeDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_PayeeDecodeErrorZ* owner_conv = (LDKCResult_PayeeDecodeErrorZ*)(owner & ~1); LDKPayee ret_var = CResult_PayeeDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2641,11 +2654,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_get_err"))) TS_CResult_PayeeDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_PayeeDecodeErrorZ* owner_conv = (LDKCResult_PayeeDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_PayeeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2666,11 +2679,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_ok"))) TS_CResult_RouteHintDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)(owner & ~1); LDKRouteHint ret_var = CResult_RouteHintDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2684,11 +2697,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_err"))) TS_CResult_RouteHintDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RouteHintDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2702,11 +2715,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(owner & ~1); LDKRouteHintHop ret_var = CResult_RouteHintHopDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2720,11 +2733,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_err"))) TS_CResult_RouteHintHopDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2745,11 +2758,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_ok"))) TS_CResult_RouteLightningErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)(owner & ~1); LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2763,11 +2776,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_err"))) TS_CResult_RouteLightningErrorZ_get_err(uint32_t owner) { LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)(owner & ~1); LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2790,11 +2803,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_err"))) TS_CResult_NoneLightningErrorZ_get_err(uint32_t owner) { LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)(owner & ~1); LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2806,7 +2819,7 @@ static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_Public } int8_tArray __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_a"))) TS_C2Tuple_PublicKeyTypeZ_get_a(uint32_t owner) { LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, C2Tuple_PublicKeyTypeZ_get_a(owner_conv).compressed_form, 33); return ret_arr; } @@ -2818,7 +2831,7 @@ uint32_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_b"))) TS_C2T LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)(owner & ~1); LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); *ret_ret = C2Tuple_PublicKeyTypeZ_get_b(owner_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) { @@ -2843,12 +2856,12 @@ uint32_t __attribute__((export_name("TS_LDKErrorAction_DisconnectPeer_get_msg")) LDKErrorAction *obj = (LDKErrorAction*)(ptr & ~1); assert(obj->tag == LDKErrorAction_DisconnectPeer); LDKErrorMessage msg_var = obj->disconnect_peer.msg; - uint64_t msg_ref = 0; - if ((uint64_t)msg_var.inner > 4096) { - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + if ((uintptr_t)msg_var.inner > 4096) { + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; } return msg_ref; } @@ -2862,11 +2875,11 @@ uint32_t __attribute__((export_name("TS_LDKErrorAction_SendErrorMessage_get_msg" LDKErrorAction *obj = (LDKErrorAction*)(ptr & ~1); assert(obj->tag == LDKErrorAction_SendErrorMessage); LDKErrorMessage msg_var = obj->send_error_message.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_ty_from_ptr"))) TS_LDKMessageSendEvent_ty_from_ptr(uint32_t ptr) { @@ -2897,7 +2910,7 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_ty_from_ptr"))) TS_L int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_accept_channel.node_id.compressed_form, 33); return node_id_arr; } @@ -2905,17 +2918,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel); LDKAcceptChannel msg_var = obj->send_accept_channel.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_node_id"))) TS_LDKMessageSendEvent_SendOpenChannel_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendOpenChannel); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_open_channel.node_id.compressed_form, 33); return node_id_arr; } @@ -2923,17 +2936,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_ LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendOpenChannel); LDKOpenChannel msg_var = obj->send_open_channel.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_node_id"))) TS_LDKMessageSendEvent_SendFundingCreated_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingCreated); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_funding_created.node_id.compressed_form, 33); return node_id_arr; } @@ -2941,17 +2954,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_g LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingCreated); LDKFundingCreated msg_var = obj->send_funding_created.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendFundingSigned_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingSigned); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_funding_signed.node_id.compressed_form, 33); return node_id_arr; } @@ -2959,17 +2972,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingSigned); LDKFundingSigned msg_var = obj->send_funding_signed.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingLocked_get_node_id"))) TS_LDKMessageSendEvent_SendFundingLocked_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingLocked); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_funding_locked.node_id.compressed_form, 33); return node_id_arr; } @@ -2977,17 +2990,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingLocked_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingLocked); LDKFundingLocked msg_var = obj->send_funding_locked.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_announcement_signatures.node_id.compressed_form, 33); return node_id_arr; } @@ -2995,17 +3008,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSign LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures); LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->update_htl_cs.node_id.compressed_form, 33); return node_id_arr; } @@ -3013,17 +3026,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_upda LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs); LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates; - uint64_t updates_ref = 0; - CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t updates_ref = 0; + CHECK((((uintptr_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var); - updates_ref = (uint64_t)updates_var.inner & ~1; + updates_ref = (uintptr_t)updates_var.inner & ~1; return updates_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_revoke_and_ack.node_id.compressed_form, 33); return node_id_arr; } @@ -3031,17 +3044,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK); LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendClosingSigned_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendClosingSigned); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_closing_signed.node_id.compressed_form, 33); return node_id_arr; } @@ -3049,17 +3062,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendClosingSigned); LDKClosingSigned msg_var = obj->send_closing_signed.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_node_id"))) TS_LDKMessageSendEvent_SendShutdown_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendShutdown); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_shutdown.node_id.compressed_form, 33); return node_id_arr; } @@ -3067,17 +3080,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_msg LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendShutdown); LDKShutdown msg_var = obj->send_shutdown.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_channel_reestablish.node_id.compressed_form, 33); return node_id_arr; } @@ -3085,61 +3098,61 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestabli LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish); LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement); LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement); LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg; - uint64_t update_msg_ref = 0; - CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t update_msg_ref = 0; + CHECK((((uintptr_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var); - update_msg_ref = (uint64_t)update_msg_var.inner & ~1; + update_msg_ref = (uintptr_t)update_msg_var.inner & ~1; return update_msg_ref; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_BroadcastNodeAnnouncement); LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_BroadcastChannelUpdate); LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_channel_update.node_id.compressed_form, 33); return node_id_arr; } @@ -3147,30 +3160,30 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate); LDKChannelUpdate msg_var = obj->send_channel_update.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_node_id"))) TS_LDKMessageSendEvent_HandleError_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_HandleError); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->handle_error.node_id.compressed_form, 33); return node_id_arr; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_action"))) TS_LDKMessageSendEvent_HandleError_get_action(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_HandleError); - uint64_t action_ref = ((uint64_t)&obj->handle_error.action) | 1; + uintptr_t action_ref = ((uintptr_t)&obj->handle_error.action) | 1; return action_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_channel_range_query.node_id.compressed_form, 33); return node_id_arr; } @@ -3178,17 +3191,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuer LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery); LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_short_ids_query.node_id.compressed_form, 33); return node_id_arr; } @@ -3196,17 +3209,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery); LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_reply_channel_range.node_id.compressed_form, 33); return node_id_arr; } @@ -3214,11 +3227,11 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRang LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange); LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) { @@ -3245,11 +3258,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_err"))) TS_CResult_boolLightningErrorZ_get_err(uint32_t owner) { LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)(owner & ~1); LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3262,11 +3275,11 @@ static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUp uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(uint32_t owner) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3279,11 +3292,11 @@ static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateCh uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(uint32_t owner) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3296,11 +3309,11 @@ static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateCh uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(uint32_t owner) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3328,7 +3341,7 @@ CHECK(owner->result_ok); int8_tArray __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok(uint32_t owner) { LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(owner & ~1); LDKCVec_u8Z ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -3341,11 +3354,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err(uint32_t owner) { LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(owner & ~1); LDKPeerHandleError ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3368,11 +3381,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_err"))) TS_CResult_NonePeerHandleErrorZ_get_err(uint32_t owner) { LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)(owner & ~1); LDKPeerHandleError ret_var = CResult_NonePeerHandleErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3396,11 +3409,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_err"))) TS_CResult_boolPeerHandleErrorZ_get_err(uint32_t owner) { LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)(owner & ~1); LDKPeerHandleError ret_var = CResult_boolPeerHandleErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3415,7 +3428,7 @@ uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_ok"))) TS LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)(owner & ~1); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv); - return (uint64_t)ret_ref; + return (uintptr_t)ret_ref; } static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){ @@ -3461,7 +3474,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_usizeTransactionZZ_So LDKC2Tuple_usizeTransactionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *some_conv = obj->some; *some_conv = C2Tuple_usizeTransactionZ_clone(some_conv); - return ((uint64_t)some_conv); + return ((uintptr_t)some_conv); } uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_ty_from_ptr"))) TS_LDKCOption_ClosureReasonZ_ty_from_ptr(uint32_t ptr) { LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)(ptr & ~1); @@ -3474,7 +3487,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_ty_from_ptr")) uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_Some_get_some"))) TS_LDKCOption_ClosureReasonZ_Some_get_some(uint32_t ptr) { LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)(ptr & ~1); assert(obj->tag == LDKCOption_ClosureReasonZ_Some); - uint64_t some_ref = ((uint64_t)&obj->some) | 1; + uintptr_t some_ref = ((uintptr_t)&obj->some) | 1; return some_ref; } static inline struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){ @@ -3485,7 +3498,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErr LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(owner & ~1); LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -3496,11 +3509,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3518,7 +3531,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_EventZ_ty_from_ptr"))) TS_LDK uint32_t __attribute__((export_name("TS_LDKCOption_EventZ_Some_get_some"))) TS_LDKCOption_EventZ_Some_get_some(uint32_t ptr) { LDKCOption_EventZ *obj = (LDKCOption_EventZ*)(ptr & ~1); assert(obj->tag == LDKCOption_EventZ_Some); - uint64_t some_ref = ((uint64_t)&obj->some) | 1; + uintptr_t some_ref = ((uintptr_t)&obj->some) | 1; return some_ref; } static inline struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){ @@ -3529,7 +3542,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_ LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(owner & ~1); LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); *ret_copy = CResult_COption_EventZDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -3540,11 +3553,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_err"))) TS_CResult_COption_EventZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3558,11 +3571,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_ok"))) TS_CResult_NodeIdDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3576,11 +3589,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_err"))) TS_CResult_NodeIdDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3595,7 +3608,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErr LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -3606,11 +3619,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3629,10 +3642,10 @@ static void LDKAccess_JCalls_free(void* this_arg) { } LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) { LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg; - int8_tArray genesis_hash_arr = init_int8_tArray(32); + int8_tArray genesis_hash_arr = init_int8_tArray(32, __LINE__); memcpy(genesis_hash_arr->elems, *genesis_hash, 32); uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 17, (uint32_t)genesis_hash_arr, (uint32_t)short_channel_id); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr); FREE((void*)ret); @@ -3660,16 +3673,16 @@ long __attribute__((export_name("TS_LDKAccess_new"))) TS_LDKAccess_new(JSValue return (long)res_ptr; } uint32_t __attribute__((export_name("TS_Access_get_utxo"))) TS_Access_get_utxo(uint32_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr; unsigned char genesis_hash_arr[32]; CHECK(genesis_hash->arr_len == 32); - memcpy(genesis_hash_arr, genesis_hash->elems, 32); + memcpy(genesis_hash_arr, genesis_hash->elems, 32); FREE(genesis_hash); unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr; LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_LDKCOption_AccessZ_ty_from_ptr"))) TS_LDKCOption_AccessZ_ty_from_ptr(uint32_t ptr) { @@ -3686,7 +3699,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_AccessZ_Some_get_some"))) TS_ LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess"); *some_ret = obj->some; // Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances - return (uint64_t)some_ret; + return (uintptr_t)some_ret; } static inline struct LDKDirectionalChannelInfo CResult_DirectionalChannelInfoDecodeErrorZ_get_ok(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); @@ -3695,11 +3708,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_get_ok"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(owner & ~1); LDKDirectionalChannelInfo ret_var = CResult_DirectionalChannelInfoDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3713,11 +3726,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_get_err"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_DirectionalChannelInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3731,11 +3744,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3749,11 +3762,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelInfoDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3767,11 +3780,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3785,11 +3798,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_err"))) TS_CResult_RoutingFeesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3809,7 +3822,7 @@ uint32_t __attribute__((export_name("TS_LDKNetAddress_ty_from_ptr"))) TS_LDKNetA int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv4_get_addr"))) TS_LDKNetAddress_IPv4_get_addr(uint32_t ptr) { LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); assert(obj->tag == LDKNetAddress_IPv4); - int8_tArray addr_arr = init_int8_tArray(4); + int8_tArray addr_arr = init_int8_tArray(4, __LINE__); memcpy(addr_arr->elems, obj->i_pv4.addr.data, 4); return addr_arr; } @@ -3821,7 +3834,7 @@ int16_t __attribute__((export_name("TS_LDKNetAddress_IPv4_get_port"))) TS_LDKNet int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv6_get_addr"))) TS_LDKNetAddress_IPv6_get_addr(uint32_t ptr) { LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); assert(obj->tag == LDKNetAddress_IPv6); - int8_tArray addr_arr = init_int8_tArray(16); + int8_tArray addr_arr = init_int8_tArray(16, __LINE__); memcpy(addr_arr->elems, obj->i_pv6.addr.data, 16); return addr_arr; } @@ -3833,14 +3846,14 @@ int16_t __attribute__((export_name("TS_LDKNetAddress_IPv6_get_port"))) TS_LDKNet int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV2_get_onion_v2"))) TS_LDKNetAddress_OnionV2_get_onion_v2(uint32_t ptr) { LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); assert(obj->tag == LDKNetAddress_OnionV2); - int8_tArray onion_v2_arr = init_int8_tArray(12); + int8_tArray onion_v2_arr = init_int8_tArray(12, __LINE__); memcpy(onion_v2_arr->elems, obj->onion_v2.data, 12); return onion_v2_arr; } int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_ed25519_pubkey"))) TS_LDKNetAddress_OnionV3_get_ed25519_pubkey(uint32_t ptr) { LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); assert(obj->tag == LDKNetAddress_OnionV3); - int8_tArray ed25519_pubkey_arr = init_int8_tArray(32); + int8_tArray ed25519_pubkey_arr = init_int8_tArray(32, __LINE__); memcpy(ed25519_pubkey_arr->elems, obj->onion_v3.ed25519_pubkey.data, 32); return ed25519_pubkey_arr; } @@ -3873,11 +3886,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3891,11 +3904,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3914,11 +3927,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeInfoDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3932,11 +3945,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_err"))) TS_CResult_NodeInfoDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3950,11 +3963,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); LDKNetworkGraph ret_var = CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3968,11 +3981,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_err"))) TS_CResult_NetworkGraphDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3992,10 +4005,10 @@ uint32_tArray __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_Some_g assert(obj->tag == LDKCOption_CVec_NetAddressZZ_Some); LDKCVec_NetAddressZ some_var = obj->some; uint32_tArray some_arr = NULL; - some_arr = init_uint32_tArray(some_var.datalen); + some_arr = init_uint32_tArray(some_var.datalen, __LINE__); uint32_t *some_arr_ptr = (uint32_t*)(((uint8_t*)some_arr) + 4); for (size_t m = 0; m < some_var.datalen; m++) { - uint64_t some_conv_12_ref = ((uint64_t)&some_var.data[m]) | 1; + uintptr_t some_conv_12_ref = ((uintptr_t)&some_var.data[m]) | 1; some_arr_ptr[m] = some_conv_12_ref; } @@ -4008,11 +4021,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_get_ok"))) TS_CResult_ScoringParametersDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ScoringParametersDecodeErrorZ* owner_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(owner & ~1); LDKScoringParameters ret_var = *CResult_ScoringParametersDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner & ~1; + ret_ref = (uintptr_t)ret_var.inner & ~1; return ret_ref; } @@ -4023,11 +4036,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_get_err"))) TS_CResult_ScoringParametersDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ScoringParametersDecodeErrorZ* owner_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ScoringParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4041,11 +4054,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(owner & ~1); LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4059,11 +4072,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_err"))) TS_CResult_InitFeaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4077,11 +4090,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(owner & ~1); LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4095,11 +4108,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4113,11 +4126,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(owner & ~1); LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4131,11 +4144,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4149,11 +4162,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(owner & ~1); LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4167,11 +4180,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4185,11 +4198,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(owner & ~1); LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4203,11 +4216,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4222,7 +4235,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_ok") LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)(owner & ~1); LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -4233,11 +4246,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_err"))) TS_CResult_NetAddressDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NetAddressDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4279,11 +4292,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(owner & ~1); LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4297,11 +4310,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_err"))) TS_CResult_AcceptChannelDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4315,11 +4328,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(owner & ~1); LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4333,11 +4346,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4351,11 +4364,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(owner & ~1); LDKChannelReestablish ret_var = CResult_ChannelReestablishDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4369,11 +4382,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4387,11 +4400,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(owner & ~1); LDKClosingSigned ret_var = CResult_ClosingSignedDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4405,11 +4418,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4423,11 +4436,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(owner & ~1); LDKClosingSignedFeeRange ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4441,11 +4454,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4459,11 +4472,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(owner & ~1); LDKCommitmentSigned ret_var = CResult_CommitmentSignedDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4477,11 +4490,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4495,11 +4508,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(owner & ~1); LDKFundingCreated ret_var = CResult_FundingCreatedDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4513,11 +4526,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_err"))) TS_CResult_FundingCreatedDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4531,11 +4544,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_ok"))) TS_CResult_FundingSignedDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(owner & ~1); LDKFundingSigned ret_var = CResult_FundingSignedDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4549,11 +4562,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_err"))) TS_CResult_FundingSignedDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4567,11 +4580,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_get_ok"))) TS_CResult_FundingLockedDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_FundingLockedDecodeErrorZ* owner_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(owner & ~1); LDKFundingLocked ret_var = CResult_FundingLockedDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4585,11 +4598,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_get_err"))) TS_CResult_FundingLockedDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_FundingLockedDecodeErrorZ* owner_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_FundingLockedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4603,11 +4616,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_ok"))) TS_CResult_InitDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)(owner & ~1); LDKInit ret_var = CResult_InitDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4621,11 +4634,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_err"))) TS_CResult_InitDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_InitDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4639,11 +4652,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_ok"))) TS_CResult_OpenChannelDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(owner & ~1); LDKOpenChannel ret_var = CResult_OpenChannelDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4657,11 +4670,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_err"))) TS_CResult_OpenChannelDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4675,11 +4688,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(owner & ~1); LDKRevokeAndACK ret_var = CResult_RevokeAndACKDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4693,11 +4706,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4711,11 +4724,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_ok"))) TS_CResult_ShutdownDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)(owner & ~1); LDKShutdown ret_var = CResult_ShutdownDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4729,11 +4742,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_err"))) TS_CResult_ShutdownDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ShutdownDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4747,11 +4760,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(owner & ~1); LDKUpdateFailHTLC ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4765,11 +4778,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4783,11 +4796,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(owner & ~1); LDKUpdateFailMalformedHTLC ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4801,11 +4814,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4819,11 +4832,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(owner & ~1); LDKUpdateFee ret_var = CResult_UpdateFeeDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4837,11 +4850,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_err"))) TS_CResult_UpdateFeeDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4855,11 +4868,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(owner & ~1); LDKUpdateFulfillHTLC ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4873,11 +4886,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4891,11 +4904,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(owner & ~1); LDKUpdateAddHTLC ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4909,11 +4922,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4927,11 +4940,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_ok"))) TS_CResult_PingDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)(owner & ~1); LDKPing ret_var = CResult_PingDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4945,11 +4958,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_err"))) TS_CResult_PingDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_PingDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4963,11 +4976,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_ok"))) TS_CResult_PongDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)(owner & ~1); LDKPong ret_var = CResult_PongDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4981,11 +4994,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_err"))) TS_CResult_PongDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_PongDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4999,11 +5012,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(owner & ~1); LDKUnsignedChannelAnnouncement ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5017,11 +5030,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5035,11 +5048,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(owner & ~1); LDKChannelAnnouncement ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5053,11 +5066,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5071,11 +5084,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(owner & ~1); LDKUnsignedChannelUpdate ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5089,11 +5102,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5107,11 +5120,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(owner & ~1); LDKChannelUpdate ret_var = CResult_ChannelUpdateDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5125,11 +5138,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5143,11 +5156,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(owner & ~1); LDKErrorMessage ret_var = CResult_ErrorMessageDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5161,11 +5174,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_err"))) TS_CResult_ErrorMessageDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5179,11 +5192,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(owner & ~1); LDKUnsignedNodeAnnouncement ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5197,11 +5210,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5215,11 +5228,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(owner & ~1); LDKNodeAnnouncement ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5233,11 +5246,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5251,11 +5264,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(owner & ~1); LDKQueryShortChannelIds ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5269,11 +5282,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5287,11 +5300,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(owner & ~1); LDKReplyShortChannelIdsEnd ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5305,11 +5318,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5323,11 +5336,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(owner & ~1); LDKQueryChannelRange ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5341,11 +5354,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5359,11 +5372,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(owner & ~1); LDKReplyChannelRange ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5377,11 +5390,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5395,11 +5408,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(owner & ~1); LDKGossipTimestampFilter ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5413,11 +5426,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5431,11 +5444,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5449,11 +5462,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5467,11 +5480,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5485,11 +5498,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5504,7 +5517,7 @@ uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecode LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -5515,11 +5528,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5534,7 +5547,7 @@ uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_ok"))) TS_ LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)(owner & ~1); LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = CResult_SignDecodeErrorZ_get_ok(owner_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){ @@ -5544,11 +5557,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_err"))) TS_CResult_SignDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_SignDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5561,7 +5574,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_ok"))) TS_CResult_RecoverableSignatureNoneZ_get_ok(uint32_t owner) { LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(68); + int8_tArray ret_arr = init_int8_tArray(68, __LINE__); memcpy(ret_arr->elems, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form, 68); return ret_arr; } @@ -5590,11 +5603,11 @@ ptrArray __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok"))) LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(owner & ~1); LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { LDKCVec_u8Z ret_conv_12_var = ret_var.data[m]; - int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen); + int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__); memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen); CVec_u8Z_free(ret_conv_12_var); ret_arr_ptr[m] = ret_conv_12_arr; @@ -5620,11 +5633,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(owner & ~1); LDKInMemorySigner ret_var = CResult_InMemorySignerDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5638,11 +5651,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_err"))) TS_CResult_InMemorySignerDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5663,7 +5676,7 @@ CHECK(owner->result_ok); int8_tArray __attribute__((export_name("TS_CResult_TransactionNoneZ_get_ok"))) TS_CResult_TransactionNoneZ_get_ok(uint32_t owner) { LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)(owner & ~1); LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -5689,26 +5702,26 @@ static void LDKFilter_JCalls_free(void* this_arg) { } void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; - int8_tArray txid_arr = init_int8_tArray(32); + int8_tArray txid_arr = init_int8_tArray(32, __LINE__); memcpy(txid_arr->elems, *txid, 32); LDKu8slice script_pubkey_var = script_pubkey; - int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen); + int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__); memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen); js_invoke_function_2(j_calls->instance_ptr, 18, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr); } LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; LDKWatchedOutput output_var = output; - uint64_t output_ref = 0; - CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t output_ref = 0; + CHECK((((uintptr_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var); - output_ref = (uint64_t)output_var.inner; + output_ref = (uintptr_t)output_var.inner; if (output_var.is_owned) { output_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 19, (uint32_t)output_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr); FREE((void*)ret); @@ -5737,21 +5750,21 @@ long __attribute__((export_name("TS_LDKFilter_new"))) TS_LDKFilter_new(JSValue return (long)res_ptr; } void __attribute__((export_name("TS_Filter_register_tx"))) TS_Filter_register_tx(uint32_t this_arg, int8_tArray txid, int8_tArray script_pubkey) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr; unsigned char txid_arr[32]; CHECK(txid->arr_len == 32); - memcpy(txid_arr, txid->elems, 32); + memcpy(txid_arr, txid->elems, 32); FREE(txid); unsigned char (*txid_ref)[32] = &txid_arr; LDKu8slice script_pubkey_ref; script_pubkey_ref.datalen = script_pubkey->arr_len; - script_pubkey_ref.data = script_pubkey->elems; + script_pubkey_ref.data = script_pubkey->elems /* XXX script_pubkey leaks */; (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref); } uint32_t __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_register_output(uint32_t this_arg, uint32_t output) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr; LDKWatchedOutput output_conv; @@ -5761,7 +5774,7 @@ uint32_t __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_re output_conv = WatchedOutput_clone(&output_conv); LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -5779,7 +5792,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_FilterZ_Some_get_some"))) TS_ LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter"); *some_ret = obj->some; // Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances - return (uint64_t)some_ret; + return (uintptr_t)some_ret; } static inline struct LDKLockedChannelMonitor *CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); @@ -5788,11 +5801,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_ok"))) TS_CResult_LockedChannelMonitorNoneZ_get_ok(uint32_t owner) { LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)(owner & ~1); LDKLockedChannelMonitor ret_var = *CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner & ~1; + ret_ref = (uintptr_t)ret_var.inner & ~1; return ret_ref; } @@ -5861,11 +5874,11 @@ uint32_t __attribute__((export_name("TS_LDKAPIError_IncompatibleShutdownScript_g LDKAPIError *obj = (LDKAPIError*)(ptr & ~1); assert(obj->tag == LDKAPIError_IncompatibleShutdownScript); LDKShutdownScript script_var = obj->incompatible_shutdown_script.script; - uint64_t script_ref = 0; - CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t script_ref = 0; + CHECK((((uintptr_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var); - script_ref = (uint64_t)script_var.inner & ~1; + script_ref = (uintptr_t)script_var.inner & ~1; return script_ref; } static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){ @@ -5885,7 +5898,7 @@ uint32_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_err"))) TS_CR LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)(owner & ~1); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -5922,7 +5935,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult__u832APIErrorZ_get_ok"))) TS_CResult__u832APIErrorZ_get_ok(uint32_t owner) { LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult__u832APIErrorZ_get_ok(owner_conv).data, 32); return ret_arr; } @@ -5935,7 +5948,7 @@ uint32_t __attribute__((export_name("TS_CResult__u832APIErrorZ_get_err"))) TS_C LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)(owner & ~1); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = CResult__u832APIErrorZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -5952,7 +5965,7 @@ uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_ty_from_ptr"))) TS uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_ParameterError_get_parameter_error"))) TS_LDKPaymentSendFailure_ParameterError_get_parameter_error(uint32_t ptr) { LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)(ptr & ~1); assert(obj->tag == LDKPaymentSendFailure_ParameterError); - uint64_t parameter_error_ref = ((uint64_t)&obj->parameter_error) | 1; + uintptr_t parameter_error_ref = ((uintptr_t)&obj->parameter_error) | 1; return parameter_error_ref; } uint32_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error"))) TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error(uint32_t ptr) { @@ -5960,13 +5973,13 @@ uint32_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PathParameter assert(obj->tag == LDKPaymentSendFailure_PathParameterError); LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error; uint32_tArray path_parameter_error_arr = NULL; - path_parameter_error_arr = init_uint32_tArray(path_parameter_error_var.datalen); + path_parameter_error_arr = init_uint32_tArray(path_parameter_error_var.datalen, __LINE__); uint32_t *path_parameter_error_arr_ptr = (uint32_t*)(((uint8_t*)path_parameter_error_arr) + 4); for (size_t w = 0; w < path_parameter_error_var.datalen; w++) { LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w]; *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv); - path_parameter_error_arr_ptr[w] = (uint64_t)path_parameter_error_conv_22_conv; + path_parameter_error_arr_ptr[w] = (uintptr_t)path_parameter_error_conv_22_conv; } return path_parameter_error_arr; @@ -5976,10 +5989,10 @@ uint32_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_AllFailedRetr assert(obj->tag == LDKPaymentSendFailure_AllFailedRetrySafe); LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe; uint32_tArray all_failed_retry_safe_arr = NULL; - all_failed_retry_safe_arr = init_uint32_tArray(all_failed_retry_safe_var.datalen); + all_failed_retry_safe_arr = init_uint32_tArray(all_failed_retry_safe_var.datalen, __LINE__); uint32_t *all_failed_retry_safe_arr_ptr = (uint32_t*)(((uint8_t*)all_failed_retry_safe_arr) + 4); for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) { - uint64_t all_failed_retry_safe_conv_10_ref = ((uint64_t)&all_failed_retry_safe_var.data[k]) | 1; + uintptr_t all_failed_retry_safe_conv_10_ref = ((uintptr_t)&all_failed_retry_safe_var.data[k]) | 1; all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref; } @@ -5990,13 +6003,13 @@ uint32_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailur assert(obj->tag == LDKPaymentSendFailure_PartialFailure); LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results; uint32_tArray results_arr = NULL; - results_arr = init_uint32_tArray(results_var.datalen); + results_arr = init_uint32_tArray(results_var.datalen, __LINE__); uint32_t *results_arr_ptr = (uint32_t*)(((uint8_t*)results_arr) + 4); for (size_t w = 0; w < results_var.datalen; w++) { LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *results_conv_22_conv = results_var.data[w]; *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv); - results_arr_ptr[w] = (uint64_t)results_conv_22_conv; + results_arr_ptr[w] = (uintptr_t)results_conv_22_conv; } return results_arr; @@ -6005,19 +6018,19 @@ uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)(ptr & ~1); assert(obj->tag == LDKPaymentSendFailure_PartialFailure); LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry; - uint64_t failed_paths_retry_ref = 0; - if ((uint64_t)failed_paths_retry_var.inner > 4096) { - CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t failed_paths_retry_ref = 0; + if ((uintptr_t)failed_paths_retry_var.inner > 4096) { + CHECK((((uintptr_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var); - failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1; + failed_paths_retry_ref = (uintptr_t)failed_paths_retry_var.inner & ~1; } return failed_paths_retry_ref; } int8_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_payment_id"))) TS_LDKPaymentSendFailure_PartialFailure_get_payment_id(uint32_t ptr) { LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)(ptr & ~1); assert(obj->tag == LDKPaymentSendFailure_PartialFailure); - int8_tArray payment_id_arr = init_int8_tArray(32); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, obj->partial_failure.payment_id.data, 32); return payment_id_arr; } @@ -6027,7 +6040,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_ok(uint32_t owner) { LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data, 32); return ret_arr; } @@ -6040,7 +6053,7 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_ge LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(owner & ~1); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6061,7 +6074,7 @@ uint32_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_err LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)(owner & ~1); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6070,7 +6083,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2 } int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_a"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_a(uint32_t owner) { LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -6080,7 +6093,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2 } int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_b"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_b(uint32_t owner) { LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_b(owner_conv).data, 32); return ret_arr; } @@ -6093,7 +6106,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPa LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(owner & ~1); LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } static inline struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){ @@ -6104,7 +6117,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPa LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(owner & ~1); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6113,7 +6126,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(L } int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_a"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_a(uint32_t owner) { LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -6123,7 +6136,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(L } int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_b"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_b(uint32_t owner) { LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_b(owner_conv).data, 32); return ret_arr; } @@ -6136,7 +6149,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(owner & ~1); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } static inline void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){ @@ -6156,7 +6169,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(owner & ~1); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } static inline struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){ @@ -6167,7 +6180,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(owner & ~1); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6177,7 +6190,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_ok"))) TS_CResult_PaymentSecretNoneZ_get_ok(uint32_t owner) { LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult_PaymentSecretNoneZ_get_ok(owner_conv).data, 32); return ret_arr; } @@ -6197,7 +6210,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_ok"))) TS_CResult_PaymentSecretAPIErrorZ_get_ok(uint32_t owner) { LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult_PaymentSecretAPIErrorZ_get_ok(owner_conv).data, 32); return ret_arr; } @@ -6210,7 +6223,7 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_err" LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(owner & ~1); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = CResult_PaymentSecretAPIErrorZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6220,7 +6233,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_get_ok(uint32_t owner) { LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult_PaymentPreimageAPIErrorZ_get_ok(owner_conv).data, 32); return ret_arr; } @@ -6233,7 +6246,7 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_er LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(owner & ~1); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = CResult_PaymentPreimageAPIErrorZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6257,25 +6270,25 @@ static void LDKWatch_JCalls_free(void* this_arg) { LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) { LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; LDKOutPoint funding_txo_var = funding_txo; - uint64_t funding_txo_ref = 0; - CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t funding_txo_ref = 0; + CHECK((((uintptr_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); - funding_txo_ref = (uint64_t)funding_txo_var.inner; + funding_txo_ref = (uintptr_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; } LDKChannelMonitor monitor_var = monitor; - uint64_t monitor_ref = 0; - CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t monitor_ref = 0; + CHECK((((uintptr_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); - monitor_ref = (uint64_t)monitor_var.inner; + monitor_ref = (uintptr_t)monitor_var.inner; if (monitor_var.is_owned) { monitor_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 20, (uint32_t)funding_txo_ref, (uint32_t)monitor_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); FREE((void*)ret); @@ -6284,25 +6297,25 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) { LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; LDKOutPoint funding_txo_var = funding_txo; - uint64_t funding_txo_ref = 0; - CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t funding_txo_ref = 0; + CHECK((((uintptr_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); - funding_txo_ref = (uint64_t)funding_txo_var.inner; + funding_txo_ref = (uintptr_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; } LDKChannelMonitorUpdate update_var = update; - uint64_t update_ref = 0; - CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t update_ref = 0; + CHECK((((uintptr_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); - update_ref = (uint64_t)update_var.inner; + update_ref = (uintptr_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 21, (uint32_t)funding_txo_ref, (uint32_t)update_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); FREE((void*)ret); @@ -6317,10 +6330,10 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); else ret_constr.data = NULL; - uint32_t* ret_vals = ret->elems; + uint32_t* ret_vals = ret->elems /* XXX ret leaks */; for (size_t o = 0; o < ret_constr.datalen; o++) { uint32_t ret_conv_14 = ret_vals[o]; - void* ret_conv_14_ptr = (void*)(((uint64_t)ret_conv_14) & ~1); + void* ret_conv_14_ptr = (void*)(((uintptr_t)ret_conv_14) & ~1); CHECK_ACCESS(ret_conv_14_ptr); LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr); FREE((void*)ret_conv_14); @@ -6352,7 +6365,7 @@ long __attribute__((export_name("TS_LDKWatch_new"))) TS_LDKWatch_new(JSValue o) return (long)res_ptr; } uint32_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t monitor) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; LDKOutPoint funding_txo_conv; @@ -6367,11 +6380,11 @@ uint32_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_ monitor_conv = ChannelMonitor_clone(&monitor_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_update_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t update) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; LDKOutPoint funding_txo_conv; @@ -6386,21 +6399,21 @@ uint32_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_updat update_conv = ChannelMonitorUpdate_clone(&update_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_tArray __attribute__((export_name("TS_Watch_release_pending_monitor_events"))) TS_Watch_release_pending_monitor_events(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t o = 0; o < ret_var.datalen; o++) { LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_conv_14_copy = ret_var.data[o]; - uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy; + uintptr_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; ret_arr_ptr[o] = ret_conv_14_ref; } @@ -6421,7 +6434,7 @@ static void LDKBroadcasterInterface_JCalls_free(void* this_arg) { void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) { LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg; LDKTransaction tx_var = tx; - int8_tArray tx_arr = init_int8_tArray(tx_var.datalen); + int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__); memcpy(tx_arr->elems, tx_var.data, tx_var.datalen); Transaction_free(tx_var); js_invoke_function_1(j_calls->instance_ptr, 23, (uint32_t)tx_arr); @@ -6448,13 +6461,13 @@ long __attribute__((export_name("TS_LDKBroadcasterInterface_new"))) TS_LDKBroad return (long)res_ptr; } void __attribute__((export_name("TS_BroadcasterInterface_broadcast_transaction"))) TS_BroadcasterInterface_broadcast_transaction(uint32_t this_arg, int8_tArray tx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr; LDKTransaction tx_ref; tx_ref.datalen = tx->arr_len; tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(tx_ref.data, tx->elems, tx_ref.datalen); + memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); tx_ref.data_is_owned = true; (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref); } @@ -6474,7 +6487,7 @@ LDKSecretKey get_node_secret_LDKKeysInterface_jcall(const void* this_arg) { int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 24); LDKSecretKey ret_ref; CHECK(ret->arr_len == 32); - memcpy(ret_ref.bytes, ret->elems, 32); + memcpy(ret_ref.bytes, ret->elems, 32); FREE(ret); return ret_ref; } LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) { @@ -6483,7 +6496,7 @@ LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(ret_ref.data, ret->elems, ret_ref.datalen); + memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); return ret_ref; } LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) { @@ -6498,7 +6511,7 @@ LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* t LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 27, (uint32_t)inbound, (uint32_t)channel_value_satoshis); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKSign ret_conv = *(LDKSign*)(ret_ptr); FREE((void*)ret); @@ -6509,16 +6522,16 @@ LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* thi int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 28); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); - memcpy(ret_ref.data, ret->elems, 32); + memcpy(ret_ref.data, ret->elems, 32); FREE(ret); return ret_ref; } LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; LDKu8slice reader_var = reader; - int8_tArray reader_arr = init_int8_tArray(reader_var.datalen); + int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__); memcpy(reader_arr->elems, reader_var.data, reader_var.datalen); uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 29, (uint32_t)reader_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr); FREE((void*)ret); @@ -6527,11 +6540,11 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKCVec_u8Z invoice_preimage) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; LDKCVec_u8Z invoice_preimage_var = invoice_preimage; - int8_tArray invoice_preimage_arr = init_int8_tArray(invoice_preimage_var.datalen); + int8_tArray invoice_preimage_arr = init_int8_tArray(invoice_preimage_var.datalen, __LINE__); memcpy(invoice_preimage_arr->elems, invoice_preimage_var.data, invoice_preimage_var.datalen); CVec_u8Z_free(invoice_preimage_var); uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 30, (uint32_t)invoice_preimage_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -6542,7 +6555,7 @@ LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 31); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); - memcpy(ret_ref.data, ret->elems, 32); + memcpy(ret_ref.data, ret->elems, 32); FREE(ret); return ret_ref; } static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) { @@ -6574,35 +6587,35 @@ long __attribute__((export_name("TS_LDKKeysInterface_new"))) TS_LDKKeysInterfac return (long)res_ptr; } int8_tArray __attribute__((export_name("TS_KeysInterface_get_node_secret"))) TS_KeysInterface_get_node_secret(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes, 32); return ret_arr; } int8_tArray __attribute__((export_name("TS_KeysInterface_get_destination_script"))) TS_KeysInterface_get_destination_script(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } uint32_t __attribute__((export_name("TS_KeysInterface_get_shutdown_scriptpubkey"))) TS_KeysInterface_get_shutdown_scriptpubkey(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -6610,53 +6623,53 @@ uint32_t __attribute__((export_name("TS_KeysInterface_get_shutdown_scriptpubkey } uint32_t __attribute__((export_name("TS_KeysInterface_get_channel_signer"))) TS_KeysInterface_get_channel_signer(uint32_t this_arg, jboolean inbound, int64_t channel_value_satoshis) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } int8_tArray __attribute__((export_name("TS_KeysInterface_get_secure_random_bytes"))) TS_KeysInterface_get_secure_random_bytes(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32); return ret_arr; } uint32_t __attribute__((export_name("TS_KeysInterface_read_chan_signer"))) TS_KeysInterface_read_chan_signer(uint32_t this_arg, int8_tArray reader) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; LDKu8slice reader_ref; reader_ref.datalen = reader->arr_len; - reader_ref.data = reader->elems; + reader_ref.data = reader->elems /* XXX reader leaks */; LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_KeysInterface_sign_invoice"))) TS_KeysInterface_sign_invoice(uint32_t this_arg, int8_tArray invoice_preimage) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; LDKCVec_u8Z invoice_preimage_ref; invoice_preimage_ref.datalen = invoice_preimage->arr_len; invoice_preimage_ref.data = MALLOC(invoice_preimage_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(invoice_preimage_ref.data, invoice_preimage->elems, invoice_preimage_ref.datalen); + memcpy(invoice_preimage_ref.data, invoice_preimage->elems, invoice_preimage_ref.datalen); FREE(invoice_preimage); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, invoice_preimage_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_KeysInterface_get_inbound_payment_key_material"))) TS_KeysInterface_get_inbound_payment_key_material(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data, 32); return ret_arr; } @@ -6698,7 +6711,7 @@ long __attribute__((export_name("TS_LDKFeeEstimator_new"))) TS_LDKFeeEstimator_ return (long)res_ptr; } int32_t __attribute__((export_name("TS_FeeEstimator_get_est_sat_per_1000_weight"))) TS_FeeEstimator_get_est_sat_per_1000_weight(uint32_t this_arg, uint32_t confirmation_target) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr; LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_js(confirmation_target); @@ -6719,12 +6732,12 @@ static void LDKLogger_JCalls_free(void* this_arg) { void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; LDKRecord record_var = *record; - uint64_t record_ref = 0; + uintptr_t record_ref = 0; record_var = Record_clone(record); - CHECK((((uint64_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); - record_ref = (uint64_t)record_var.inner; + record_ref = (uintptr_t)record_var.inner; if (record_var.is_owned) { record_ref |= 1; } @@ -6756,7 +6769,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LD } int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_a"))) TS_C2Tuple_BlockHashChannelManagerZ_get_a(uint32_t owner) { LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_BlockHashChannelManagerZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -6767,11 +6780,11 @@ static inline struct LDKChannelManager *C2Tuple_BlockHashChannelManagerZ_get_b(L uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_b"))) TS_C2Tuple_BlockHashChannelManagerZ_get_b(uint32_t owner) { LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)(owner & ~1); LDKChannelManager ret_var = *C2Tuple_BlockHashChannelManagerZ_get_b(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner & ~1; + ret_ref = (uintptr_t)ret_var.inner & ~1; return ret_ref; } @@ -6781,7 +6794,7 @@ CHECK(owner->result_ok); } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(owner & ~1); - uint64_t ret_ret = (uint64_t)CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv) | 1; + uintptr_t ret_ret = (uintptr_t)CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv) | 1; return ret_ret; } @@ -6792,11 +6805,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -6822,10 +6835,10 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements"); else ret_constr.data = NULL; - uint32_t* ret_vals = ret->elems; + uint32_t* ret_vals = ret->elems /* XXX ret leaks */; for (size_t s = 0; s < ret_constr.datalen; s++) { uint32_t ret_conv_18 = ret_vals[s]; - void* ret_conv_18_ptr = (void*)(((uint64_t)ret_conv_18) & ~1); + void* ret_conv_18_ptr = (void*)(((uintptr_t)ret_conv_18) & ~1); CHECK_ACCESS(ret_conv_18_ptr); LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr); FREE((void*)ret_conv_18); @@ -6855,17 +6868,17 @@ long __attribute__((export_name("TS_LDKMessageSendEventsProvider_new"))) TS_LDK return (long)res_ptr; } uint32_tArray __attribute__((export_name("TS_MessageSendEventsProvider_get_and_clear_pending_msg_events"))) TS_MessageSendEventsProvider_get_and_clear_pending_msg_events(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr; LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t s = 0; s < ret_var.datalen; s++) { LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_conv_18_copy = ret_var.data[s]; - uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_copy; + uintptr_t ret_conv_18_ref = (uintptr_t)ret_conv_18_copy; ret_arr_ptr[s] = ret_conv_18_ref; } @@ -6887,7 +6900,7 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * e LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion"); *ret_event = Event_clone(event); - js_invoke_function_1(j_calls->instance_ptr, 35, (uint32_t)(uint64_t)ret_event); + js_invoke_function_1(j_calls->instance_ptr, 35, (uint32_t)(uintptr_t)ret_event); } static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg; @@ -6911,7 +6924,7 @@ long __attribute__((export_name("TS_LDKEventHandler_new"))) TS_LDKEventHandler_ return (long)res_ptr; } void __attribute__((export_name("TS_EventHandler_handle_event"))) TS_EventHandler_handle_event(uint32_t this_arg, uint32_t event) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr; LDKEvent* event_conv = (LDKEvent*)event; @@ -6932,7 +6945,7 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *handler_ret = handler; - js_invoke_function_1(j_calls->instance_ptr, 36, (uint32_t)(uint64_t)handler_ret); + js_invoke_function_1(j_calls->instance_ptr, 36, (uint32_t)(uintptr_t)handler_ret); } static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) { LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg; @@ -6956,10 +6969,10 @@ long __attribute__((export_name("TS_LDKEventsProvider_new"))) TS_LDKEventsProvi return (long)res_ptr; } void __attribute__((export_name("TS_EventsProvider_process_pending_events"))) TS_EventsProvider_process_pending_events(uint32_t this_arg, uint32_t handler) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr; - void* handler_ptr = (void*)(((uint64_t)handler) & ~1); + void* handler_ptr = (void*)(((uintptr_t)handler) & ~1); CHECK_ACCESS(handler_ptr); LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr); (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv); @@ -6978,13 +6991,13 @@ static void LDKListen_JCalls_free(void* this_arg) { void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; LDKu8slice block_var = block; - int8_tArray block_arr = init_int8_tArray(block_var.datalen); + int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__); memcpy(block_arr->elems, block_var.data, block_var.datalen); js_invoke_function_2(j_calls->instance_ptr, 37, (uint32_t)block_arr, (uint32_t)height); } void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; - int8_tArray header_arr = init_int8_tArray(80); + int8_tArray header_arr = init_int8_tArray(80, __LINE__); memcpy(header_arr->elems, *header, 80); js_invoke_function_2(j_calls->instance_ptr, 38, (uint32_t)header_arr, (uint32_t)height); } @@ -7011,22 +7024,22 @@ long __attribute__((export_name("TS_LDKListen_new"))) TS_LDKListen_new(JSValue return (long)res_ptr; } void __attribute__((export_name("TS_Listen_block_connected"))) TS_Listen_block_connected(uint32_t this_arg, int8_tArray block, int32_t height) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; LDKu8slice block_ref; block_ref.datalen = block->arr_len; - block_ref.data = block->elems; + block_ref.data = block->elems /* XXX block leaks */; (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height); } void __attribute__((export_name("TS_Listen_block_disconnected"))) TS_Listen_block_disconnected(uint32_t this_arg, int8_tArray header, int32_t height) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height); } @@ -7043,16 +7056,16 @@ static void LDKConfirm_JCalls_free(void* this_arg) { } void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; - int8_tArray header_arr = init_int8_tArray(80); + int8_tArray header_arr = init_int8_tArray(80, __LINE__); memcpy(header_arr->elems, *header, 80); LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata; uint32_tArray txdata_arr = NULL; - txdata_arr = init_uint32_tArray(txdata_var.datalen); + txdata_arr = init_uint32_tArray(txdata_var.datalen, __LINE__); uint32_t *txdata_arr_ptr = (uint32_t*)(((uint8_t*)txdata_arr) + 4); for (size_t c = 0; c < txdata_var.datalen; c++) { LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *txdata_conv_28_conv = txdata_var.data[c]; - txdata_arr_ptr[c] = ((uint64_t)txdata_conv_28_conv); + txdata_arr_ptr[c] = ((uintptr_t)txdata_conv_28_conv); } FREE(txdata_var.data); @@ -7060,13 +7073,13 @@ void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t } void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; - int8_tArray txid_arr = init_int8_tArray(32); + int8_tArray txid_arr = init_int8_tArray(32, __LINE__); memcpy(txid_arr->elems, *txid, 32); js_invoke_function_1(j_calls->instance_ptr, 40, (uint32_t)txid_arr); } void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; - int8_tArray header_arr = init_int8_tArray(80); + int8_tArray header_arr = init_int8_tArray(80, __LINE__); memcpy(header_arr->elems, *header, 80); js_invoke_function_2(j_calls->instance_ptr, 41, (uint32_t)header_arr, (uint32_t)height); } @@ -7079,12 +7092,12 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements"); else ret_constr.data = NULL; - int8_tArray* ret_vals = (void*) ret->elems; + int8_tArray* ret_vals = (void*) ret->elems /* XXX ret leaks */; for (size_t m = 0; m < ret_constr.datalen; m++) { int8_tArray ret_conv_12 = ret_vals[m]; LDKThirtyTwoBytes ret_conv_12_ref; CHECK(ret_conv_12->arr_len == 32); - memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); + memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); FREE(ret_conv_12); ret_constr.data[m] = ret_conv_12_ref; } return ret_constr; @@ -7114,12 +7127,12 @@ long __attribute__((export_name("TS_LDKConfirm_new"))) TS_LDKConfirm_new(JSValu return (long)res_ptr; } void __attribute__((export_name("TS_Confirm_transactions_confirmed"))) TS_Confirm_transactions_confirmed(uint32_t this_arg, int8_tArray header, uint32_tArray txdata, int32_t height) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; txdata_constr.datalen = txdata->arr_len; @@ -7127,50 +7140,50 @@ void __attribute__((export_name("TS_Confirm_transactions_confirmed"))) TS_Confi txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); else txdata_constr.data = NULL; - uint32_t* txdata_vals = txdata->elems; + uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */; for (size_t c = 0; c < txdata_constr.datalen; c++) { uint32_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1); + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); CHECK_ACCESS(txdata_conv_28_ptr); LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1)); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); txdata_constr.data[c] = txdata_conv_28_conv; } (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height); } void __attribute__((export_name("TS_Confirm_transaction_unconfirmed"))) TS_Confirm_transaction_unconfirmed(uint32_t this_arg, int8_tArray txid) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; unsigned char txid_arr[32]; CHECK(txid->arr_len == 32); - memcpy(txid_arr, txid->elems, 32); + memcpy(txid_arr, txid->elems, 32); FREE(txid); unsigned char (*txid_ref)[32] = &txid_arr; (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref); } void __attribute__((export_name("TS_Confirm_best_block_updated"))) TS_Confirm_best_block_updated(uint32_t this_arg, int8_tArray header, int32_t height) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height); } ptrArray __attribute__((export_name("TS_Confirm_get_relevant_txids"))) TS_Confirm_get_relevant_txids(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { - int8_tArray ret_conv_12_arr = init_int8_tArray(32); + int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__); memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32); ret_arr_ptr[m] = ret_conv_12_arr; } @@ -7192,35 +7205,35 @@ static void LDKPersist_JCalls_free(void* this_arg) { LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; LDKOutPoint channel_id_var = channel_id; - uint64_t channel_id_ref = 0; - CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t channel_id_ref = 0; + CHECK((((uintptr_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = (uint64_t)channel_id_var.inner; + channel_id_ref = (uintptr_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; } LDKChannelMonitor data_var = *data; - uint64_t data_ref = 0; + uintptr_t data_ref = 0; data_var = ChannelMonitor_clone(data); - CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = (uint64_t)data_var.inner; + data_ref = (uintptr_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; } LDKMonitorUpdateId update_id_var = update_id; - uint64_t update_id_ref = 0; - CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t update_id_ref = 0; + CHECK((((uintptr_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); - update_id_ref = (uint64_t)update_id_var.inner; + update_id_ref = (uintptr_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; } uint32_t ret = js_invoke_function_3(j_calls->instance_ptr, 43, (uint32_t)channel_id_ref, (uint32_t)data_ref, (uint32_t)update_id_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); FREE((void*)ret); @@ -7229,47 +7242,47 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; LDKOutPoint channel_id_var = channel_id; - uint64_t channel_id_ref = 0; - CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t channel_id_ref = 0; + CHECK((((uintptr_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = (uint64_t)channel_id_var.inner; + channel_id_ref = (uintptr_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; } LDKChannelMonitorUpdate update_var = *update; - uint64_t update_ref = 0; - if ((uint64_t)update_var.inner > 4096) { + uintptr_t update_ref = 0; + if ((uintptr_t)update_var.inner > 4096) { update_var = ChannelMonitorUpdate_clone(update); - CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); - update_ref = (uint64_t)update_var.inner; + update_ref = (uintptr_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; } } LDKChannelMonitor data_var = *data; - uint64_t data_ref = 0; + uintptr_t data_ref = 0; data_var = ChannelMonitor_clone(data); - CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = (uint64_t)data_var.inner; + data_ref = (uintptr_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; } LDKMonitorUpdateId update_id_var = update_id; - uint64_t update_id_ref = 0; - CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t update_id_ref = 0; + CHECK((((uintptr_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); - update_id_ref = (uint64_t)update_id_var.inner; + update_id_ref = (uintptr_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; } uint32_t ret = js_invoke_function_4(j_calls->instance_ptr, 44, (uint32_t)channel_id_ref, (uint32_t)update_ref, (uint32_t)data_ref, (uint32_t)update_id_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); FREE((void*)ret); @@ -7298,7 +7311,7 @@ long __attribute__((export_name("TS_LDKPersist_new"))) TS_LDKPersist_new(JSValu return (long)res_ptr; } uint32_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Persist_persist_new_channel(uint32_t this_arg, uint32_t channel_id, uint32_t data, uint32_t update_id) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; LDKOutPoint channel_id_conv; @@ -7317,11 +7330,11 @@ uint32_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Pers update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS_Persist_update_persisted_channel(uint32_t this_arg, uint32_t channel_id, uint32_t update, uint32_t data, uint32_t update_id) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; LDKOutPoint channel_id_conv; @@ -7344,7 +7357,7 @@ uint32_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } typedef struct LDKChannelMessageHandler_JCalls { @@ -7360,24 +7373,24 @@ static void LDKChannelMessageHandler_JCalls_free(void* this_arg) { } void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKInitFeatures their_features_var = their_features; - uint64_t their_features_ref = 0; - CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t their_features_ref = 0; + CHECK((((uintptr_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); - their_features_ref = (uint64_t)their_features_var.inner; + their_features_ref = (uintptr_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; } LDKOpenChannel msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = OpenChannel_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7385,24 +7398,24 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD } void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKInitFeatures their_features_var = their_features; - uint64_t their_features_ref = 0; - CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t their_features_ref = 0; + CHECK((((uintptr_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); - their_features_ref = (uint64_t)their_features_var.inner; + their_features_ref = (uintptr_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; } LDKAcceptChannel msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = AcceptChannel_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7410,15 +7423,15 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKFundingCreated msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = FundingCreated_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7426,15 +7439,15 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKFundingSigned msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = FundingSigned_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7442,15 +7455,15 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKFundingLocked msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = FundingLocked_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7458,25 +7471,25 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKInitFeatures their_features_var = *their_features; - uint64_t their_features_ref = 0; + uintptr_t their_features_ref = 0; their_features_var = InitFeatures_clone(their_features); - CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); - their_features_ref = (uint64_t)their_features_var.inner; + their_features_ref = (uintptr_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; } LDKShutdown msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = Shutdown_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7484,15 +7497,15 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub } void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKClosingSigned msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ClosingSigned_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7500,15 +7513,15 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKUpdateAddHTLC msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UpdateAddHTLC_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7516,15 +7529,15 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKUpdateFulfillHTLC msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UpdateFulfillHTLC_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7532,15 +7545,15 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ } void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKUpdateFailHTLC msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UpdateFailHTLC_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7548,15 +7561,15 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg } void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKUpdateFailMalformedHTLC msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UpdateFailMalformedHTLC_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7564,15 +7577,15 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void } void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKCommitmentSigned msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = CommitmentSigned_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7580,15 +7593,15 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar } void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKRevokeAndACK msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = RevokeAndACK_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7596,15 +7609,15 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKUpdateFee msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UpdateFee_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7612,15 +7625,15 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP } void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKAnnouncementSignatures msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = AnnouncementSignatures_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7628,21 +7641,21 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t } void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); js_invoke_function_2(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, (uint32_t)no_connection_possible); } void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKInit msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = Init_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7650,15 +7663,15 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl } void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKChannelReestablish msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ChannelReestablish_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7666,15 +7679,15 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ } void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKChannelUpdate msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ChannelUpdate_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7682,15 +7695,15 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKErrorMessage msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ErrorMessage_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7740,12 +7753,12 @@ long __attribute__((export_name("TS_LDKChannelMessageHandler_new"))) TS_LDKChan return (long)res_ptr; } void __attribute__((export_name("TS_ChannelMessageHandler_handle_open_channel"))) TS_ChannelMessageHandler_handle_open_channel(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); @@ -7759,12 +7772,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_open_channel") } void __attribute__((export_name("TS_ChannelMessageHandler_handle_accept_channel"))) TS_ChannelMessageHandler_handle_accept_channel(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); @@ -7778,12 +7791,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_accept_channel } void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_created"))) TS_ChannelMessageHandler_handle_funding_created(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7792,12 +7805,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_create } void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_signed"))) TS_ChannelMessageHandler_handle_funding_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7806,12 +7819,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_signed } void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_locked"))) TS_ChannelMessageHandler_handle_funding_locked(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7820,12 +7833,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_locked } void __attribute__((export_name("TS_ChannelMessageHandler_handle_shutdown"))) TS_ChannelMessageHandler_handle_shutdown(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = false; @@ -7838,12 +7851,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_shutdown"))) T } void __attribute__((export_name("TS_ChannelMessageHandler_handle_closing_signed"))) TS_ChannelMessageHandler_handle_closing_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7852,12 +7865,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_closing_signed } void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_add_htlc"))) TS_ChannelMessageHandler_handle_update_add_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKUpdateAddHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7866,12 +7879,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_add_htl } void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fulfill_htlc"))) TS_ChannelMessageHandler_handle_update_fulfill_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKUpdateFulfillHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7880,12 +7893,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fulfill } void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fail_htlc"))) TS_ChannelMessageHandler_handle_update_fail_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKUpdateFailHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7894,12 +7907,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fail_ht } void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fail_malformed_htlc"))) TS_ChannelMessageHandler_handle_update_fail_malformed_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKUpdateFailMalformedHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7908,12 +7921,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fail_ma } void __attribute__((export_name("TS_ChannelMessageHandler_handle_commitment_signed"))) TS_ChannelMessageHandler_handle_commitment_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKCommitmentSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7922,12 +7935,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_commitment_sig } void __attribute__((export_name("TS_ChannelMessageHandler_handle_revoke_and_ack"))) TS_ChannelMessageHandler_handle_revoke_and_ack(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7936,12 +7949,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_revoke_and_ack } void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fee"))) TS_ChannelMessageHandler_handle_update_fee(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKUpdateFee msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7950,12 +7963,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fee"))) } void __attribute__((export_name("TS_ChannelMessageHandler_handle_announcement_signatures"))) TS_ChannelMessageHandler_handle_announcement_signatures(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7964,22 +7977,22 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_announcement_s } void __attribute__((export_name("TS_ChannelMessageHandler_peer_disconnected"))) TS_ChannelMessageHandler_peer_disconnected(uint32_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible); } void __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS_ChannelMessageHandler_peer_connected(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKInit msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7988,12 +8001,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS } void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_reestablish"))) TS_ChannelMessageHandler_handle_channel_reestablish(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -8002,12 +8015,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_reesta } void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_update"))) TS_ChannelMessageHandler_handle_channel_update(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -8016,12 +8029,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_update } void __attribute__((export_name("TS_ChannelMessageHandler_handle_error"))) TS_ChannelMessageHandler_handle_error(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -8043,17 +8056,17 @@ static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) { LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; LDKNodeAnnouncement msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = NodeAnnouncement_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 65, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8062,17 +8075,17 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; LDKChannelAnnouncement msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ChannelAnnouncement_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 66, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8081,17 +8094,17 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; LDKChannelUpdate msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ChannelUpdate_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 67, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8106,10 +8119,10 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); else ret_constr.data = NULL; - uint32_t* ret_vals = ret->elems; + uint32_t* ret_vals = ret->elems /* XXX ret leaks */; for (size_t h = 0; h < ret_constr.datalen; h++) { uint32_t ret_conv_59 = ret_vals[h]; - void* ret_conv_59_ptr = (void*)(((uint64_t)ret_conv_59) & ~1); + void* ret_conv_59_ptr = (void*)(((uintptr_t)ret_conv_59) & ~1); CHECK_ACCESS(ret_conv_59_ptr); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr); FREE((void*)ret_conv_59); @@ -8119,7 +8132,7 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel } LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray starting_point_arr = init_int8_tArray(33); + int8_tArray starting_point_arr = init_int8_tArray(33, __LINE__); memcpy(starting_point_arr->elems, starting_point.compressed_form, 33); uint32_tArray ret = (uint32_tArray)js_invoke_function_2(j_calls->instance_ptr, 69, (uint32_t)starting_point_arr, (uint32_t)batch_amount); LDKCVec_NodeAnnouncementZ ret_constr; @@ -8128,7 +8141,7 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); else ret_constr.data = NULL; - uint32_t* ret_vals = ret->elems; + uint32_t* ret_vals = ret->elems /* XXX ret leaks */; for (size_t s = 0; s < ret_constr.datalen; s++) { uint32_t ret_conv_18 = ret_vals[s]; LDKNodeAnnouncement ret_conv_18_conv; @@ -8141,15 +8154,15 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j } void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKInit init_var = *init; - uint64_t init_ref = 0; + uintptr_t init_ref = 0; init_var = Init_clone(init); - CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var); - init_ref = (uint64_t)init_var.inner; + init_ref = (uintptr_t)init_var.inner; if (init_var.is_owned) { init_ref |= 1; } @@ -8157,19 +8170,19 @@ void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDK } LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKReplyChannelRange msg_var = msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8177,19 +8190,19 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl } LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKReplyShortChannelIdsEnd msg_var = msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8197,19 +8210,19 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess } LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKQueryChannelRange msg_var = msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 73, (uint32_t)their_node_id_arr, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8217,19 +8230,19 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl } LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKQueryShortChannelIds msg_var = msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 74, (uint32_t)their_node_id_arr, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8269,7 +8282,7 @@ long __attribute__((export_name("TS_LDKRoutingMessageHandler_new"))) TS_LDKRout return (long)res_ptr; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_node_announcement"))) TS_RoutingMessageHandler_handle_node_announcement(uint32_t this_arg, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKNodeAnnouncement msg_conv; @@ -8278,11 +8291,11 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_node_annou CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_announcement"))) TS_RoutingMessageHandler_handle_channel_announcement(uint32_t this_arg, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKChannelAnnouncement msg_conv; @@ -8291,11 +8304,11 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_an CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_update"))) TS_RoutingMessageHandler_handle_channel_update(uint32_t this_arg, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKChannelUpdate msg_conv; @@ -8304,21 +8317,21 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_up CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_channel_announcements"))) TS_RoutingMessageHandler_get_next_channel_announcements(uint32_t this_arg, int64_t starting_point, int8_t batch_amount) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t h = 0; h < ret_var.datalen; h++) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_59_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv_59_conv = ret_var.data[h]; - ret_arr_ptr[h] = ((uint64_t)ret_conv_59_conv); + ret_arr_ptr[h] = ((uintptr_t)ret_conv_59_conv); } FREE(ret_var.data); @@ -8326,23 +8339,23 @@ uint32_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_cha } uint32_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_node_announcements"))) TS_RoutingMessageHandler_get_next_node_announcements(uint32_t this_arg, int8_tArray starting_point, int8_t batch_amount) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey starting_point_ref; CHECK(starting_point->arr_len == 33); - memcpy(starting_point_ref.compressed_form, starting_point->elems, 33); + memcpy(starting_point_ref.compressed_form, starting_point->elems, 33); FREE(starting_point); LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t s = 0; s < ret_var.datalen; s++) { LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s]; - uint64_t ret_conv_18_ref = 0; - CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_18_ref = 0; + CHECK((((uintptr_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var); - ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner; + ret_conv_18_ref = (uintptr_t)ret_conv_18_var.inner; if (ret_conv_18_var.is_owned) { ret_conv_18_ref |= 1; } @@ -8354,12 +8367,12 @@ uint32_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_nod } void __attribute__((export_name("TS_RoutingMessageHandler_sync_routing_table"))) TS_RoutingMessageHandler_sync_routing_table(uint32_t this_arg, int8_tArray their_node_id, uint32_t init) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKInit init_conv; init_conv.inner = (void*)(init & (~1)); init_conv.is_owned = false; @@ -8368,12 +8381,12 @@ void __attribute__((export_name("TS_RoutingMessageHandler_sync_routing_table")) } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_channel_range"))) TS_RoutingMessageHandler_handle_reply_channel_range(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -8381,16 +8394,16 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_chan msg_conv = ReplyChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_short_channel_ids_end"))) TS_RoutingMessageHandler_handle_reply_short_channel_ids_end(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKReplyShortChannelIdsEnd msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -8398,16 +8411,16 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_shor msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_query_channel_range"))) TS_RoutingMessageHandler_handle_query_channel_range(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -8415,16 +8428,16 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_query_chan msg_conv = QueryChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_query_short_channel_ids"))) TS_RoutingMessageHandler_handle_query_short_channel_ids(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -8432,7 +8445,7 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_query_shor msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } typedef struct LDKCustomMessageReader_JCalls { @@ -8448,10 +8461,10 @@ static void LDKCustomMessageReader_JCalls_free(void* this_arg) { LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const void* this_arg, uint16_t message_type, LDKu8slice buffer) { LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg; LDKu8slice buffer_var = buffer; - int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen); + int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__); memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen); uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 75, (uint32_t)message_type, (uint32_t)buffer_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8479,15 +8492,15 @@ long __attribute__((export_name("TS_LDKCustomMessageReader_new"))) TS_LDKCustom return (long)res_ptr; } uint32_t __attribute__((export_name("TS_CustomMessageReader_read"))) TS_CustomMessageReader_read(uint32_t this_arg, int16_t message_type, int8_tArray buffer) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr; LDKu8slice buffer_ref; buffer_ref.datalen = buffer->arr_len; - buffer_ref.data = buffer->elems; + buffer_ref.data = buffer->elems /* XXX buffer leaks */; LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } typedef struct LDKCustomMessageHandler_JCalls { @@ -8505,10 +8518,10 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType"); *msg_ret = msg; - int8_tArray sender_node_id_arr = init_int8_tArray(33); + int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33); - uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 76, (uint32_t)(uint64_t)msg_ret, (uint32_t)sender_node_id_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 76, (uint32_t)(uintptr_t)msg_ret, (uint32_t)sender_node_id_arr); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8523,10 +8536,10 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements"); else ret_constr.data = NULL; - uint32_t* ret_vals = ret->elems; + uint32_t* ret_vals = ret->elems /* XXX ret leaks */; for (size_t z = 0; z < ret_constr.datalen; z++) { uint32_t ret_conv_25 = ret_vals[z]; - void* ret_conv_25_ptr = (void*)(((uint64_t)ret_conv_25) & ~1); + void* ret_conv_25_ptr = (void*)(((uintptr_t)ret_conv_25) & ~1); CHECK_ACCESS(ret_conv_25_ptr); LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr); FREE((void*)ret_conv_25); @@ -8560,32 +8573,32 @@ long __attribute__((export_name("TS_LDKCustomMessageHandler_new"))) TS_LDKCusto return (long)res_ptr; } uint32_t __attribute__((export_name("TS_CustomMessageHandler_handle_custom_message"))) TS_CustomMessageHandler_handle_custom_message(uint32_t this_arg, uint32_t msg, int8_tArray sender_node_id) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; - void* msg_ptr = (void*)(((uint64_t)msg) & ~1); + void* msg_ptr = (void*)(((uintptr_t)msg) & ~1); CHECK_ACCESS(msg_ptr); LDKType msg_conv = *(LDKType*)(msg_ptr); LDKPublicKey sender_node_id_ref; CHECK(sender_node_id->arr_len == 33); - memcpy(sender_node_id_ref.compressed_form, sender_node_id->elems, 33); + memcpy(sender_node_id_ref.compressed_form, sender_node_id->elems, 33); FREE(sender_node_id); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv, sender_node_id_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_tArray __attribute__((export_name("TS_CustomMessageHandler_get_and_clear_pending_msg"))) TS_CustomMessageHandler_get_and_clear_pending_msg(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t z = 0; z < ret_var.datalen; z++) { LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); *ret_conv_25_conv = ret_var.data[z]; - ret_arr_ptr[z] = ((uint64_t)ret_conv_25_conv); + ret_arr_ptr[z] = ((uintptr_t)ret_conv_25_conv); } FREE(ret_var.data); @@ -8605,7 +8618,7 @@ static void LDKSocketDescriptor_JCalls_free(void* this_arg) { uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; LDKu8slice data_var = data; - int8_tArray data_arr = init_int8_tArray(data_var.datalen); + int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__); memcpy(data_arr->elems, data_var.data, data_var.datalen); return js_invoke_function_2(j_calls->instance_ptr, 78, (uint32_t)data_arr, (uint32_t)resume_read); } @@ -8617,7 +8630,7 @@ bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescripto LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); *other_arg_clone = SocketDescriptor_clone(other_arg); - return js_invoke_function_1(j_calls->instance_ptr, 80, (uint32_t)(uint64_t)other_arg_clone); + return js_invoke_function_1(j_calls->instance_ptr, 80, (uint32_t)(uintptr_t)other_arg_clone); } uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; @@ -8648,26 +8661,26 @@ long __attribute__((export_name("TS_LDKSocketDescriptor_new"))) TS_LDKSocketDes *res_ptr = LDKSocketDescriptor_init(o); return (long)res_ptr; } -int64_t __attribute__((export_name("TS_SocketDescriptor_send_data"))) TS_SocketDescriptor_send_data(uint32_t this_arg, int8_tArray data, jboolean resume_read) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); +intptr_t __attribute__((export_name("TS_SocketDescriptor_send_data"))) TS_SocketDescriptor_send_data(uint32_t this_arg, int8_tArray data, jboolean resume_read) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr; LDKu8slice data_ref; data_ref.datalen = data->arr_len; - data_ref.data = data->elems; - int64_t ret_val = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read); + data_ref.data = data->elems /* XXX data leaks */; + intptr_t ret_val = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read); return ret_val; } void __attribute__((export_name("TS_SocketDescriptor_disconnect_socket"))) TS_SocketDescriptor_disconnect_socket(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr; (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg); } int64_t __attribute__((export_name("TS_SocketDescriptor_hash"))) TS_SocketDescriptor_hash(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr; int64_t ret_val = (this_arg_conv->hash)(this_arg_conv->this_arg); @@ -8688,24 +8701,24 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; LDKCOption_u64Z *channel_capacity_msat_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *channel_capacity_msat_copy = channel_capacity_msat; - uint64_t channel_capacity_msat_ref = (uint64_t)channel_capacity_msat_copy; + uintptr_t channel_capacity_msat_ref = (uintptr_t)channel_capacity_msat_copy; LDKNodeId source_var = *source; - uint64_t source_ref = 0; + uintptr_t source_ref = 0; source_var = NodeId_clone(source); - CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); - source_ref = (uint64_t)source_var.inner; + source_ref = (uintptr_t)source_var.inner; if (source_var.is_owned) { source_ref |= 1; } LDKNodeId target_var = *target; - uint64_t target_ref = 0; + uintptr_t target_ref = 0; target_var = NodeId_clone(target); - CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); - target_ref = (uint64_t)target_var.inner; + target_ref = (uintptr_t)target_var.inner; if (target_var.is_owned) { target_ref |= 1; } @@ -8715,15 +8728,15 @@ void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; LDKCVec_RouteHopZ path_var = path; uint32_tArray path_arr = NULL; - path_arr = init_uint32_tArray(path_var.datalen); + path_arr = init_uint32_tArray(path_var.datalen, __LINE__); uint32_t *path_arr_ptr = (uint32_t*)(((uint8_t*)path_arr) + 4); for (size_t k = 0; k < path_var.datalen; k++) { LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uint64_t)path_conv_10_var.inner; + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; if (path_conv_10_var.is_owned) { path_conv_10_ref |= 1; } @@ -8737,15 +8750,15 @@ void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ pa LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; LDKCVec_RouteHopZ path_var = path; uint32_tArray path_arr = NULL; - path_arr = init_uint32_tArray(path_var.datalen); + path_arr = init_uint32_tArray(path_var.datalen, __LINE__); uint32_t *path_arr_ptr = (uint32_t*)(((uint8_t*)path_arr) + 4); for (size_t k = 0; k < path_var.datalen; k++) { LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uint64_t)path_conv_10_var.inner; + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; if (path_conv_10_var.is_owned) { path_conv_10_ref |= 1; } @@ -8761,7 +8774,7 @@ LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) { LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(ret_ref.data, ret->elems, ret_ref.datalen); + memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); return ret_ref; } static void LDKScore_JCalls_cloned(LDKScore* new_obj) { @@ -8789,13 +8802,13 @@ long __attribute__((export_name("TS_LDKScore_new"))) TS_LDKScore_new(JSValue o) return (long)res_ptr; } int64_t __attribute__((export_name("TS_Score_channel_penalty_msat"))) TS_Score_channel_penalty_msat(uint32_t this_arg, int64_t short_channel_id, int64_t send_amt_msat, uint32_t channel_capacity_msat, uint32_t source, uint32_t target) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - void* channel_capacity_msat_ptr = (void*)(((uint64_t)channel_capacity_msat) & ~1); + void* channel_capacity_msat_ptr = (void*)(((uintptr_t)channel_capacity_msat) & ~1); CHECK_ACCESS(channel_capacity_msat_ptr); LDKCOption_u64Z channel_capacity_msat_conv = *(LDKCOption_u64Z*)(channel_capacity_msat_ptr); - channel_capacity_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)channel_capacity_msat) & ~1)); + channel_capacity_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)channel_capacity_msat) & ~1)); LDKNodeId source_conv; source_conv.inner = (void*)(source & (~1)); source_conv.is_owned = false; @@ -8809,7 +8822,7 @@ int64_t __attribute__((export_name("TS_Score_channel_penalty_msat"))) TS_Score_ } void __attribute__((export_name("TS_Score_payment_path_failed"))) TS_Score_payment_path_failed(uint32_t this_arg, uint32_tArray path, int64_t short_channel_id) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; LDKCVec_RouteHopZ path_constr; @@ -8818,7 +8831,7 @@ void __attribute__((export_name("TS_Score_payment_path_failed"))) TS_Score_paym path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else path_constr.data = NULL; - uint32_t* path_vals = path->elems; + uint32_t* path_vals = path->elems /* XXX path leaks */; for (size_t k = 0; k < path_constr.datalen; k++) { uint32_t path_conv_10 = path_vals[k]; LDKRouteHop path_conv_10_conv; @@ -8832,7 +8845,7 @@ void __attribute__((export_name("TS_Score_payment_path_failed"))) TS_Score_paym } void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_payment_path_successful(uint32_t this_arg, uint32_tArray path) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; LDKCVec_RouteHopZ path_constr; @@ -8841,7 +8854,7 @@ void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_ path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else path_constr.data = NULL; - uint32_t* path_vals = path->elems; + uint32_t* path_vals = path->elems /* XXX path leaks */; for (size_t k = 0; k < path_constr.datalen; k++) { uint32_t path_conv_10 = path_vals[k]; LDKRouteHop path_conv_10_conv; @@ -8855,11 +8868,11 @@ void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_ } int8_tArray __attribute__((export_name("TS_Score_write"))) TS_Score_write(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -8878,7 +8891,7 @@ static void LDKLockableScore_JCalls_free(void* this_arg) { LDKScore lock_LDKLockableScore_jcall(const void* this_arg) { LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg; uint32_t ret = js_invoke_function_0(j_calls->instance_ptr, 86); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKScore ret_conv = *(LDKScore*)(ret_ptr);// Warning: we may need a move here but no clone is available for LDKScore @@ -8906,12 +8919,12 @@ long __attribute__((export_name("TS_LDKLockableScore_new"))) TS_LDKLockableScor return (long)res_ptr; } uint32_t __attribute__((export_name("TS_LockableScore_lock"))) TS_LockableScore_lock(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr; LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } jstring __attribute__((export_name("TS__ldk_get_compiled_version"))) TS__ldk_get_compiled_version() { @@ -8932,7 +8945,7 @@ void __attribute__((export_name("TS_Transaction_free"))) TS_Transaction_free(in LDKTransaction _res_ref; _res_ref.datalen = _res->arr_len; _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes"); - memcpy(_res_ref.data, _res->elems, _res_ref.datalen); + memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res); _res_ref.data_is_owned = true; Transaction_free(_res_ref); } @@ -8941,15 +8954,15 @@ uint32_t __attribute__((export_name("TS_TxOut_new"))) TS_TxOut_new(int8_tArray LDKCVec_u8Z script_pubkey_ref; script_pubkey_ref.datalen = script_pubkey->arr_len; script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_pubkey_ref.data, script_pubkey->elems, script_pubkey_ref.datalen); + memcpy(script_pubkey_ref.data, script_pubkey->elems, script_pubkey_ref.datalen); FREE(script_pubkey); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); *ret_ref = TxOut_new(script_pubkey_ref, value); - return (uint64_t)ret_ref; + return (uintptr_t)ret_ref; } void __attribute__((export_name("TS_TxOut_free"))) TS_TxOut_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr); FREE((void*)_res); @@ -8959,11 +8972,11 @@ void __attribute__((export_name("TS_TxOut_free"))) TS_TxOut_free(uint32_t _res) static inline uintptr_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) { LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); *ret_ref = TxOut_clone(arg); - return (uint64_t)ret_ref; + return (uintptr_t)ret_ref; } -int64_t __attribute__((export_name("TS_TxOut_clone_ptr"))) TS_TxOut_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_TxOut_clone_ptr"))) TS_TxOut_clone_ptr(uint32_t arg) { LDKTxOut* arg_conv = (LDKTxOut*)(arg & ~1); - int64_t ret_val = TxOut_clone_ptr(arg_conv); + intptr_t ret_val = TxOut_clone_ptr(arg_conv); return ret_val; } @@ -8971,7 +8984,7 @@ uint32_t __attribute__((export_name("TS_TxOut_clone"))) TS_TxOut_clone(uint32_t LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); *ret_ref = TxOut_clone(orig_conv); - return (uint64_t)ret_ref; + return (uintptr_t)ret_ref; } void __attribute__((export_name("TS_Str_free"))) TS_Str_free(jstring _res) { @@ -8987,7 +9000,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_ok")) o_conv = ChannelConfig_clone(&o_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_err"))) TS_CResult_ChannelConfigDecodeErrorZ_err(uint32_t e) { @@ -8998,7 +9011,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_is_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_is_ok(uint32_t o) { @@ -9009,7 +9022,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_free"))) TS_CResult_ChannelConfigDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9019,11 +9032,11 @@ void __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_free"))) static inline uintptr_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9031,7 +9044,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_CResult_OutPointDecodeErrorZ_ok(uint32_t o) { @@ -9042,7 +9055,7 @@ uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_ o_conv = OutPoint_clone(&o_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS_CResult_OutPointDecodeErrorZ_err(uint32_t e) { @@ -9053,7 +9066,7 @@ uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS e_conv = DecodeError_clone(&e_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_is_ok"))) TS_CResult_OutPointDecodeErrorZ_is_ok(uint32_t o) { @@ -9064,7 +9077,7 @@ jboolean __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_free"))) TS_CResult_OutPointDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9074,11 +9087,11 @@ void __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_free"))) TS_CR static inline uintptr_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone_ptr"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone_ptr"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9086,23 +9099,23 @@ uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone"))) LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_ok"))) TS_CResult_SecretKeyErrorZ_ok(int8_tArray o) { LDKSecretKey o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.bytes, o->elems, 32); + memcpy(o_ref.bytes, o->elems, 32); FREE(o); LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_err"))) TS_CResult_SecretKeyErrorZ_err(uint32_t e) { LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); *ret_conv = CResult_SecretKeyErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_SecretKeyErrorZ_is_ok"))) TS_CResult_SecretKeyErrorZ_is_ok(uint32_t o) { @@ -9113,7 +9126,7 @@ jboolean __attribute__((export_name("TS_CResult_SecretKeyErrorZ_is_ok"))) TS_CR void __attribute__((export_name("TS_CResult_SecretKeyErrorZ_free"))) TS_CResult_SecretKeyErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9123,17 +9136,17 @@ void __attribute__((export_name("TS_CResult_SecretKeyErrorZ_free"))) TS_CResult uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_ok"))) TS_CResult_PublicKeyErrorZ_ok(int8_tArray o) { LDKPublicKey o_ref; CHECK(o->arr_len == 33); - memcpy(o_ref.compressed_form, o->elems, 33); + memcpy(o_ref.compressed_form, o->elems, 33); FREE(o); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_err"))) TS_CResult_PublicKeyErrorZ_err(uint32_t e) { LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = CResult_PublicKeyErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PublicKeyErrorZ_is_ok"))) TS_CResult_PublicKeyErrorZ_is_ok(uint32_t o) { @@ -9144,7 +9157,7 @@ jboolean __attribute__((export_name("TS_CResult_PublicKeyErrorZ_is_ok"))) TS_CR void __attribute__((export_name("TS_CResult_PublicKeyErrorZ_free"))) TS_CResult_PublicKeyErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9154,11 +9167,11 @@ void __attribute__((export_name("TS_CResult_PublicKeyErrorZ_free"))) TS_CResult static inline uintptr_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) { LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = CResult_PublicKeyErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone_ptr"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone_ptr"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9166,7 +9179,7 @@ uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone"))) TS_CR LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)(orig & ~1); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_ok(uint32_t o) { @@ -9177,7 +9190,7 @@ uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok") o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint32_t e) { @@ -9188,7 +9201,7 @@ uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint32_t o) { @@ -9199,7 +9212,7 @@ jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9209,11 +9222,11 @@ void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) static inline uintptr_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9221,7 +9234,7 @@ uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clon LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_ok(uint32_t o) { @@ -9232,7 +9245,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_o o_conv = ChannelPublicKeys_clone(&o_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint32_t e) { @@ -9243,7 +9256,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_e e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(uint32_t o) { @@ -9254,7 +9267,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_i void __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_free"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9264,11 +9277,11 @@ void __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_free" static inline uintptr_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9276,7 +9289,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_c LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_ok"))) TS_CResult_TxCreationKeysErrorZ_ok(uint32_t o) { @@ -9287,14 +9300,14 @@ uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_ok"))) TS_ o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_err"))) TS_CResult_TxCreationKeysErrorZ_err(uint32_t e) { LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_is_ok"))) TS_CResult_TxCreationKeysErrorZ_is_ok(uint32_t o) { @@ -9305,7 +9318,7 @@ jboolean __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_free"))) TS_CResult_TxCreationKeysErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9315,11 +9328,11 @@ void __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_free"))) TS_CR static inline uintptr_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) { LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint32_t arg) { LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); - int64_t ret_val = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9327,26 +9340,26 @@ uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone"))) LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_u32Z_some"))) TS_COption_u32Z_some(int32_t o) { LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = COption_u32Z_some(o); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_u32Z_none"))) TS_COption_u32Z_none() { LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = COption_u32Z_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_u32Z_free"))) TS_COption_u32Z_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr); FREE((void*)_res); @@ -9356,12 +9369,12 @@ void __attribute__((export_name("TS_COption_u32Z_free"))) TS_COption_u32Z_free( static inline uintptr_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) { LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = COption_u32Z_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_u32Z_clone_ptr"))) TS_COption_u32Z_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_u32Z_clone_ptr"))) TS_COption_u32Z_clone_ptr(uint32_t arg) { LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)arg; - int64_t ret_val = COption_u32Z_clone_ptr(arg_conv); + intptr_t ret_val = COption_u32Z_clone_ptr(arg_conv); return ret_val; } @@ -9369,7 +9382,7 @@ uint32_t __attribute__((export_name("TS_COption_u32Z_clone"))) TS_COption_u32Z_ LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)orig; LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = COption_u32Z_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -9381,7 +9394,7 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErr o_conv = HTLCOutputInCommitment_clone(&o_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(uint32_t e) { @@ -9392,7 +9405,7 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErr e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(uint32_t o) { @@ -9403,7 +9416,7 @@ jboolean __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErr void __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9413,11 +9426,11 @@ void __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ static inline uintptr_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9425,7 +9438,7 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErr LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_NoneZ_some"))) TS_COption_NoneZ_some() { @@ -9451,7 +9464,7 @@ uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionP o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(uint32_t e) { @@ -9462,7 +9475,7 @@ uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionP e_conv = DecodeError_clone(&e_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(uint32_t o) { @@ -9473,7 +9486,7 @@ jboolean __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionP void __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9483,11 +9496,11 @@ void __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParam static inline uintptr_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9495,7 +9508,7 @@ uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionP LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok(uint32_t o) { @@ -9506,7 +9519,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDec o_conv = ChannelTransactionParameters_clone(&o_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_err(uint32_t e) { @@ -9517,7 +9530,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDec e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(uint32_t o) { @@ -9528,7 +9541,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelTransactionParametersDec void __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9538,11 +9551,11 @@ void __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeE static inline uintptr_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9550,7 +9563,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDec LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_SignatureZ_free"))) TS_CVec_SignatureZ_free(ptrArray _res) { @@ -9560,12 +9573,12 @@ void __attribute__((export_name("TS_CVec_SignatureZ_free"))) TS_CVec_SignatureZ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; + int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { int8_tArray _res_conv_12 = _res_vals[m]; LDKSignature _res_conv_12_ref; CHECK(_res_conv_12->arr_len == 64); - memcpy(_res_conv_12_ref.compact_form, _res_conv_12->elems, 64); + memcpy(_res_conv_12_ref.compact_form, _res_conv_12->elems, 64); FREE(_res_conv_12); _res_constr.data[m] = _res_conv_12_ref; } CVec_SignatureZ_free(_res_constr); @@ -9579,7 +9592,7 @@ uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDeco o_conv = HolderCommitmentTransaction_clone(&o_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err(uint32_t e) { @@ -9590,7 +9603,7 @@ uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDeco e_conv = DecodeError_clone(&e_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { @@ -9601,7 +9614,7 @@ jboolean __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDeco void __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9611,11 +9624,11 @@ void __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeEr static inline uintptr_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9623,7 +9636,7 @@ uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDeco LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(uint32_t o) { @@ -9634,7 +9647,7 @@ uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecod o_conv = BuiltCommitmentTransaction_clone(&o_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err(uint32_t e) { @@ -9645,7 +9658,7 @@ uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecod e_conv = DecodeError_clone(&e_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { @@ -9656,7 +9669,7 @@ jboolean __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecod void __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9666,11 +9679,11 @@ void __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErr static inline uintptr_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9678,7 +9691,7 @@ uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecod LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_ok(uint32_t o) { @@ -9689,13 +9702,13 @@ uint32_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ // Warning: we need a move here but no clone is available for LDKTrustedClosingTransaction LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_err"))) TS_CResult_TrustedClosingTransactionNoneZ_err() { LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = CResult_TrustedClosingTransactionNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_is_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_is_ok(uint32_t o) { @@ -9706,7 +9719,7 @@ jboolean __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_free"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr); FREE((void*)_res); @@ -9721,7 +9734,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErro o_conv = CommitmentTransaction_clone(&o_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_err(uint32_t e) { @@ -9732,7 +9745,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErro e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { @@ -9743,7 +9756,7 @@ jboolean __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErro void __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_free"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9753,11 +9766,11 @@ void __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_f static inline uintptr_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9765,7 +9778,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErro LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_ok(uint32_t o) { @@ -9776,13 +9789,13 @@ uint32_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNon // Warning: we need a move here but no clone is available for LDKTrustedCommitmentTransaction LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_err() { LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok(uint32_t o) { @@ -9793,7 +9806,7 @@ jboolean __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNon void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_free"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr); FREE((void*)_res); @@ -9807,23 +9820,23 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_ok"))) TS_ o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else o_constr.data = NULL; - int8_tArray* o_vals = (void*) o->elems; + int8_tArray* o_vals = (void*) o->elems /* XXX o leaks */; for (size_t m = 0; m < o_constr.datalen; m++) { int8_tArray o_conv_12 = o_vals[m]; LDKSignature o_conv_12_ref; CHECK(o_conv_12->arr_len == 64); - memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); + memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); FREE(o_conv_12); o_constr.data[m] = o_conv_12_ref; } LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_err"))) TS_CResult_CVec_SignatureZNoneZ_err() { LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = CResult_CVec_SignatureZNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_is_ok"))) TS_CResult_CVec_SignatureZNoneZ_is_ok(uint32_t o) { @@ -9834,7 +9847,7 @@ jboolean __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_is_ok"))) void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_free"))) TS_CResult_CVec_SignatureZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr); FREE((void*)_res); @@ -9844,11 +9857,11 @@ void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_free"))) TS_CR static inline uintptr_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) { LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone_ptr"))) TS_CResult_CVec_SignatureZNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone_ptr"))) TS_CResult_CVec_SignatureZNoneZ_clone_ptr(uint32_t arg) { LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); - int64_t ret_val = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -9856,7 +9869,7 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone"))) LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)(orig & ~1); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = CResult_CVec_SignatureZNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_ok(uint32_t o) { @@ -9867,7 +9880,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok") o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_err(uint32_t e) { @@ -9878,7 +9891,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_is_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_is_ok(uint32_t o) { @@ -9889,7 +9902,7 @@ jboolean __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_free"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9899,11 +9912,11 @@ void __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_free"))) static inline uintptr_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9911,7 +9924,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clon LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(uint32_t o) { @@ -9922,7 +9935,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownSc o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err(uint32_t e) { @@ -9933,7 +9946,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownSc e_conv = InvalidShutdownScript_clone(&e_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(uint32_t o) { @@ -9944,7 +9957,7 @@ jboolean __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownSc void __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr); FREE((void*)_res); @@ -9954,11 +9967,11 @@ void __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScript static inline uintptr_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint32_t arg) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); - int64_t ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); return ret_val; } @@ -9966,29 +9979,29 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownSc LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(orig & ~1); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_TypeZ_some"))) TS_COption_TypeZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKType o_conv = *(LDKType*)(o_ptr); LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); *ret_copy = COption_TypeZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_TypeZ_none"))) TS_COption_TypeZ_none() { LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); *ret_copy = COption_TypeZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_TypeZ_free"))) TS_COption_TypeZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr); FREE((void*)_res); @@ -9998,12 +10011,12 @@ void __attribute__((export_name("TS_COption_TypeZ_free"))) TS_COption_TypeZ_fre static inline uintptr_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) { LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); *ret_copy = COption_TypeZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_TypeZ_clone_ptr"))) TS_COption_TypeZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_TypeZ_clone_ptr"))) TS_COption_TypeZ_clone_ptr(uint32_t arg) { LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg; - int64_t ret_val = COption_TypeZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_TypeZ_clone_ptr(arg_conv); return ret_val; } @@ -10011,18 +10024,18 @@ uint32_t __attribute__((export_name("TS_COption_TypeZ_clone"))) TS_COption_Type LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig; LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); *ret_copy = COption_TypeZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr); - o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uint64_t)o) & ~1)); + o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uintptr_t)o) & ~1)); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_err"))) TS_CResult_COption_TypeZDecodeErrorZ_err(uint32_t e) { @@ -10033,7 +10046,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_is_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_is_ok(uint32_t o) { @@ -10044,7 +10057,7 @@ jboolean __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_free"))) TS_CResult_COption_TypeZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10054,11 +10067,11 @@ void __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_free"))) static inline uintptr_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10066,21 +10079,21 @@ uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_ok"))) TS_CResult_StringErrorZ_ok(jstring o) { LDKStr o_conv = str_ref_to_owned_c(o); LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); *ret_conv = CResult_StringErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_err"))) TS_CResult_StringErrorZ_err(uint32_t e) { LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); *ret_conv = CResult_StringErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_StringErrorZ_is_ok"))) TS_CResult_StringErrorZ_is_ok(uint32_t o) { @@ -10091,7 +10104,7 @@ jboolean __attribute__((export_name("TS_CResult_StringErrorZ_is_ok"))) TS_CResu void __attribute__((export_name("TS_CResult_StringErrorZ_free"))) TS_CResult_StringErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10106,7 +10119,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeError o_conv = ChannelMonitorUpdate_clone(&o_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err(uint32_t e) { @@ -10117,7 +10130,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeError e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(uint32_t o) { @@ -10128,7 +10141,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeError void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10138,11 +10151,11 @@ void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_fr static inline uintptr_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10150,30 +10163,30 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeError LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_MonitorEventZ_some"))) TS_COption_MonitorEventZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr); - o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)o) & ~1)); + o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uintptr_t)o) & ~1)); LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); *ret_copy = COption_MonitorEventZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_MonitorEventZ_none"))) TS_COption_MonitorEventZ_none() { LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); *ret_copy = COption_MonitorEventZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_MonitorEventZ_free"))) TS_COption_MonitorEventZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr); FREE((void*)_res); @@ -10183,12 +10196,12 @@ void __attribute__((export_name("TS_COption_MonitorEventZ_free"))) TS_COption_M static inline uintptr_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) { LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); *ret_copy = COption_MonitorEventZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone_ptr"))) TS_COption_MonitorEventZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_MonitorEventZ_clone_ptr"))) TS_COption_MonitorEventZ_clone_ptr(uint32_t arg) { LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg; - int64_t ret_val = COption_MonitorEventZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_MonitorEventZ_clone_ptr(arg_conv); return ret_val; } @@ -10196,18 +10209,18 @@ uint32_t __attribute__((export_name("TS_COption_MonitorEventZ_clone"))) TS_COpt LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig; LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); *ret_copy = COption_MonitorEventZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr); - o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uint64_t)o) & ~1)); + o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uintptr_t)o) & ~1)); LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint32_t e) { @@ -10218,7 +10231,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErro e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok(uint32_t o) { @@ -10229,7 +10242,7 @@ jboolean __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErro void __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_free"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10239,11 +10252,11 @@ void __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_f static inline uintptr_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10251,7 +10264,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErro LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_ok(uint32_t o) { @@ -10262,7 +10275,7 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) T o_conv = HTLCUpdate_clone(&o_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_err(uint32_t e) { @@ -10273,7 +10286,7 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_is_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_is_ok(uint32_t o) { @@ -10284,7 +10297,7 @@ jboolean __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_is_ok")) void __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_free"))) TS_CResult_HTLCUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10294,11 +10307,11 @@ void __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_free"))) TS_ static inline uintptr_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10306,19 +10319,19 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone")) LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneNoneZ_ok"))) TS_CResult_NoneNoneZ_ok() { LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = CResult_NoneNoneZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneNoneZ_err"))) TS_CResult_NoneNoneZ_err() { LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = CResult_NoneNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NoneNoneZ_is_ok"))) TS_CResult_NoneNoneZ_is_ok(uint32_t o) { @@ -10329,7 +10342,7 @@ jboolean __attribute__((export_name("TS_CResult_NoneNoneZ_is_ok"))) TS_CResult_ void __attribute__((export_name("TS_CResult_NoneNoneZ_free"))) TS_CResult_NoneNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr); FREE((void*)_res); @@ -10339,11 +10352,11 @@ void __attribute__((export_name("TS_CResult_NoneNoneZ_free"))) TS_CResult_NoneN static inline uintptr_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = CResult_NoneNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone_ptr"))) TS_CResult_NoneNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone_ptr"))) TS_CResult_NoneNoneZ_clone_ptr(uint32_t arg) { LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)(arg & ~1); - int64_t ret_val = CResult_NoneNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NoneNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -10351,7 +10364,7 @@ uint32_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone"))) TS_CResult_ LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)(orig & ~1); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = CResult_NoneNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_new"))) TS_C2Tuple_OutPointScriptZ_new(uint32_t a, int8_tArray b) { @@ -10363,15 +10376,15 @@ uint32_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_new"))) TS_C2Tu LDKCVec_u8Z b_ref; b_ref.datalen = b->arr_len; b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(b_ref.data, b->elems, b_ref.datalen); + memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_free"))) TS_C2Tuple_OutPointScriptZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr); FREE((void*)_res); @@ -10382,15 +10395,15 @@ uint32_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_new"))) TS_C2Tuple_u LDKCVec_u8Z b_ref; b_ref.datalen = b->arr_len; b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(b_ref.data, b->elems, b_ref.datalen); + memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b); LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_u32ScriptZ_free"))) TS_C2Tuple_u32ScriptZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr); FREE((void*)_res); @@ -10404,10 +10417,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_u32ScriptZZ_free"))) TS_CVec_C _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t v = 0; v < _res_constr.datalen; v++) { uint32_t _res_conv_21 = _res_vals[v]; - void* _res_conv_21_ptr = (void*)(((uint64_t)_res_conv_21) & ~1); + void* _res_conv_21_ptr = (void*)(((uintptr_t)_res_conv_21) & ~1); CHECK_ACCESS(_res_conv_21_ptr); LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr); FREE((void*)_res_conv_21); @@ -10419,17 +10432,17 @@ void __attribute__((export_name("TS_CVec_C2Tuple_u32ScriptZZ_free"))) TS_CVec_C uint32_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(int8_tArray a, uint32_tArray b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKCVec_C2Tuple_u32ScriptZZ b_constr; b_constr.datalen = b->arr_len; if (b_constr.datalen > 0) b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); else b_constr.data = NULL; - uint32_t* b_vals = b->elems; + uint32_t* b_vals = b->elems /* XXX b leaks */; for (size_t v = 0; v < b_constr.datalen; v++) { uint32_t b_conv_21 = b_vals[v]; - void* b_conv_21_ptr = (void*)(((uint64_t)b_conv_21) & ~1); + void* b_conv_21_ptr = (void*)(((uintptr_t)b_conv_21) & ~1); CHECK_ACCESS(b_conv_21_ptr); LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr); // Warning: we may need a move here but no clone is available for LDKC2Tuple_u32ScriptZ @@ -10437,12 +10450,12 @@ uint32_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_n } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr); FREE((void*)_res); @@ -10456,10 +10469,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t o = 0; o < _res_constr.datalen; o++) { uint32_t _res_conv_40 = _res_vals[o]; - void* _res_conv_40_ptr = (void*)(((uint64_t)_res_conv_40) & ~1); + void* _res_conv_40_ptr = (void*)(((uintptr_t)_res_conv_40) & ~1); CHECK_ACCESS(_res_conv_40_ptr); LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr); FREE((void*)_res_conv_40); @@ -10475,10 +10488,10 @@ void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_Monitor _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t o = 0; o < _res_constr.datalen; o++) { uint32_t _res_conv_14 = _res_vals[o]; - void* _res_conv_14_ptr = (void*)(((uint64_t)_res_conv_14) & ~1); + void* _res_conv_14_ptr = (void*)(((uintptr_t)_res_conv_14) & ~1); CHECK_ACCESS(_res_conv_14_ptr); LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr); FREE((void*)_res_conv_14); @@ -10494,10 +10507,10 @@ void __attribute__((export_name("TS_CVec_EventZ_free"))) TS_CVec_EventZ_free(ui _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t h = 0; h < _res_constr.datalen; h++) { uint32_t _res_conv_7 = _res_vals[h]; - void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1); + void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); CHECK_ACCESS(_res_conv_7_ptr); LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr); FREE((void*)_res_conv_7); @@ -10513,13 +10526,13 @@ void __attribute__((export_name("TS_CVec_TransactionZ_free"))) TS_CVec_Transact _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements"); else _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; + int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { int8_tArray _res_conv_12 = _res_vals[m]; LDKTransaction _res_conv_12_ref; _res_conv_12_ref.datalen = _res_conv_12->arr_len; _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKTransaction Bytes"); - memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); + memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12); _res_conv_12_ref.data_is_owned = true; _res_constr.data[m] = _res_conv_12_ref; } @@ -10529,11 +10542,11 @@ void __attribute__((export_name("TS_CVec_TransactionZ_free"))) TS_CVec_Transact static inline uintptr_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone_ptr"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone_ptr"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint32_t arg) { LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1); - int64_t ret_val = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); return ret_val; } @@ -10541,23 +10554,23 @@ uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone"))) TS_ LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1); LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_new"))) TS_C2Tuple_usizeTransactionZ_new(int64_t a, int8_tArray b) { +uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_new"))) TS_C2Tuple_usizeTransactionZ_new(intptr_t a, int8_tArray b) { LDKTransaction b_ref; b_ref.datalen = b->arr_len; b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); - memcpy(b_ref.data, b->elems, b_ref.datalen); + memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b); b_ref.data_is_owned = true; LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_free"))) TS_C2Tuple_usizeTransactionZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr); FREE((void*)_res); @@ -10571,10 +10584,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_usizeTransactionZZ_free"))) TS _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t c = 0; c < _res_constr.datalen; c++) { uint32_t _res_conv_28 = _res_vals[c]; - void* _res_conv_28_ptr = (void*)(((uint64_t)_res_conv_28) & ~1); + void* _res_conv_28_ptr = (void*)(((uintptr_t)_res_conv_28) & ~1); CHECK_ACCESS(_res_conv_28_ptr); LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr); FREE((void*)_res_conv_28); @@ -10586,11 +10599,11 @@ void __attribute__((export_name("TS_CVec_C2Tuple_usizeTransactionZZ_free"))) TS static inline uintptr_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); *ret_conv = C2Tuple_u32TxOutZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone_ptr"))) TS_C2Tuple_u32TxOutZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone_ptr"))) TS_C2Tuple_u32TxOutZ_clone_ptr(uint32_t arg) { LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1); - int64_t ret_val = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); return ret_val; } @@ -10598,22 +10611,22 @@ uint32_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone"))) TS_C2Tuple_ LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1); LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_new"))) TS_C2Tuple_u32TxOutZ_new(int32_t a, uint32_t b) { - void* b_ptr = (void*)(((uint64_t)b) & ~1); + void* b_ptr = (void*)(((uintptr_t)b) & ~1); CHECK_ACCESS(b_ptr); LDKTxOut b_conv = *(LDKTxOut*)(b_ptr); - b_conv = TxOut_clone((LDKTxOut*)(((uint64_t)b) & ~1)); + b_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)b) & ~1)); LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_u32TxOutZ_free"))) TS_C2Tuple_u32TxOutZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr); FREE((void*)_res); @@ -10627,10 +10640,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_u32TxOutZZ_free"))) TS_CVec_C2 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t u = 0; u < _res_constr.datalen; u++) { uint32_t _res_conv_20 = _res_vals[u]; - void* _res_conv_20_ptr = (void*)(((uint64_t)_res_conv_20) & ~1); + void* _res_conv_20_ptr = (void*)(((uintptr_t)_res_conv_20) & ~1); CHECK_ACCESS(_res_conv_20_ptr); LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr); FREE((void*)_res_conv_20); @@ -10642,11 +10655,11 @@ void __attribute__((export_name("TS_CVec_C2Tuple_u32TxOutZZ_free"))) TS_CVec_C2 static inline uintptr_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(uint32_t arg) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1); - int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); return ret_val; } @@ -10654,36 +10667,36 @@ uint32_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_cl LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(int8_tArray a, uint32_tArray b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKCVec_C2Tuple_u32TxOutZZ b_constr; b_constr.datalen = b->arr_len; if (b_constr.datalen > 0) b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements"); else b_constr.data = NULL; - uint32_t* b_vals = b->elems; + uint32_t* b_vals = b->elems /* XXX b leaks */; for (size_t u = 0; u < b_constr.datalen; u++) { uint32_t b_conv_20 = b_vals[u]; - void* b_conv_20_ptr = (void*)(((uint64_t)b_conv_20) & ~1); + void* b_conv_20_ptr = (void*)(((uintptr_t)b_conv_20) & ~1); CHECK_ACCESS(b_conv_20_ptr); LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr); - b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1)); + b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uintptr_t)b_conv_20) & ~1)); b_constr.data[u] = b_conv_20_conv; } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr); FREE((void*)_res); @@ -10697,10 +10710,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t n = 0; n < _res_constr.datalen; n++) { uint32_t _res_conv_39 = _res_vals[n]; - void* _res_conv_39_ptr = (void*)(((uint64_t)_res_conv_39) & ~1); + void* _res_conv_39_ptr = (void*)(((uintptr_t)_res_conv_39) & ~1); CHECK_ACCESS(_res_conv_39_ptr); LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr); FREE((void*)_res_conv_39); @@ -10716,12 +10729,12 @@ void __attribute__((export_name("TS_CVec_TxidZ_free"))) TS_CVec_TxidZ_free(ptrA _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements"); else _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; + int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { int8_tArray _res_conv_12 = _res_vals[m]; LDKThirtyTwoBytes _res_conv_12_ref; CHECK(_res_conv_12->arr_len == 32); - memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); + memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12); _res_constr.data[m] = _res_conv_12_ref; } CVec_TxidZ_free(_res_constr); @@ -10734,10 +10747,10 @@ void __attribute__((export_name("TS_CVec_BalanceZ_free"))) TS_CVec_BalanceZ_fre _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t j = 0; j < _res_constr.datalen; j++) { uint32_t _res_conv_9 = _res_vals[j]; - void* _res_conv_9_ptr = (void*)(((uint64_t)_res_conv_9) & ~1); + void* _res_conv_9_ptr = (void*)(((uintptr_t)_res_conv_9) & ~1); CHECK_ACCESS(_res_conv_9_ptr); LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr); FREE((void*)_res_conv_9); @@ -10749,11 +10762,11 @@ void __attribute__((export_name("TS_CVec_BalanceZ_free"))) TS_CVec_BalanceZ_fre static inline uintptr_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) { LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr(uint32_t arg) { LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1); - int64_t ret_val = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); return ret_val; } @@ -10761,13 +10774,13 @@ uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone" LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_new"))) TS_C2Tuple_BlockHashChannelMonitorZ_new(int8_tArray a, uint32_t b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKChannelMonitor b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); @@ -10775,12 +10788,12 @@ uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_new")) b_conv = ChannelMonitor_clone(&b_conv); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_free"))) TS_C2Tuple_BlockHashChannelMonitorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr); FREE((void*)_res); @@ -10788,13 +10801,13 @@ void __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_free"))) T } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr); - o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uintptr_t)o) & ~1)); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(uint32_t e) { @@ -10805,7 +10818,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitor e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(uint32_t o) { @@ -10816,7 +10829,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitor void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10826,11 +10839,11 @@ void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDec static inline uintptr_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10838,7 +10851,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitor LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_CResult_RouteHopDecodeErrorZ_ok(uint32_t o) { @@ -10849,7 +10862,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_ o_conv = RouteHop_clone(&o_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS_CResult_RouteHopDecodeErrorZ_err(uint32_t e) { @@ -10860,7 +10873,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHopDecodeErrorZ_is_ok(uint32_t o) { @@ -10871,7 +10884,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_free"))) TS_CResult_RouteHopDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10881,11 +10894,11 @@ void __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_free"))) TS_CR static inline uintptr_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10893,7 +10906,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone"))) LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_RouteHopZ_free"))) TS_CVec_RouteHopZ_free(uint32_tArray _res) { @@ -10903,7 +10916,7 @@ void __attribute__((export_name("TS_CVec_RouteHopZ_free"))) TS_CVec_RouteHopZ_f _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t k = 0; k < _res_constr.datalen; k++) { uint32_t _res_conv_10 = _res_vals[k]; LDKRouteHop _res_conv_10_conv; @@ -10922,7 +10935,7 @@ void __attribute__((export_name("TS_CVec_CVec_RouteHopZZ_free"))) TS_CVec_CVec_ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements"); else _res_constr.data = NULL; - uint32_tArray* _res_vals = (void*) _res->elems; + uint32_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { uint32_tArray _res_conv_12 = _res_vals[m]; LDKCVec_RouteHopZ _res_conv_12_constr; @@ -10931,7 +10944,7 @@ void __attribute__((export_name("TS_CVec_CVec_RouteHopZZ_free"))) TS_CVec_CVec_ _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else _res_conv_12_constr.data = NULL; - uint32_t* _res_conv_12_vals = _res_conv_12->elems; + uint32_t* _res_conv_12_vals = _res_conv_12->elems /* XXX _res_conv_12 leaks */; for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) { uint32_t _res_conv_12_conv_10 = _res_conv_12_vals[k]; LDKRouteHop _res_conv_12_conv_10_conv; @@ -10953,7 +10966,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_ok"))) TS_CRe o_conv = Route_clone(&o_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_err"))) TS_CResult_RouteDecodeErrorZ_err(uint32_t e) { @@ -10964,7 +10977,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_err"))) TS_CR e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_is_ok"))) TS_CResult_RouteDecodeErrorZ_is_ok(uint32_t o) { @@ -10975,7 +10988,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_is_ok"))) TS_ void __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_free"))) TS_CResult_RouteDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10985,11 +10998,11 @@ void __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_free"))) TS_CResu static inline uintptr_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone_ptr"))) TS_CResult_RouteDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone_ptr"))) TS_CResult_RouteDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10997,7 +11010,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone"))) TS_ LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)(orig & ~1); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_ok"))) TS_CResult_RouteParametersDecodeErrorZ_ok(uint32_t o) { @@ -11008,7 +11021,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_ok" o_conv = RouteParameters_clone(&o_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_err"))) TS_CResult_RouteParametersDecodeErrorZ_err(uint32_t e) { @@ -11019,7 +11032,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_err e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_is_ok"))) TS_CResult_RouteParametersDecodeErrorZ_is_ok(uint32_t o) { @@ -11030,7 +11043,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_is_ void __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_free"))) TS_CResult_RouteParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11040,11 +11053,11 @@ void __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_free")) static inline uintptr_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone_ptr"))) TS_CResult_RouteParametersDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone_ptr"))) TS_CResult_RouteParametersDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11052,7 +11065,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clo LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ_free(uint32_tArray _res) { @@ -11062,7 +11075,7 @@ void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t l = 0; l < _res_constr.datalen; l++) { uint32_t _res_conv_11 = _res_vals[l]; LDKRouteHint _res_conv_11_conv; @@ -11077,20 +11090,20 @@ void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ uint32_t __attribute__((export_name("TS_COption_u64Z_some"))) TS_COption_u64Z_some(int64_t o) { LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = COption_u64Z_some(o); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_u64Z_none"))) TS_COption_u64Z_none() { LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = COption_u64Z_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_u64Z_free"))) TS_COption_u64Z_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr); FREE((void*)_res); @@ -11100,12 +11113,12 @@ void __attribute__((export_name("TS_COption_u64Z_free"))) TS_COption_u64Z_free( static inline uintptr_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) { LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = COption_u64Z_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_u64Z_clone_ptr"))) TS_COption_u64Z_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_u64Z_clone_ptr"))) TS_COption_u64Z_clone_ptr(uint32_t arg) { LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)arg; - int64_t ret_val = COption_u64Z_clone_ptr(arg_conv); + intptr_t ret_val = COption_u64Z_clone_ptr(arg_conv); return ret_val; } @@ -11113,7 +11126,7 @@ uint32_t __attribute__((export_name("TS_COption_u64Z_clone"))) TS_COption_u64Z_ LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig; LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = COption_u64Z_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -11125,7 +11138,7 @@ uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_ok"))) TS_CRe o_conv = Payee_clone(&o_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_err"))) TS_CResult_PayeeDecodeErrorZ_err(uint32_t e) { @@ -11136,7 +11149,7 @@ uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_err"))) TS_CR e_conv = DecodeError_clone(&e_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_is_ok"))) TS_CResult_PayeeDecodeErrorZ_is_ok(uint32_t o) { @@ -11147,7 +11160,7 @@ jboolean __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_is_ok"))) TS_ void __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_free"))) TS_CResult_PayeeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PayeeDecodeErrorZ _res_conv = *(LDKCResult_PayeeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11157,11 +11170,11 @@ void __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_free"))) TS_CResu static inline uintptr_t CResult_PayeeDecodeErrorZ_clone_ptr(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_clone_ptr"))) TS_CResult_PayeeDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_clone_ptr"))) TS_CResult_PayeeDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PayeeDecodeErrorZ* arg_conv = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PayeeDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PayeeDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11169,7 +11182,7 @@ uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_clone"))) TS_ LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_RouteHintHopZ_free"))) TS_CVec_RouteHintHopZ_free(uint32_tArray _res) { @@ -11179,7 +11192,7 @@ void __attribute__((export_name("TS_CVec_RouteHintHopZ_free"))) TS_CVec_RouteHi _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t o = 0; o < _res_constr.datalen; o++) { uint32_t _res_conv_14 = _res_vals[o]; LDKRouteHintHop _res_conv_14_conv; @@ -11199,7 +11212,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_ok"))) TS o_conv = RouteHint_clone(&o_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_err"))) TS_CResult_RouteHintDecodeErrorZ_err(uint32_t e) { @@ -11210,7 +11223,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_err"))) T e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_is_ok"))) TS_CResult_RouteHintDecodeErrorZ_is_ok(uint32_t o) { @@ -11221,7 +11234,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_free"))) TS_CResult_RouteHintDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11231,11 +11244,11 @@ void __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_free"))) TS_C static inline uintptr_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11243,7 +11256,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone"))) LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_ok(uint32_t o) { @@ -11254,7 +11267,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_ok"))) o_conv = RouteHintHop_clone(&o_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_err"))) TS_CResult_RouteHintHopDecodeErrorZ_err(uint32_t e) { @@ -11265,7 +11278,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_is_ok(uint32_t o) { @@ -11276,7 +11289,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_free"))) TS_CResult_RouteHintHopDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11286,11 +11299,11 @@ void __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_free"))) T static inline uintptr_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11298,7 +11311,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone" LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_ChannelDetailsZ_free(uint32_tArray _res) { @@ -11308,7 +11321,7 @@ void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_Chann _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t q = 0; q < _res_constr.datalen; q++) { uint32_t _res_conv_16 = _res_vals[q]; LDKChannelDetails _res_conv_16_conv; @@ -11328,7 +11341,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_ok"))) TS_ o_conv = Route_clone(&o_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_err"))) TS_CResult_RouteLightningErrorZ_err(uint32_t e) { @@ -11339,7 +11352,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_err"))) TS e_conv = LightningError_clone(&e_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteLightningErrorZ_is_ok"))) TS_CResult_RouteLightningErrorZ_is_ok(uint32_t o) { @@ -11350,7 +11363,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteLightningErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_RouteLightningErrorZ_free"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11360,11 +11373,11 @@ void __attribute__((export_name("TS_CResult_RouteLightningErrorZ_free"))) TS_CR static inline uintptr_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) { LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone_ptr"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone_ptr"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11372,13 +11385,13 @@ uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone"))) LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_ok"))) TS_CResult_NoneLightningErrorZ_ok() { LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_err"))) TS_CResult_NoneLightningErrorZ_err(uint32_t e) { @@ -11389,7 +11402,7 @@ uint32_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_err"))) TS_ e_conv = LightningError_clone(&e_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NoneLightningErrorZ_is_ok"))) TS_CResult_NoneLightningErrorZ_is_ok(uint32_t o) { @@ -11400,7 +11413,7 @@ jboolean __attribute__((export_name("TS_CResult_NoneLightningErrorZ_is_ok"))) T void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_free"))) TS_CResult_NoneLightningErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11410,11 +11423,11 @@ void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_free"))) TS_CRe static inline uintptr_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) { LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone_ptr"))) TS_CResult_NoneLightningErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone_ptr"))) TS_CResult_NoneLightningErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11422,17 +11435,17 @@ uint32_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone"))) T LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } static inline uintptr_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) { LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone_ptr"))) TS_C2Tuple_PublicKeyTypeZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone_ptr"))) TS_C2Tuple_PublicKeyTypeZ_clone_ptr(uint32_t arg) { LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1); - int64_t ret_val = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); return ret_val; } @@ -11440,24 +11453,24 @@ uint32_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone"))) TS_C2T LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1); LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_new"))) TS_C2Tuple_PublicKeyTypeZ_new(int8_tArray a, uint32_t b) { LDKPublicKey a_ref; CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); - void* b_ptr = (void*)(((uint64_t)b) & ~1); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + void* b_ptr = (void*)(((uintptr_t)b) & ~1); CHECK_ACCESS(b_ptr); LDKType b_conv = *(LDKType*)(b_ptr); LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_free"))) TS_C2Tuple_PublicKeyTypeZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr); FREE((void*)_res); @@ -11471,10 +11484,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyTypeZZ_free"))) TS_CV _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t z = 0; z < _res_constr.datalen; z++) { uint32_t _res_conv_25 = _res_vals[z]; - void* _res_conv_25_ptr = (void*)(((uint64_t)_res_conv_25) & ~1); + void* _res_conv_25_ptr = (void*)(((uintptr_t)_res_conv_25) & ~1); CHECK_ACCESS(_res_conv_25_ptr); LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr); FREE((void*)_res_conv_25); @@ -11490,10 +11503,10 @@ void __attribute__((export_name("TS_CVec_MessageSendEventZ_free"))) TS_CVec_Mes _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t s = 0; s < _res_constr.datalen; s++) { uint32_t _res_conv_18 = _res_vals[s]; - void* _res_conv_18_ptr = (void*)(((uint64_t)_res_conv_18) & ~1); + void* _res_conv_18_ptr = (void*)(((uintptr_t)_res_conv_18) & ~1); CHECK_ACCESS(_res_conv_18_ptr); LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr); FREE((void*)_res_conv_18); @@ -11505,7 +11518,7 @@ void __attribute__((export_name("TS_CVec_MessageSendEventZ_free"))) TS_CVec_Mes uint32_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_ok"))) TS_CResult_boolLightningErrorZ_ok(jboolean o) { LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_ok(o); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_err"))) TS_CResult_boolLightningErrorZ_err(uint32_t e) { @@ -11516,7 +11529,7 @@ uint32_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_err"))) TS_ e_conv = LightningError_clone(&e_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_is_ok"))) TS_CResult_boolLightningErrorZ_is_ok(uint32_t o) { @@ -11527,7 +11540,7 @@ jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_is_ok"))) T void __attribute__((export_name("TS_CResult_boolLightningErrorZ_free"))) TS_CResult_boolLightningErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11537,11 +11550,11 @@ void __attribute__((export_name("TS_CResult_boolLightningErrorZ_free"))) TS_CRe static inline uintptr_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) { LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone_ptr"))) TS_CResult_boolLightningErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone_ptr"))) TS_CResult_boolLightningErrorZ_clone_ptr(uint32_t arg) { LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1); - int64_t ret_val = CResult_boolLightningErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_boolLightningErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11549,17 +11562,17 @@ uint32_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone"))) T LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } static inline uintptr_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(uint32_t arg) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1); - int64_t ret_val = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); + intptr_t ret_val = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); return ret_val; } @@ -11567,7 +11580,7 @@ uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdat LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(uint32_t a, uint32_t b, uint32_t c) { @@ -11588,12 +11601,12 @@ uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdat c_conv = ChannelUpdate_clone(&c_conv); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr); FREE((void*)_res); @@ -11607,10 +11620,10 @@ void __attribute__((export_name("TS_CVec_C3Tuple_ChannelAnnouncementChannelUpda _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t h = 0; h < _res_constr.datalen; h++) { uint32_t _res_conv_59 = _res_vals[h]; - void* _res_conv_59_ptr = (void*)(((uint64_t)_res_conv_59) & ~1); + void* _res_conv_59_ptr = (void*)(((uintptr_t)_res_conv_59) & ~1); CHECK_ACCESS(_res_conv_59_ptr); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr); FREE((void*)_res_conv_59); @@ -11626,7 +11639,7 @@ void __attribute__((export_name("TS_CVec_NodeAnnouncementZ_free"))) TS_CVec_Nod _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t s = 0; s < _res_constr.datalen; s++) { uint32_t _res_conv_18 = _res_vals[s]; LDKNodeAnnouncement _res_conv_18_conv; @@ -11645,12 +11658,12 @@ void __attribute__((export_name("TS_CVec_PublicKeyZ_free"))) TS_CVec_PublicKeyZ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); else _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; + int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { int8_tArray _res_conv_12 = _res_vals[m]; LDKPublicKey _res_conv_12_ref; CHECK(_res_conv_12->arr_len == 33); - memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); + memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); FREE(_res_conv_12); _res_constr.data[m] = _res_conv_12_ref; } CVec_PublicKeyZ_free(_res_constr); @@ -11660,7 +11673,7 @@ void __attribute__((export_name("TS_CVec_u8Z_free"))) TS_CVec_u8Z_free(int8_tAr LDKCVec_u8Z _res_ref; _res_ref.datalen = _res->arr_len; _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(_res_ref.data, _res->elems, _res_ref.datalen); + memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res); CVec_u8Z_free(_res_ref); } @@ -11668,10 +11681,10 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_ok"))) LDKCVec_u8Z o_ref; o_ref.datalen = o->arr_len; o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(o_ref.data, o->elems, o_ref.datalen); + memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_err(uint32_t e) { @@ -11682,7 +11695,7 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_err")) e_conv = PeerHandleError_clone(&e_conv); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok(uint32_t o) { @@ -11693,7 +11706,7 @@ jboolean __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok" void __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_free"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11703,11 +11716,11 @@ void __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_free"))) T static inline uintptr_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) { LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint32_t arg) { LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); - int64_t ret_val = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11715,13 +11728,13 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone" LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_ok"))) TS_CResult_NonePeerHandleErrorZ_ok() { LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_err"))) TS_CResult_NonePeerHandleErrorZ_err(uint32_t e) { @@ -11732,7 +11745,7 @@ uint32_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_err"))) TS e_conv = PeerHandleError_clone(&e_conv); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_is_ok"))) TS_CResult_NonePeerHandleErrorZ_is_ok(uint32_t o) { @@ -11743,7 +11756,7 @@ jboolean __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_free"))) TS_CResult_NonePeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11753,11 +11766,11 @@ void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_free"))) TS_CR static inline uintptr_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) { LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone_ptr"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone_ptr"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11765,13 +11778,13 @@ uint32_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone"))) LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_ok"))) TS_CResult_boolPeerHandleErrorZ_ok(jboolean o) { LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_ok(o); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_err"))) TS_CResult_boolPeerHandleErrorZ_err(uint32_t e) { @@ -11782,7 +11795,7 @@ uint32_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_err"))) TS e_conv = PeerHandleError_clone(&e_conv); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_is_ok"))) TS_CResult_boolPeerHandleErrorZ_is_ok(uint32_t o) { @@ -11793,7 +11806,7 @@ jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_free"))) TS_CResult_boolPeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11803,11 +11816,11 @@ void __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_free"))) TS_CR static inline uintptr_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) { LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone_ptr"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone_ptr"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint32_t arg) { LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); - int64_t ret_val = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11815,24 +11828,24 @@ uint32_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone"))) LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_ok"))) TS_CResult_TxOutAccessErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); - o_conv = TxOut_clone((LDKTxOut*)(((uint64_t)o) & ~1)); + o_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)o) & ~1)); LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_err"))) TS_CResult_TxOutAccessErrorZ_err(uint32_t e) { LDKAccessError e_conv = LDKAccessError_from_js(e); LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_is_ok"))) TS_CResult_TxOutAccessErrorZ_is_ok(uint32_t o) { @@ -11843,7 +11856,7 @@ jboolean __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_is_ok"))) TS_ void __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_free"))) TS_CResult_TxOutAccessErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11853,11 +11866,11 @@ void __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_free"))) TS_CResu static inline uintptr_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) { LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); *ret_conv = CResult_TxOutAccessErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone_ptr"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone_ptr"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint32_t arg) { LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); - int64_t ret_val = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11865,20 +11878,20 @@ uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone"))) TS_ LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1); LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_ok() { LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_err(uint32_t e) { LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_js(e); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok(uint32_t o) { @@ -11889,7 +11902,7 @@ jboolean __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_is void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_free"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr); FREE((void*)_res); @@ -11899,11 +11912,11 @@ void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_free") static inline uintptr_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint32_t arg) { LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); - int64_t ret_val = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); return ret_val; } @@ -11911,30 +11924,30 @@ uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_cl LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_some"))) TS_COption_C2Tuple_usizeTransactionZZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr); - o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)o) & ~1)); LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_none"))) TS_COption_C2Tuple_usizeTransactionZZ_none() { LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = COption_C2Tuple_usizeTransactionZZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_free"))) TS_COption_C2Tuple_usizeTransactionZZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr); FREE((void*)_res); @@ -11944,12 +11957,12 @@ void __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_free"))) static inline uintptr_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) { LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr"))) TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr"))) TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr(uint32_t arg) { LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg; - int64_t ret_val = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); return ret_val; } @@ -11957,31 +11970,31 @@ uint32_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clon LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig; LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_ClosureReasonZ_some"))) TS_COption_ClosureReasonZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); - o_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)o) & ~1)); + o_conv = ClosureReason_clone((LDKClosureReason*)(((uintptr_t)o) & ~1)); LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); *ret_copy = COption_ClosureReasonZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_ClosureReasonZ_none"))) TS_COption_ClosureReasonZ_none() { LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); *ret_copy = COption_ClosureReasonZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ClosureReasonZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); FREE((void*)_res); @@ -11991,12 +12004,12 @@ void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ static inline uintptr_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); *ret_copy = COption_ClosureReasonZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone_ptr"))) TS_COption_ClosureReasonZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone_ptr"))) TS_COption_ClosureReasonZ_clone_ptr(uint32_t arg) { LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)arg; - int64_t ret_val = COption_ClosureReasonZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_ClosureReasonZ_clone_ptr(arg_conv); return ret_val; } @@ -12004,18 +12017,18 @@ uint32_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone"))) TS_COp LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)orig; LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); *ret_copy = COption_ClosureReasonZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); - o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)(((uint64_t)o) & ~1)); + o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)(((uintptr_t)o) & ~1)); LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint32_t e) { @@ -12026,7 +12039,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErr e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(uint32_t o) { @@ -12037,7 +12050,7 @@ jboolean __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErr void __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_free"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12047,11 +12060,11 @@ void __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_ static inline uintptr_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12059,30 +12072,30 @@ uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErr LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_NetworkUpdateZ_some"))) TS_COption_NetworkUpdateZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr); - o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)(((uint64_t)o) & ~1)); + o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)(((uintptr_t)o) & ~1)); LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); *ret_copy = COption_NetworkUpdateZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_NetworkUpdateZ_none"))) TS_COption_NetworkUpdateZ_none() { LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); *ret_copy = COption_NetworkUpdateZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_NetworkUpdateZ_free"))) TS_COption_NetworkUpdateZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr); FREE((void*)_res); @@ -12092,12 +12105,12 @@ void __attribute__((export_name("TS_COption_NetworkUpdateZ_free"))) TS_COption_ static inline uintptr_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) { LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); *ret_copy = COption_NetworkUpdateZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone_ptr"))) TS_COption_NetworkUpdateZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone_ptr"))) TS_COption_NetworkUpdateZ_clone_ptr(uint32_t arg) { LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)arg; - int64_t ret_val = COption_NetworkUpdateZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_NetworkUpdateZ_clone_ptr(arg_conv); return ret_val; } @@ -12105,7 +12118,7 @@ uint32_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone"))) TS_COp LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)orig; LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); *ret_copy = COption_NetworkUpdateZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -12116,10 +12129,10 @@ void __attribute__((export_name("TS_CVec_SpendableOutputDescriptorZ_free"))) TS _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t b = 0; b < _res_constr.datalen; b++) { uint32_t _res_conv_27 = _res_vals[b]; - void* _res_conv_27_ptr = (void*)(((uint64_t)_res_conv_27) & ~1); + void* _res_conv_27_ptr = (void*)(((uintptr_t)_res_conv_27) & ~1); CHECK_ACCESS(_res_conv_27_ptr); LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr); FREE((void*)_res_conv_27); @@ -12129,26 +12142,26 @@ void __attribute__((export_name("TS_CVec_SpendableOutputDescriptorZ_free"))) TS } uint32_t __attribute__((export_name("TS_COption_EventZ_some"))) TS_COption_EventZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKEvent o_conv = *(LDKEvent*)(o_ptr); - o_conv = Event_clone((LDKEvent*)(((uint64_t)o) & ~1)); + o_conv = Event_clone((LDKEvent*)(((uintptr_t)o) & ~1)); LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); *ret_copy = COption_EventZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_EventZ_none"))) TS_COption_EventZ_none() { LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); *ret_copy = COption_EventZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); FREE((void*)_res); @@ -12158,12 +12171,12 @@ void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_f static inline uintptr_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); *ret_copy = COption_EventZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_EventZ_clone_ptr"))) TS_COption_EventZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_EventZ_clone_ptr"))) TS_COption_EventZ_clone_ptr(uint32_t arg) { LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)arg; - int64_t ret_val = COption_EventZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_EventZ_clone_ptr(arg_conv); return ret_val; } @@ -12171,18 +12184,18 @@ uint32_t __attribute__((export_name("TS_COption_EventZ_clone"))) TS_COption_Eve LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)orig; LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); *ret_copy = COption_EventZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_ok"))) TS_CResult_COption_EventZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); - o_conv = COption_EventZ_clone((LDKCOption_EventZ*)(((uint64_t)o) & ~1)); + o_conv = COption_EventZ_clone((LDKCOption_EventZ*)(((uintptr_t)o) & ~1)); LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint32_t e) { @@ -12193,7 +12206,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_is_ok"))) TS_CResult_COption_EventZDecodeErrorZ_is_ok(uint32_t o) { @@ -12204,7 +12217,7 @@ jboolean __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_free"))) TS_CResult_COption_EventZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12214,11 +12227,11 @@ void __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_free"))) static inline uintptr_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12226,7 +12239,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clon LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_ok"))) TS_CResult_NodeIdDecodeErrorZ_ok(uint32_t o) { @@ -12237,7 +12250,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_ok"))) TS_CR o_conv = NodeId_clone(&o_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_CResult_NodeIdDecodeErrorZ_err(uint32_t e) { @@ -12248,7 +12261,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_C e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_is_ok"))) TS_CResult_NodeIdDecodeErrorZ_is_ok(uint32_t o) { @@ -12259,7 +12272,7 @@ jboolean __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_is_ok"))) TS void __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_free"))) TS_CResult_NodeIdDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12269,11 +12282,11 @@ void __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_free"))) TS_CRes static inline uintptr_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone_ptr"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone_ptr"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12281,17 +12294,17 @@ uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone"))) TS LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr); - o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)o) & ~1)); + o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uintptr_t)o) & ~1)); LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err(uint32_t e) { @@ -12302,7 +12315,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErr e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(uint32_t o) { @@ -12313,7 +12326,7 @@ jboolean __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErr void __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12323,11 +12336,11 @@ void __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ static inline uintptr_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12335,29 +12348,29 @@ uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErr LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_AccessZ_some"))) TS_COption_AccessZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKAccess o_conv = *(LDKAccess*)(o_ptr); LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); *ret_copy = COption_AccessZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_AccessZ_none"))) TS_COption_AccessZ_none() { LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); *ret_copy = COption_AccessZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_AccessZ_free"))) TS_COption_AccessZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr); FREE((void*)_res); @@ -12372,7 +12385,7 @@ uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErr o_conv = DirectionalChannelInfo_clone(&o_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_err"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_err(uint32_t e) { @@ -12383,7 +12396,7 @@ uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErr e_conv = DecodeError_clone(&e_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_is_ok"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(uint32_t o) { @@ -12394,7 +12407,7 @@ jboolean __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErr void __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_free"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_DirectionalChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12404,11 +12417,11 @@ void __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_ static inline uintptr_t CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12416,7 +12429,7 @@ uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErr LDKCResult_DirectionalChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_ok(uint32_t o) { @@ -12427,7 +12440,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_ok"))) o_conv = ChannelInfo_clone(&o_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_err"))) TS_CResult_ChannelInfoDecodeErrorZ_err(uint32_t e) { @@ -12438,7 +12451,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_err"))) e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_is_ok(uint32_t o) { @@ -12449,7 +12462,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_is_ok") void __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_free"))) TS_CResult_ChannelInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12459,11 +12472,11 @@ void __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_free"))) TS static inline uintptr_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12471,7 +12484,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone") LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_ok(uint32_t o) { @@ -12482,7 +12495,7 @@ uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_ok"))) o_conv = RoutingFees_clone(&o_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_err"))) TS_CResult_RoutingFeesDecodeErrorZ_err(uint32_t e) { @@ -12493,7 +12506,7 @@ uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_err"))) e_conv = DecodeError_clone(&e_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_is_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_is_ok(uint32_t o) { @@ -12504,7 +12517,7 @@ jboolean __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_is_ok") void __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_free"))) TS_CResult_RoutingFeesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12514,11 +12527,11 @@ void __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_free"))) TS static inline uintptr_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr"))) TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr"))) TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12526,7 +12539,7 @@ uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone") LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_NetAddressZ_free"))) TS_CVec_NetAddressZ_free(uint32_tArray _res) { @@ -12536,10 +12549,10 @@ void __attribute__((export_name("TS_CVec_NetAddressZ_free"))) TS_CVec_NetAddres _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { uint32_t _res_conv_12 = _res_vals[m]; - void* _res_conv_12_ptr = (void*)(((uint64_t)_res_conv_12) & ~1); + void* _res_conv_12_ptr = (void*)(((uintptr_t)_res_conv_12) & ~1); CHECK_ACCESS(_res_conv_12_ptr); LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr); FREE((void*)_res_conv_12); @@ -12556,7 +12569,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeError o_conv = NodeAnnouncementInfo_clone(&o_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err(uint32_t e) { @@ -12567,7 +12580,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeError e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(uint32_t o) { @@ -12578,7 +12591,7 @@ jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeError void __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12588,11 +12601,11 @@ void __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_fr static inline uintptr_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12600,7 +12613,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeError LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_u64Z_free"))) TS_CVec_u64Z_free(int64_tArray _res) { @@ -12610,7 +12623,7 @@ void __attribute__((export_name("TS_CVec_u64Z_free"))) TS_CVec_u64Z_free(int64_ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; + int64_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t i = 0; i < _res_constr.datalen; i++) { int64_t _res_conv_8 = _res_vals[i]; _res_constr.data[i] = _res_conv_8; @@ -12626,7 +12639,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_ok"))) TS_ o_conv = NodeInfo_clone(&o_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_err"))) TS_CResult_NodeInfoDecodeErrorZ_err(uint32_t e) { @@ -12637,7 +12650,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_err"))) TS e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeInfoDecodeErrorZ_is_ok(uint32_t o) { @@ -12648,7 +12661,7 @@ jboolean __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_free"))) TS_CResult_NodeInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12658,11 +12671,11 @@ void __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_free"))) TS_CR static inline uintptr_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeInfoDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeInfoDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12670,7 +12683,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone"))) LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_ok(uint32_t o) { @@ -12681,7 +12694,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_ok"))) o_conv = NetworkGraph_clone(&o_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_err"))) TS_CResult_NetworkGraphDecodeErrorZ_err(uint32_t e) { @@ -12692,7 +12705,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_is_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_is_ok(uint32_t o) { @@ -12703,7 +12716,7 @@ jboolean __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_free"))) TS_CResult_NetworkGraphDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12713,11 +12726,11 @@ void __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_free"))) T static inline uintptr_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_clone_ptr"))) TS_CResult_NetworkGraphDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_clone_ptr"))) TS_CResult_NetworkGraphDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NetworkGraphDecodeErrorZ* arg_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12725,7 +12738,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_clone" LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_some"))) TS_COption_CVec_NetAddressZZ_some(uint32_tArray o) { @@ -12735,31 +12748,31 @@ uint32_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_some"))) TS_C o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else o_constr.data = NULL; - uint32_t* o_vals = o->elems; + uint32_t* o_vals = o->elems /* XXX o leaks */; for (size_t m = 0; m < o_constr.datalen; m++) { uint32_t o_conv_12 = o_vals[m]; - void* o_conv_12_ptr = (void*)(((uint64_t)o_conv_12) & ~1); + void* o_conv_12_ptr = (void*)(((uintptr_t)o_conv_12) & ~1); CHECK_ACCESS(o_conv_12_ptr); LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr); - o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o_conv_12) & ~1)); + o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o_conv_12) & ~1)); o_constr.data[m] = o_conv_12_conv; } LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); *ret_copy = COption_CVec_NetAddressZZ_some(o_constr); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_none"))) TS_COption_CVec_NetAddressZZ_none() { LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); *ret_copy = COption_CVec_NetAddressZZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_CVec_NetAddressZZ_free"))) TS_COption_CVec_NetAddressZZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr); FREE((void*)_res); @@ -12769,12 +12782,12 @@ void __attribute__((export_name("TS_COption_CVec_NetAddressZZ_free"))) TS_COpti static inline uintptr_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) { LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); *ret_copy = COption_CVec_NetAddressZZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone_ptr"))) TS_COption_CVec_NetAddressZZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone_ptr"))) TS_COption_CVec_NetAddressZZ_clone_ptr(uint32_t arg) { LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg; - int64_t ret_val = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); return ret_val; } @@ -12782,7 +12795,7 @@ uint32_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone"))) TS_ LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig; LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -12794,7 +12807,7 @@ uint32_t __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_o // Warning: we need a move here but no clone is available for LDKScoringParameters LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_err"))) TS_CResult_ScoringParametersDecodeErrorZ_err(uint32_t e) { @@ -12805,7 +12818,7 @@ uint32_t __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_e e_conv = DecodeError_clone(&e_conv); LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_is_ok"))) TS_CResult_ScoringParametersDecodeErrorZ_is_ok(uint32_t o) { @@ -12816,7 +12829,7 @@ jboolean __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_i void __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_free"))) TS_CResult_ScoringParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12831,7 +12844,7 @@ uint32_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_ok"))) o_conv = InitFeatures_clone(&o_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint32_t e) { @@ -12842,7 +12855,7 @@ uint32_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -12853,7 +12866,7 @@ jboolean __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_free"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12868,7 +12881,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_ok" o_conv = ChannelFeatures_clone(&o_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_err(uint32_t e) { @@ -12879,7 +12892,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -12890,7 +12903,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_is_ void __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12905,7 +12918,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_ok"))) o_conv = NodeFeatures_clone(&o_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint32_t e) { @@ -12916,7 +12929,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -12927,7 +12940,7 @@ jboolean __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_free"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12942,7 +12955,7 @@ uint32_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_ok" o_conv = InvoiceFeatures_clone(&o_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint32_t e) { @@ -12953,7 +12966,7 @@ uint32_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err e_conv = DecodeError_clone(&e_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -12964,7 +12977,7 @@ jboolean __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ void __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_free"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12979,7 +12992,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ o_conv = ChannelTypeFeatures_clone(&o_conv); LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err(uint32_t e) { @@ -12990,7 +13003,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -13001,7 +13014,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ void __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13009,13 +13022,13 @@ void __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_fre } uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_ok"))) TS_CResult_NetAddressDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr); - o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1)); + o_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o) & ~1)); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) TS_CResult_NetAddressDecodeErrorZ_err(uint32_t e) { @@ -13026,7 +13039,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) e_conv = DecodeError_clone(&e_conv); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_is_ok"))) TS_CResult_NetAddressDecodeErrorZ_is_ok(uint32_t o) { @@ -13037,7 +13050,7 @@ jboolean __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_is_ok")) void __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_free"))) TS_CResult_NetAddressDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13047,11 +13060,11 @@ void __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_free"))) TS_ static inline uintptr_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone_ptr"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone_ptr"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13059,7 +13072,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone")) LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_UpdateAddHTLCZ_free"))) TS_CVec_UpdateAddHTLCZ_free(uint32_tArray _res) { @@ -13069,7 +13082,7 @@ void __attribute__((export_name("TS_CVec_UpdateAddHTLCZ_free"))) TS_CVec_Update _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t p = 0; p < _res_constr.datalen; p++) { uint32_t _res_conv_15 = _res_vals[p]; LDKUpdateAddHTLC _res_conv_15_conv; @@ -13088,7 +13101,7 @@ void __attribute__((export_name("TS_CVec_UpdateFulfillHTLCZ_free"))) TS_CVec_Up _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t t = 0; t < _res_constr.datalen; t++) { uint32_t _res_conv_19 = _res_vals[t]; LDKUpdateFulfillHTLC _res_conv_19_conv; @@ -13107,7 +13120,7 @@ void __attribute__((export_name("TS_CVec_UpdateFailHTLCZ_free"))) TS_CVec_Updat _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t q = 0; q < _res_constr.datalen; q++) { uint32_t _res_conv_16 = _res_vals[q]; LDKUpdateFailHTLC _res_conv_16_conv; @@ -13126,7 +13139,7 @@ void __attribute__((export_name("TS_CVec_UpdateFailMalformedHTLCZ_free"))) TS_C _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t z = 0; z < _res_constr.datalen; z++) { uint32_t _res_conv_25 = _res_vals[z]; LDKUpdateFailMalformedHTLC _res_conv_25_conv; @@ -13146,7 +13159,7 @@ uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_ok")) o_conv = AcceptChannel_clone(&o_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err"))) TS_CResult_AcceptChannelDecodeErrorZ_err(uint32_t e) { @@ -13157,7 +13170,7 @@ uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_is_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_is_ok(uint32_t o) { @@ -13168,7 +13181,7 @@ jboolean __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_free"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13178,11 +13191,11 @@ void __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_free"))) static inline uintptr_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13190,7 +13203,7 @@ uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(orig & ~1); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok(uint32_t o) { @@ -13201,7 +13214,7 @@ uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErr o_conv = AnnouncementSignatures_clone(&o_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_err(uint32_t e) { @@ -13212,7 +13225,7 @@ uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErr e_conv = DecodeError_clone(&e_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -13223,7 +13236,7 @@ jboolean __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErr void __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_free"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13233,11 +13246,11 @@ void __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_ static inline uintptr_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13245,7 +13258,7 @@ uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErr LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(orig & ~1); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_ok(uint32_t o) { @@ -13256,7 +13269,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ o_conv = ChannelReestablish_clone(&o_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_err(uint32_t e) { @@ -13267,7 +13280,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_is_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_is_ok(uint32_t o) { @@ -13278,7 +13291,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ void __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_free"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13288,11 +13301,11 @@ void __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_free static inline uintptr_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13300,7 +13313,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_ok(uint32_t o) { @@ -13311,7 +13324,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_ok")) o_conv = ClosingSigned_clone(&o_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err"))) TS_CResult_ClosingSignedDecodeErrorZ_err(uint32_t e) { @@ -13322,7 +13335,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_is_ok(uint32_t o) { @@ -13333,7 +13346,7 @@ jboolean __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_free"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13343,11 +13356,11 @@ void __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_free"))) static inline uintptr_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13355,7 +13368,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(uint32_t o) { @@ -13366,7 +13379,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErro o_conv = ClosingSignedFeeRange_clone(&o_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err(uint32_t e) { @@ -13377,7 +13390,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErro e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(uint32_t o) { @@ -13388,7 +13401,7 @@ jboolean __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErro void __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13398,11 +13411,11 @@ void __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_f static inline uintptr_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13410,7 +13423,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErro LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_ok(uint32_t o) { @@ -13421,7 +13434,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok o_conv = CommitmentSigned_clone(&o_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_err(uint32_t e) { @@ -13432,7 +13445,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_er e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_is_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_is_ok(uint32_t o) { @@ -13443,7 +13456,7 @@ jboolean __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_is void __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_free"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13453,11 +13466,11 @@ void __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_free") static inline uintptr_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13465,7 +13478,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_cl LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_ok(uint32_t o) { @@ -13476,7 +13489,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok") o_conv = FundingCreated_clone(&o_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err"))) TS_CResult_FundingCreatedDecodeErrorZ_err(uint32_t e) { @@ -13487,7 +13500,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_is_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_is_ok(uint32_t o) { @@ -13498,7 +13511,7 @@ jboolean __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_free"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13508,11 +13521,11 @@ void __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_free"))) static inline uintptr_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13520,7 +13533,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clon LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok"))) TS_CResult_FundingSignedDecodeErrorZ_ok(uint32_t o) { @@ -13531,7 +13544,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok")) o_conv = FundingSigned_clone(&o_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err"))) TS_CResult_FundingSignedDecodeErrorZ_err(uint32_t e) { @@ -13542,7 +13555,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_is_ok"))) TS_CResult_FundingSignedDecodeErrorZ_is_ok(uint32_t o) { @@ -13553,7 +13566,7 @@ jboolean __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_free"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13563,11 +13576,11 @@ void __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_free"))) static inline uintptr_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13575,7 +13588,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_ok"))) TS_CResult_FundingLockedDecodeErrorZ_ok(uint32_t o) { @@ -13586,7 +13599,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_ok")) o_conv = FundingLocked_clone(&o_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_err"))) TS_CResult_FundingLockedDecodeErrorZ_err(uint32_t e) { @@ -13597,7 +13610,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_is_ok"))) TS_CResult_FundingLockedDecodeErrorZ_is_ok(uint32_t o) { @@ -13608,7 +13621,7 @@ jboolean __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_free"))) TS_CResult_FundingLockedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13618,11 +13631,11 @@ void __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_free"))) static inline uintptr_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingLockedDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingLockedDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_FundingLockedDecodeErrorZ* arg_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13630,7 +13643,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_clone LDKCResult_FundingLockedDecodeErrorZ* orig_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CResult_InitDecodeErrorZ_ok(uint32_t o) { @@ -13641,7 +13654,7 @@ uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CRes o_conv = Init_clone(&o_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CResult_InitDecodeErrorZ_err(uint32_t e) { @@ -13652,7 +13665,7 @@ uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CRe e_conv = DecodeError_clone(&e_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_InitDecodeErrorZ_is_ok"))) TS_CResult_InitDecodeErrorZ_is_ok(uint32_t o) { @@ -13663,7 +13676,7 @@ jboolean __attribute__((export_name("TS_CResult_InitDecodeErrorZ_is_ok"))) TS_C void __attribute__((export_name("TS_CResult_InitDecodeErrorZ_free"))) TS_CResult_InitDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13673,11 +13686,11 @@ void __attribute__((export_name("TS_CResult_InitDecodeErrorZ_free"))) TS_CResul static inline uintptr_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone_ptr"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone_ptr"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_InitDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_InitDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13685,7 +13698,7 @@ uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone"))) TS_C LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)(orig & ~1); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) TS_CResult_OpenChannelDecodeErrorZ_ok(uint32_t o) { @@ -13696,7 +13709,7 @@ uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) o_conv = OpenChannel_clone(&o_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) TS_CResult_OpenChannelDecodeErrorZ_err(uint32_t e) { @@ -13707,7 +13720,7 @@ uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) e_conv = DecodeError_clone(&e_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_is_ok"))) TS_CResult_OpenChannelDecodeErrorZ_is_ok(uint32_t o) { @@ -13718,7 +13731,7 @@ jboolean __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_is_ok") void __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_free"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13728,11 +13741,11 @@ void __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_free"))) TS static inline uintptr_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone_ptr"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone_ptr"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13740,7 +13753,7 @@ uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone") LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(orig & ~1); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_ok(uint32_t o) { @@ -13751,7 +13764,7 @@ uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) o_conv = RevokeAndACK_clone(&o_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_err(uint32_t e) { @@ -13762,7 +13775,7 @@ uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_is_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_is_ok(uint32_t o) { @@ -13773,7 +13786,7 @@ jboolean __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_free"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13783,11 +13796,11 @@ void __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_free"))) T static inline uintptr_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13795,7 +13808,7 @@ uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone" LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(orig & ~1); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_CResult_ShutdownDecodeErrorZ_ok(uint32_t o) { @@ -13806,7 +13819,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_ o_conv = Shutdown_clone(&o_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS_CResult_ShutdownDecodeErrorZ_err(uint32_t e) { @@ -13817,7 +13830,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_is_ok"))) TS_CResult_ShutdownDecodeErrorZ_is_ok(uint32_t o) { @@ -13828,7 +13841,7 @@ jboolean __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_free"))) TS_CResult_ShutdownDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13838,11 +13851,11 @@ void __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_free"))) TS_CR static inline uintptr_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13850,7 +13863,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone"))) LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_ok(uint32_t o) { @@ -13861,7 +13874,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok") o_conv = UpdateFailHTLC_clone(&o_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_err(uint32_t e) { @@ -13872,7 +13885,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok(uint32_t o) { @@ -13883,7 +13896,7 @@ jboolean __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13893,11 +13906,11 @@ void __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_free"))) static inline uintptr_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13905,7 +13918,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clon LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(uint32_t o) { @@ -13916,7 +13929,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeEr o_conv = UpdateFailMalformedHTLC_clone(&o_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(uint32_t e) { @@ -13927,7 +13940,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeEr e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(uint32_t o) { @@ -13938,7 +13951,7 @@ jboolean __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeEr void __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13948,11 +13961,11 @@ void __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ static inline uintptr_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13960,7 +13973,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeEr LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_ok(uint32_t o) { @@ -13971,7 +13984,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_ok"))) TS o_conv = UpdateFee_clone(&o_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_err"))) TS_CResult_UpdateFeeDecodeErrorZ_err(uint32_t e) { @@ -13982,7 +13995,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_err"))) T e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_is_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_is_ok(uint32_t o) { @@ -13993,7 +14006,7 @@ jboolean __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_free"))) TS_CResult_UpdateFeeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14003,11 +14016,11 @@ void __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_free"))) TS_C static inline uintptr_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14015,7 +14028,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone"))) LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok(uint32_t o) { @@ -14026,7 +14039,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_o o_conv = UpdateFulfillHTLC_clone(&o_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err(uint32_t e) { @@ -14037,7 +14050,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_e e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(uint32_t o) { @@ -14048,7 +14061,7 @@ jboolean __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_i void __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14058,11 +14071,11 @@ void __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free" static inline uintptr_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14070,7 +14083,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_c LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_ok(uint32_t o) { @@ -14081,7 +14094,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_ok")) o_conv = UpdateAddHTLC_clone(&o_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_err(uint32_t e) { @@ -14092,7 +14105,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok(uint32_t o) { @@ -14103,7 +14116,7 @@ jboolean __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_free"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14113,11 +14126,11 @@ void __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_free"))) static inline uintptr_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14125,7 +14138,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_ok"))) TS_CResult_PingDecodeErrorZ_ok(uint32_t o) { @@ -14136,7 +14149,7 @@ uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_ok"))) TS_CRes o_conv = Ping_clone(&o_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_err"))) TS_CResult_PingDecodeErrorZ_err(uint32_t e) { @@ -14147,7 +14160,7 @@ uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_err"))) TS_CRe e_conv = DecodeError_clone(&e_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PingDecodeErrorZ_is_ok"))) TS_CResult_PingDecodeErrorZ_is_ok(uint32_t o) { @@ -14158,7 +14171,7 @@ jboolean __attribute__((export_name("TS_CResult_PingDecodeErrorZ_is_ok"))) TS_C void __attribute__((export_name("TS_CResult_PingDecodeErrorZ_free"))) TS_CResult_PingDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14168,11 +14181,11 @@ void __attribute__((export_name("TS_CResult_PingDecodeErrorZ_free"))) TS_CResul static inline uintptr_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone_ptr"))) TS_CResult_PingDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone_ptr"))) TS_CResult_PingDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PingDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PingDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14180,7 +14193,7 @@ uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone"))) TS_C LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)(orig & ~1); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_ok"))) TS_CResult_PongDecodeErrorZ_ok(uint32_t o) { @@ -14191,7 +14204,7 @@ uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_ok"))) TS_CRes o_conv = Pong_clone(&o_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_err"))) TS_CResult_PongDecodeErrorZ_err(uint32_t e) { @@ -14202,7 +14215,7 @@ uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_err"))) TS_CRe e_conv = DecodeError_clone(&e_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PongDecodeErrorZ_is_ok"))) TS_CResult_PongDecodeErrorZ_is_ok(uint32_t o) { @@ -14213,7 +14226,7 @@ jboolean __attribute__((export_name("TS_CResult_PongDecodeErrorZ_is_ok"))) TS_C void __attribute__((export_name("TS_CResult_PongDecodeErrorZ_free"))) TS_CResult_PongDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14223,11 +14236,11 @@ void __attribute__((export_name("TS_CResult_PongDecodeErrorZ_free"))) TS_CResul static inline uintptr_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone_ptr"))) TS_CResult_PongDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone_ptr"))) TS_CResult_PongDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PongDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PongDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14235,7 +14248,7 @@ uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone"))) TS_C LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)(orig & ~1); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(uint32_t o) { @@ -14246,7 +14259,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDeco o_conv = UnsignedChannelAnnouncement_clone(&o_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(uint32_t e) { @@ -14257,7 +14270,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDeco e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(uint32_t o) { @@ -14268,7 +14281,7 @@ jboolean __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDeco void __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14278,11 +14291,11 @@ void __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeEr static inline uintptr_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14290,7 +14303,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDeco LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_ok(uint32_t o) { @@ -14301,7 +14314,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ o_conv = ChannelAnnouncement_clone(&o_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_err(uint32_t e) { @@ -14312,7 +14325,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok(uint32_t o) { @@ -14323,7 +14336,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ void __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14333,11 +14346,11 @@ void __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_fre static inline uintptr_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14345,7 +14358,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok(uint32_t o) { @@ -14356,7 +14369,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErro o_conv = UnsignedChannelUpdate_clone(&o_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err(uint32_t e) { @@ -14367,7 +14380,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErro e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(uint32_t o) { @@ -14378,7 +14391,7 @@ jboolean __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErro void __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14388,11 +14401,11 @@ void __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_f static inline uintptr_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14400,7 +14413,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErro LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_ok(uint32_t o) { @@ -14411,7 +14424,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_ok")) o_conv = ChannelUpdate_clone(&o_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_err(uint32_t e) { @@ -14422,7 +14435,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_is_ok(uint32_t o) { @@ -14433,7 +14446,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_free"))) TS_CResult_ChannelUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14443,11 +14456,11 @@ void __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_free"))) static inline uintptr_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14455,7 +14468,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_ok(uint32_t o) { @@ -14466,7 +14479,7 @@ uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_ok"))) o_conv = ErrorMessage_clone(&o_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_err"))) TS_CResult_ErrorMessageDecodeErrorZ_err(uint32_t e) { @@ -14477,7 +14490,7 @@ uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_is_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_is_ok(uint32_t o) { @@ -14488,7 +14501,7 @@ jboolean __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_free"))) TS_CResult_ErrorMessageDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14498,11 +14511,11 @@ void __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_free"))) T static inline uintptr_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr"))) TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr"))) TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14510,7 +14523,7 @@ uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone" LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(orig & ~1); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(uint32_t o) { @@ -14521,7 +14534,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeE o_conv = UnsignedNodeAnnouncement_clone(&o_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(uint32_t e) { @@ -14532,7 +14545,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeE e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(uint32_t o) { @@ -14543,7 +14556,7 @@ jboolean __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeE void __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14553,11 +14566,11 @@ void __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeError static inline uintptr_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14565,7 +14578,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeE LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_ok(uint32_t o) { @@ -14576,7 +14589,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_ok o_conv = NodeAnnouncement_clone(&o_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_err(uint32_t e) { @@ -14587,7 +14600,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_er e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok(uint32_t o) { @@ -14598,7 +14611,7 @@ jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_is void __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14608,11 +14621,11 @@ void __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_free") static inline uintptr_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14620,7 +14633,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_cl LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok(uint32_t o) { @@ -14631,7 +14644,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeError o_conv = QueryShortChannelIds_clone(&o_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_err(uint32_t e) { @@ -14642,7 +14655,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeError e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(uint32_t o) { @@ -14653,7 +14666,7 @@ jboolean __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeError void __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_free"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14663,11 +14676,11 @@ void __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_fr static inline uintptr_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14675,7 +14688,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeError LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(orig & ~1); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(uint32_t o) { @@ -14686,7 +14699,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeEr o_conv = ReplyShortChannelIdsEnd_clone(&o_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(uint32_t e) { @@ -14697,7 +14710,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeEr e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(uint32_t o) { @@ -14708,7 +14721,7 @@ jboolean __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeEr void __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14718,11 +14731,11 @@ void __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ static inline uintptr_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14730,7 +14743,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeEr LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_ok(uint32_t o) { @@ -14741,7 +14754,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_o o_conv = QueryChannelRange_clone(&o_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_err(uint32_t e) { @@ -14752,7 +14765,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_e e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok(uint32_t o) { @@ -14763,7 +14776,7 @@ jboolean __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_i void __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_free"))) TS_CResult_QueryChannelRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14773,11 +14786,11 @@ void __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_free" static inline uintptr_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14785,7 +14798,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_c LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_ok(uint32_t o) { @@ -14796,7 +14809,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_o o_conv = ReplyChannelRange_clone(&o_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_err(uint32_t e) { @@ -14807,7 +14820,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_e e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok(uint32_t o) { @@ -14818,7 +14831,7 @@ jboolean __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_i void __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_free"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14828,11 +14841,11 @@ void __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_free" static inline uintptr_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14840,7 +14853,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_c LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_ok(uint32_t o) { @@ -14851,7 +14864,7 @@ uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro o_conv = GossipTimestampFilter_clone(&o_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_err(uint32_t e) { @@ -14862,7 +14875,7 @@ uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro e_conv = DecodeError_clone(&e_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok(uint32_t o) { @@ -14873,7 +14886,7 @@ jboolean __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro void __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_free"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14883,11 +14896,11 @@ void __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_f static inline uintptr_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14895,7 +14908,7 @@ uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(orig & ~1); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(uint32_t o) { @@ -14906,7 +14919,7 @@ uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorD o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(uint32_t e) { @@ -14917,7 +14930,7 @@ uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorD e_conv = DecodeError_clone(&e_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { @@ -14928,7 +14941,7 @@ jboolean __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorD void __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14938,11 +14951,11 @@ void __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecod static inline uintptr_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14950,7 +14963,7 @@ uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorD LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(uint32_t o) { @@ -14961,7 +14974,7 @@ uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDe o_conv = StaticPaymentOutputDescriptor_clone(&o_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(uint32_t e) { @@ -14972,7 +14985,7 @@ uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDe e_conv = DecodeError_clone(&e_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { @@ -14983,7 +14996,7 @@ jboolean __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDe void __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14993,11 +15006,11 @@ void __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecode static inline uintptr_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15005,17 +15018,17 @@ uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDe LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr); - o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1)); + o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)o) & ~1)); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err(uint32_t e) { @@ -15026,7 +15039,7 @@ uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecode e_conv = DecodeError_clone(&e_conv); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { @@ -15037,7 +15050,7 @@ jboolean __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecode void __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -15047,11 +15060,11 @@ void __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErro static inline uintptr_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15059,17 +15072,17 @@ uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecode LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } static inline uintptr_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) { LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(uint32_t arg) { LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1); - int64_t ret_val = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); return ret_val; } @@ -15077,35 +15090,35 @@ uint32_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1); LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_new"))) TS_C2Tuple_SignatureCVec_SignatureZZ_new(int8_tArray a, ptrArray b) { LDKSignature a_ref; CHECK(a->arr_len == 64); - memcpy(a_ref.compact_form, a->elems, 64); + memcpy(a_ref.compact_form, a->elems, 64); FREE(a); LDKCVec_SignatureZ b_constr; b_constr.datalen = b->arr_len; if (b_constr.datalen > 0) b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else b_constr.data = NULL; - int8_tArray* b_vals = (void*) b->elems; + int8_tArray* b_vals = (void*) b->elems /* XXX b leaks */; for (size_t m = 0; m < b_constr.datalen; m++) { int8_tArray b_conv_12 = b_vals[m]; LDKSignature b_conv_12_ref; CHECK(b_conv_12->arr_len == 64); - memcpy(b_conv_12_ref.compact_form, b_conv_12->elems, 64); + memcpy(b_conv_12_ref.compact_form, b_conv_12->elems, 64); FREE(b_conv_12); b_constr.data[m] = b_conv_12_ref; } LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_free"))) TS_C2Tuple_SignatureCVec_SignatureZZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr); FREE((void*)_res); @@ -15113,19 +15126,19 @@ void __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_free"))) } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr); - o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uintptr_t)o) & ~1)); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err() { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(uint32_t o) { @@ -15136,7 +15149,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_Signature void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15146,11 +15159,11 @@ void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNo static inline uintptr_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(uint32_t arg) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); - int64_t ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -15158,22 +15171,22 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_Signature LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SignatureNoneZ_ok"))) TS_CResult_SignatureNoneZ_ok(int8_tArray o) { LDKSignature o_ref; CHECK(o->arr_len == 64); - memcpy(o_ref.compact_form, o->elems, 64); + memcpy(o_ref.compact_form, o->elems, 64); FREE(o); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = CResult_SignatureNoneZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SignatureNoneZ_err"))) TS_CResult_SignatureNoneZ_err() { LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = CResult_SignatureNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_SignatureNoneZ_is_ok"))) TS_CResult_SignatureNoneZ_is_ok(uint32_t o) { @@ -15184,7 +15197,7 @@ jboolean __attribute__((export_name("TS_CResult_SignatureNoneZ_is_ok"))) TS_CRe void __attribute__((export_name("TS_CResult_SignatureNoneZ_free"))) TS_CResult_SignatureNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15194,11 +15207,11 @@ void __attribute__((export_name("TS_CResult_SignatureNoneZ_free"))) TS_CResult_ static inline uintptr_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) { LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = CResult_SignatureNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone_ptr"))) TS_CResult_SignatureNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone_ptr"))) TS_CResult_SignatureNoneZ_clone_ptr(uint32_t arg) { LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1); - int64_t ret_val = CResult_SignatureNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_SignatureNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -15206,16 +15219,16 @@ uint32_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone"))) TS_CRe LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = CResult_SignatureNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_ok"))) TS_CResult_SignDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKSign o_conv = *(LDKSign*)(o_ptr); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_err"))) TS_CResult_SignDecodeErrorZ_err(uint32_t e) { @@ -15226,7 +15239,7 @@ uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_err"))) TS_CRe e_conv = DecodeError_clone(&e_conv); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_SignDecodeErrorZ_is_ok"))) TS_CResult_SignDecodeErrorZ_is_ok(uint32_t o) { @@ -15237,7 +15250,7 @@ jboolean __attribute__((export_name("TS_CResult_SignDecodeErrorZ_is_ok"))) TS_C void __attribute__((export_name("TS_CResult_SignDecodeErrorZ_free"))) TS_CResult_SignDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -15247,11 +15260,11 @@ void __attribute__((export_name("TS_CResult_SignDecodeErrorZ_free"))) TS_CResul static inline uintptr_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone_ptr"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone_ptr"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15259,22 +15272,22 @@ uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone"))) TS_C LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_ok"))) TS_CResult_RecoverableSignatureNoneZ_ok(int8_tArray o) { LDKRecoverableSignature o_ref; CHECK(o->arr_len == 68); - memcpy(o_ref.serialized_form, o->elems, 68); + memcpy(o_ref.serialized_form, o->elems, 68); FREE(o); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_err"))) TS_CResult_RecoverableSignatureNoneZ_err() { LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); *ret_conv = CResult_RecoverableSignatureNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_is_ok"))) TS_CResult_RecoverableSignatureNoneZ_is_ok(uint32_t o) { @@ -15285,7 +15298,7 @@ jboolean __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_is_ok void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_free"))) TS_CResult_RecoverableSignatureNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15295,11 +15308,11 @@ void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_free"))) static inline uintptr_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) { LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone_ptr"))) TS_CResult_RecoverableSignatureNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone_ptr"))) TS_CResult_RecoverableSignatureNoneZ_clone_ptr(uint32_t arg) { LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); - int64_t ret_val = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -15307,7 +15320,7 @@ uint32_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_CVec_u8ZZ_free"))) TS_CVec_CVec_u8ZZ_free(ptrArray _res) { @@ -15317,13 +15330,13 @@ void __attribute__((export_name("TS_CVec_CVec_u8ZZ_free"))) TS_CVec_CVec_u8ZZ_f _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); else _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; + int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { int8_tArray _res_conv_12 = _res_vals[m]; LDKCVec_u8Z _res_conv_12_ref; _res_conv_12_ref.datalen = _res_conv_12->arr_len; _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); + memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12); _res_constr.data[m] = _res_conv_12_ref; } CVec_CVec_u8ZZ_free(_res_constr); @@ -15336,24 +15349,24 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_ok"))) TS_C o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); else o_constr.data = NULL; - int8_tArray* o_vals = (void*) o->elems; + int8_tArray* o_vals = (void*) o->elems /* XXX o leaks */; for (size_t m = 0; m < o_constr.datalen; m++) { int8_tArray o_conv_12 = o_vals[m]; LDKCVec_u8Z o_conv_12_ref; o_conv_12_ref.datalen = o_conv_12->arr_len; o_conv_12_ref.data = MALLOC(o_conv_12_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(o_conv_12_ref.data, o_conv_12->elems, o_conv_12_ref.datalen); + memcpy(o_conv_12_ref.data, o_conv_12->elems, o_conv_12_ref.datalen); FREE(o_conv_12); o_constr.data[m] = o_conv_12_ref; } LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_err() { LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok(uint32_t o) { @@ -15364,7 +15377,7 @@ jboolean __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok"))) T void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_free"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15374,11 +15387,11 @@ void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_free"))) TS_CRe static inline uintptr_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(uint32_t arg) { LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); - int64_t ret_val = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -15386,7 +15399,7 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone"))) T LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_ok(uint32_t o) { @@ -15397,7 +15410,7 @@ uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_ok") o_conv = InMemorySigner_clone(&o_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_err"))) TS_CResult_InMemorySignerDecodeErrorZ_err(uint32_t e) { @@ -15408,7 +15421,7 @@ uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_is_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_is_ok(uint32_t o) { @@ -15419,7 +15432,7 @@ jboolean __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_free"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -15429,11 +15442,11 @@ void __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_free"))) static inline uintptr_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr"))) TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr"))) TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15441,7 +15454,7 @@ uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clon LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_TxOutZ_free"))) TS_CVec_TxOutZ_free(uint32_tArray _res) { @@ -15451,10 +15464,10 @@ void __attribute__((export_name("TS_CVec_TxOutZ_free"))) TS_CVec_TxOutZ_free(ui _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t h = 0; h < _res_constr.datalen; h++) { uint32_t _res_conv_7 = _res_vals[h]; - void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1); + void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); CHECK_ACCESS(_res_conv_7_ptr); LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr); FREE((void*)_res_conv_7); @@ -15467,17 +15480,17 @@ uint32_t __attribute__((export_name("TS_CResult_TransactionNoneZ_ok"))) TS_CRes LDKTransaction o_ref; o_ref.datalen = o->arr_len; o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes"); - memcpy(o_ref.data, o->elems, o_ref.datalen); + memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o); o_ref.data_is_owned = true; LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); *ret_conv = CResult_TransactionNoneZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TransactionNoneZ_err"))) TS_CResult_TransactionNoneZ_err() { LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); *ret_conv = CResult_TransactionNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TransactionNoneZ_is_ok"))) TS_CResult_TransactionNoneZ_is_ok(uint32_t o) { @@ -15488,7 +15501,7 @@ jboolean __attribute__((export_name("TS_CResult_TransactionNoneZ_is_ok"))) TS_C void __attribute__((export_name("TS_CResult_TransactionNoneZ_free"))) TS_CResult_TransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15498,11 +15511,11 @@ void __attribute__((export_name("TS_CResult_TransactionNoneZ_free"))) TS_CResul static inline uintptr_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); *ret_conv = CResult_TransactionNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone_ptr"))) TS_CResult_TransactionNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone_ptr"))) TS_CResult_TransactionNoneZ_clone_ptr(uint32_t arg) { LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1); - int64_t ret_val = CResult_TransactionNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_TransactionNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -15510,29 +15523,29 @@ uint32_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone"))) TS_C LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1); LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); *ret_conv = CResult_TransactionNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_FilterZ_some"))) TS_COption_FilterZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKFilter o_conv = *(LDKFilter*)(o_ptr); LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); *ret_copy = COption_FilterZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_FilterZ_none"))) TS_COption_FilterZ_none() { LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); *ret_copy = COption_FilterZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_FilterZ_free"))) TS_COption_FilterZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr); FREE((void*)_res); @@ -15547,13 +15560,13 @@ uint32_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_ok")) // Warning: we need a move here but no clone is available for LDKLockedChannelMonitor LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_err"))) TS_CResult_LockedChannelMonitorNoneZ_err() { LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = CResult_LockedChannelMonitorNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_is_ok"))) TS_CResult_LockedChannelMonitorNoneZ_is_ok(uint32_t o) { @@ -15564,7 +15577,7 @@ jboolean __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_is_ok void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_free"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15578,7 +15591,7 @@ void __attribute__((export_name("TS_CVec_OutPointZ_free"))) TS_CVec_OutPointZ_f _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t k = 0; k < _res_constr.datalen; k++) { uint32_t _res_conv_10 = _res_vals[k]; LDKOutPoint _res_conv_10_conv; @@ -15593,17 +15606,17 @@ void __attribute__((export_name("TS_CVec_OutPointZ_free"))) TS_CVec_OutPointZ_f uint32_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_ok"))) TS_CResult_NoneAPIErrorZ_ok() { LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_err"))) TS_CResult_NoneAPIErrorZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1)); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NoneAPIErrorZ_is_ok"))) TS_CResult_NoneAPIErrorZ_is_ok(uint32_t o) { @@ -15614,7 +15627,7 @@ jboolean __attribute__((export_name("TS_CResult_NoneAPIErrorZ_is_ok"))) TS_CRes void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_free"))) TS_CResult_NoneAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr); FREE((void*)_res); @@ -15624,11 +15637,11 @@ void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_free"))) TS_CResult_N static inline uintptr_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) { LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone_ptr"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone_ptr"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15636,26 +15649,26 @@ uint32_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone"))) TS_CRes LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)(orig & ~1); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_u16Z_some"))) TS_COption_u16Z_some(int16_t o) { LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = COption_u16Z_some(o); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_u16Z_none"))) TS_COption_u16Z_none() { LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = COption_u16Z_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_u16Z_free"))) TS_COption_u16Z_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr); FREE((void*)_res); @@ -15665,12 +15678,12 @@ void __attribute__((export_name("TS_COption_u16Z_free"))) TS_COption_u16Z_free( static inline uintptr_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) { LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = COption_u16Z_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_u16Z_clone_ptr"))) TS_COption_u16Z_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_u16Z_clone_ptr"))) TS_COption_u16Z_clone_ptr(uint32_t arg) { LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg; - int64_t ret_val = COption_u16Z_clone_ptr(arg_conv); + intptr_t ret_val = COption_u16Z_clone_ptr(arg_conv); return ret_val; } @@ -15678,7 +15691,7 @@ uint32_t __attribute__((export_name("TS_COption_u16Z_clone"))) TS_COption_u16Z_ LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = COption_u16Z_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -15689,10 +15702,10 @@ void __attribute__((export_name("TS_CVec_CResult_NoneAPIErrorZZ_free"))) TS_CVe _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t w = 0; w < _res_constr.datalen; w++) { uint32_t _res_conv_22 = _res_vals[w]; - void* _res_conv_22_ptr = (void*)(((uint64_t)_res_conv_22) & ~1); + void* _res_conv_22_ptr = (void*)(((uintptr_t)_res_conv_22) & ~1); CHECK_ACCESS(_res_conv_22_ptr); LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr); FREE((void*)_res_conv_22); @@ -15708,10 +15721,10 @@ void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_f _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t k = 0; k < _res_constr.datalen; k++) { uint32_t _res_conv_10 = _res_vals[k]; - void* _res_conv_10_ptr = (void*)(((uint64_t)_res_conv_10) & ~1); + void* _res_conv_10_ptr = (void*)(((uintptr_t)_res_conv_10) & ~1); CHECK_ACCESS(_res_conv_10_ptr); LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr); FREE((void*)_res_conv_10); @@ -15723,20 +15736,20 @@ void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_f uint32_t __attribute__((export_name("TS_CResult__u832APIErrorZ_ok"))) TS_CResult__u832APIErrorZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = CResult__u832APIErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult__u832APIErrorZ_err"))) TS_CResult__u832APIErrorZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1)); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = CResult__u832APIErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult__u832APIErrorZ_is_ok"))) TS_CResult__u832APIErrorZ_is_ok(uint32_t o) { @@ -15747,7 +15760,7 @@ jboolean __attribute__((export_name("TS_CResult__u832APIErrorZ_is_ok"))) TS_CRe void __attribute__((export_name("TS_CResult__u832APIErrorZ_free"))) TS_CResult__u832APIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr); FREE((void*)_res); @@ -15757,11 +15770,11 @@ void __attribute__((export_name("TS_CResult__u832APIErrorZ_free"))) TS_CResult_ static inline uintptr_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) { LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = CResult__u832APIErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone_ptr"))) TS_CResult__u832APIErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone_ptr"))) TS_CResult__u832APIErrorZ_clone_ptr(uint32_t arg) { LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1); - int64_t ret_val = CResult__u832APIErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult__u832APIErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15769,26 +15782,26 @@ uint32_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone"))) TS_CRe LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = CResult__u832APIErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1)); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_is_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_is_ok(uint32_t o) { @@ -15799,7 +15812,7 @@ jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_is void __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_free"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); @@ -15809,11 +15822,11 @@ void __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_free") static inline uintptr_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) { LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint32_t arg) { LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); - int64_t ret_val = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); return ret_val; } @@ -15821,23 +15834,23 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_cl LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_ok"))) TS_CResult_NonePaymentSendFailureZ_ok() { LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); *ret_conv = CResult_NonePaymentSendFailureZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_err"))) TS_CResult_NonePaymentSendFailureZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1)); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_is_ok"))) TS_CResult_NonePaymentSendFailureZ_is_ok(uint32_t o) { @@ -15848,7 +15861,7 @@ jboolean __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_is_ok") void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_free"))) TS_CResult_NonePaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); @@ -15858,11 +15871,11 @@ void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_free"))) TS static inline uintptr_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone_ptr"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone_ptr"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint32_t arg) { LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); - int64_t ret_val = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); return ret_val; } @@ -15870,17 +15883,17 @@ uint32_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone") LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)(orig & ~1); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } static inline uintptr_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) { LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr(uint32_t arg) { LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1); - int64_t ret_val = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); return ret_val; } @@ -15888,24 +15901,24 @@ uint32_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone"))) LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_new"))) TS_C2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, int8_tArray b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKThirtyTwoBytes b_ref; CHECK(b->arr_len == 32); - memcpy(b_ref.data, b->elems, 32); + memcpy(b_ref.data, b->elems, 32); FREE(b); LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_free"))) TS_C2Tuple_PaymentHashPaymentIdZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr); FREE((void*)_res); @@ -15913,23 +15926,23 @@ void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_free"))) TS_C } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uintptr_t)o) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1)); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(uint32_t o) { @@ -15940,7 +15953,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPa void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); @@ -15950,11 +15963,11 @@ void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymen static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(uint32_t arg) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); - int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); return ret_val; } @@ -15962,17 +15975,17 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPa LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } static inline uintptr_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) { LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(uint32_t arg) { LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1); - int64_t ret_val = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); return ret_val; } @@ -15980,24 +15993,24 @@ uint32_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_new"))) TS_C2Tuple_PaymentHashPaymentSecretZ_new(int8_tArray a, int8_tArray b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKThirtyTwoBytes b_ref; CHECK(b->arr_len == 32); - memcpy(b_ref.data, b->elems, 32); + memcpy(b_ref.data, b->elems, 32); FREE(b); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_free"))) TS_C2Tuple_PaymentHashPaymentSecretZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr); FREE((void*)_res); @@ -16005,19 +16018,19 @@ void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_free"))) } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err() { LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(uint32_t o) { @@ -16028,7 +16041,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr); FREE((void*)_res); @@ -16038,11 +16051,11 @@ void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNo static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) { LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(uint32_t arg) { LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1); - int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -16050,27 +16063,27 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(orig & ~1); LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1)); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(uint32_t o) { @@ -16081,7 +16094,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr); FREE((void*)_res); @@ -16091,11 +16104,11 @@ void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAP static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) { LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(uint32_t arg) { LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1); - int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -16103,22 +16116,22 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(orig & ~1); LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_ok"))) TS_CResult_PaymentSecretNoneZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_err"))) TS_CResult_PaymentSecretNoneZ_err() { LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); *ret_conv = CResult_PaymentSecretNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_is_ok"))) TS_CResult_PaymentSecretNoneZ_is_ok(uint32_t o) { @@ -16129,7 +16142,7 @@ jboolean __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_is_ok"))) TS void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_free"))) TS_CResult_PaymentSecretNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr); FREE((void*)_res); @@ -16139,11 +16152,11 @@ void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_free"))) TS_CRes static inline uintptr_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) { LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); *ret_conv = CResult_PaymentSecretNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone_ptr"))) TS_CResult_PaymentSecretNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone_ptr"))) TS_CResult_PaymentSecretNoneZ_clone_ptr(uint32_t arg) { LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1); - int64_t ret_val = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -16151,26 +16164,26 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone"))) TS LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)(orig & ~1); LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_ok"))) TS_CResult_PaymentSecretAPIErrorZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_err"))) TS_CResult_PaymentSecretAPIErrorZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1)); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_is_ok"))) TS_CResult_PaymentSecretAPIErrorZ_is_ok(uint32_t o) { @@ -16181,7 +16194,7 @@ jboolean __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_is_ok")) void __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_free"))) TS_CResult_PaymentSecretAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr); FREE((void*)_res); @@ -16191,11 +16204,11 @@ void __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_free"))) TS_ static inline uintptr_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) { LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone_ptr"))) TS_CResult_PaymentSecretAPIErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone_ptr"))) TS_CResult_PaymentSecretAPIErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -16203,26 +16216,26 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone")) LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_err"))) TS_CResult_PaymentPreimageAPIErrorZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1)); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_is_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_is_ok(uint32_t o) { @@ -16233,7 +16246,7 @@ jboolean __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_is_ok" void __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_free"))) TS_CResult_PaymentPreimageAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr); FREE((void*)_res); @@ -16243,11 +16256,11 @@ void __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_free"))) T static inline uintptr_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) { LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr"))) TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr"))) TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -16255,7 +16268,7 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone" LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(orig & ~1); LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_ChannelMonitorZ_free(uint32_tArray _res) { @@ -16265,7 +16278,7 @@ void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_Chann _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t q = 0; q < _res_constr.datalen; q++) { uint32_t _res_conv_16 = _res_vals[q]; LDKChannelMonitor _res_conv_16_conv; @@ -16280,7 +16293,7 @@ void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_Chann uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_new"))) TS_C2Tuple_BlockHashChannelManagerZ_new(int8_tArray a, uint32_t b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKChannelManager b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); @@ -16288,12 +16301,12 @@ uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_new")) // Warning: we need a move here but no clone is available for LDKChannelManager LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_free"))) TS_C2Tuple_BlockHashChannelManagerZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr); FREE((void*)_res); @@ -16301,13 +16314,13 @@ void __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_free"))) T } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr); // Warning: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(uint32_t e) { @@ -16318,7 +16331,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManager e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(uint32_t o) { @@ -16329,7 +16342,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManager void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -16338,7 +16351,7 @@ void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDec void __attribute__((export_name("TS_PaymentPurpose_free"))) TS_PaymentPurpose_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -16348,12 +16361,12 @@ void __attribute__((export_name("TS_PaymentPurpose_free"))) TS_PaymentPurpose_f static inline uintptr_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); *ret_copy = PaymentPurpose_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_PaymentPurpose_clone_ptr"))) TS_PaymentPurpose_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_PaymentPurpose_clone_ptr"))) TS_PaymentPurpose_clone_ptr(uint32_t arg) { LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)arg; - int64_t ret_val = PaymentPurpose_clone_ptr(arg_conv); + intptr_t ret_val = PaymentPurpose_clone_ptr(arg_conv); return ret_val; } @@ -16361,36 +16374,36 @@ uint32_t __attribute__((export_name("TS_PaymentPurpose_clone"))) TS_PaymentPurp LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)orig; LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); *ret_copy = PaymentPurpose_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_PaymentPurpose_invoice_payment"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret) { LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); LDKThirtyTwoBytes payment_secret_ref; CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_PaymentPurpose_spontaneous_payment"))) TS_PaymentPurpose_spontaneous_payment(int8_tArray a) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_ClosureReason_free"))) TS_ClosureReason_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -16400,12 +16413,12 @@ void __attribute__((export_name("TS_ClosureReason_free"))) TS_ClosureReason_fre static inline uintptr_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_ClosureReason_clone_ptr"))) TS_ClosureReason_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ClosureReason_clone_ptr"))) TS_ClosureReason_clone_ptr(uint32_t arg) { LDKClosureReason* arg_conv = (LDKClosureReason*)arg; - int64_t ret_val = ClosureReason_clone_ptr(arg_conv); + intptr_t ret_val = ClosureReason_clone_ptr(arg_conv); return ret_val; } @@ -16413,7 +16426,7 @@ uint32_t __attribute__((export_name("TS_ClosureReason_clone"))) TS_ClosureReaso LDKClosureReason* orig_conv = (LDKClosureReason*)orig; LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16421,35 +16434,35 @@ uint32_t __attribute__((export_name("TS_ClosureReason_counterparty_force_closed LDKStr peer_msg_conv = str_ref_to_owned_c(peer_msg); LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_holder_force_closed"))) TS_ClosureReason_holder_force_closed() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_holder_force_closed(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_cooperative_closure"))) TS_ClosureReason_cooperative_closure() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_cooperative_closure(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_commitment_tx_confirmed"))) TS_ClosureReason_commitment_tx_confirmed() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_commitment_tx_confirmed(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_funding_timed_out"))) TS_ClosureReason_funding_timed_out() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_funding_timed_out(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16457,28 +16470,28 @@ uint32_t __attribute__((export_name("TS_ClosureReason_processing_error"))) TS_C LDKStr err_conv = str_ref_to_owned_c(err); LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_processing_error(err_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_disconnected_peer"))) TS_ClosureReason_disconnected_peer() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_disconnected_peer(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_outdated_channel_manager"))) TS_ClosureReason_outdated_channel_manager() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_outdated_channel_manager(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_ClosureReason_write"))) TS_ClosureReason_write(uint32_t obj) { LDKClosureReason* obj_conv = (LDKClosureReason*)obj; LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -16487,15 +16500,15 @@ int8_tArray __attribute__((export_name("TS_ClosureReason_write"))) TS_ClosureRe uint32_t __attribute__((export_name("TS_ClosureReason_read"))) TS_ClosureReason_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); *ret_conv = ClosureReason_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_Event_free"))) TS_Event_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -16505,12 +16518,12 @@ void __attribute__((export_name("TS_Event_free"))) TS_Event_free(uint32_t this_ static inline uintptr_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_Event_clone_ptr"))) TS_Event_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Event_clone_ptr"))) TS_Event_clone_ptr(uint32_t arg) { LDKEvent* arg_conv = (LDKEvent*)arg; - int64_t ret_val = Event_clone_ptr(arg_conv); + intptr_t ret_val = Event_clone_ptr(arg_conv); return ret_val; } @@ -16518,76 +16531,76 @@ uint32_t __attribute__((export_name("TS_Event_clone"))) TS_Event_clone(uint32_t LDKEvent* orig_conv = (LDKEvent*)orig; LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_funding_generation_ready"))) TS_Event_funding_generation_ready(int8_tArray temporary_channel_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) { LDKThirtyTwoBytes temporary_channel_id_ref; CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); + memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id); LDKCVec_u8Z output_script_ref; output_script_ref.datalen = output_script->arr_len; output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); + memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, channel_value_satoshis, output_script_ref, user_channel_id); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_payment_received"))) TS_Event_payment_received(int8_tArray payment_hash, int64_t amt, uint32_t purpose) { LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); - void* purpose_ptr = (void*)(((uint64_t)purpose) & ~1); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* purpose_ptr = (void*)(((uintptr_t)purpose) & ~1); CHECK_ACCESS(purpose_ptr); LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); - purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uint64_t)purpose) & ~1)); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uintptr_t)purpose) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_received(payment_hash_ref, amt, purpose_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_payment_sent"))) TS_Event_payment_sent(int8_tArray payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, uint32_t fee_paid_msat) { LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); - void* fee_paid_msat_ptr = (void*)(((uint64_t)fee_paid_msat) & ~1); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* fee_paid_msat_ptr = (void*)(((uintptr_t)fee_paid_msat) & ~1); CHECK_ACCESS(fee_paid_msat_ptr); LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); - fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_paid_msat) & ~1)); + fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)fee_paid_msat) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_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, uint32_t network_update, jboolean all_paths_failed, uint32_tArray path, uint32_t short_channel_id, uint32_t retry) { LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); - void* network_update_ptr = (void*)(((uint64_t)network_update) & ~1); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* network_update_ptr = (void*)(((uintptr_t)network_update) & ~1); CHECK_ACCESS(network_update_ptr); LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr); - network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)network_update) & ~1)); + network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uintptr_t)network_update) & ~1)); LDKCVec_RouteHopZ path_constr; path_constr.datalen = path->arr_len; if (path_constr.datalen > 0) path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else path_constr.data = NULL; - uint32_t* path_vals = path->elems; + uint32_t* path_vals = path->elems /* XXX path leaks */; for (size_t k = 0; k < path_constr.datalen; k++) { uint32_t path_conv_10 = path_vals[k]; LDKRouteHop path_conv_10_conv; @@ -16597,10 +16610,10 @@ uint32_t __attribute__((export_name("TS_Event_payment_path_failed"))) TS_Event_ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } - void* short_channel_id_ptr = (void*)(((uint64_t)short_channel_id) & ~1); + void* short_channel_id_ptr = (void*)(((uintptr_t)short_channel_id) & ~1); CHECK_ACCESS(short_channel_id_ptr); LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1)); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id) & ~1)); LDKRouteParameters retry_conv; retry_conv.inner = (void*)(retry & (~1)); retry_conv.is_owned = (retry & 1) || (retry == 0); @@ -16608,27 +16621,27 @@ uint32_t __attribute__((export_name("TS_Event_payment_path_failed"))) TS_Event_ retry_conv = RouteParameters_clone(&retry_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *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); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_payment_failed"))) TS_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash) { LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_pending_htlcs_forwardable"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) { LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16639,75 +16652,75 @@ uint32_t __attribute__((export_name("TS_Event_spendable_outputs"))) TS_Event_sp outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else outputs_constr.data = NULL; - uint32_t* outputs_vals = outputs->elems; + uint32_t* outputs_vals = outputs->elems /* XXX outputs leaks */; for (size_t b = 0; b < outputs_constr.datalen; b++) { uint32_t outputs_conv_27 = outputs_vals[b]; - void* outputs_conv_27_ptr = (void*)(((uint64_t)outputs_conv_27) & ~1); + void* outputs_conv_27_ptr = (void*)(((uintptr_t)outputs_conv_27) & ~1); CHECK_ACCESS(outputs_conv_27_ptr); LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); - outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1)); + outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)outputs_conv_27) & ~1)); outputs_constr.data[b] = outputs_conv_27_conv; } LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_spendable_outputs(outputs_constr); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_payment_forwarded"))) TS_Event_payment_forwarded(uint32_t fee_earned_msat, jboolean claim_from_onchain_tx) { - void* fee_earned_msat_ptr = (void*)(((uint64_t)fee_earned_msat) & ~1); + void* fee_earned_msat_ptr = (void*)(((uintptr_t)fee_earned_msat) & ~1); CHECK_ACCESS(fee_earned_msat_ptr); LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr); - fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_earned_msat) & ~1)); + fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)fee_earned_msat) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_forwarded(fee_earned_msat_conv, claim_from_onchain_tx); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_channel_closed"))) TS_Event_channel_closed(int8_tArray channel_id, int64_t user_channel_id, uint32_t reason) { LDKThirtyTwoBytes channel_id_ref; CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); - void* reason_ptr = (void*)(((uint64_t)reason) & ~1); + memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); + void* reason_ptr = (void*)(((uintptr_t)reason) & ~1); CHECK_ACCESS(reason_ptr); LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); - reason_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)reason) & ~1)); + reason_conv = ClosureReason_clone((LDKClosureReason*)(((uintptr_t)reason) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_discard_funding"))) TS_Event_discard_funding(int8_tArray channel_id, int8_tArray transaction) { LDKThirtyTwoBytes channel_id_ref; CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); + memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); LDKTransaction transaction_ref; transaction_ref.datalen = transaction->arr_len; transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); + memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction); transaction_ref.data_is_owned = true; LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_payment_path_successful"))) TS_Event_payment_path_successful(int8_tArray payment_id, int8_tArray payment_hash, uint32_tArray path) { LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKCVec_RouteHopZ path_constr; path_constr.datalen = path->arr_len; if (path_constr.datalen > 0) path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else path_constr.data = NULL; - uint32_t* path_vals = path->elems; + uint32_t* path_vals = path->elems /* XXX path leaks */; for (size_t k = 0; k < path_constr.datalen; k++) { uint32_t path_conv_10 = path_vals[k]; LDKRouteHop path_conv_10_conv; @@ -16719,14 +16732,14 @@ uint32_t __attribute__((export_name("TS_Event_payment_path_successful"))) TS_Ev } LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_Event_write"))) TS_Event_write(uint32_t obj) { LDKEvent* obj_conv = (LDKEvent*)obj; LDKCVec_u8Z ret_var = Event_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -16735,15 +16748,15 @@ int8_tArray __attribute__((export_name("TS_Event_write"))) TS_Event_write(uint3 uint32_t __attribute__((export_name("TS_Event_read"))) TS_Event_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); *ret_conv = Event_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_MessageSendEvent_free"))) TS_MessageSendEvent_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -16753,12 +16766,12 @@ void __attribute__((export_name("TS_MessageSendEvent_free"))) TS_MessageSendEve static inline uintptr_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_MessageSendEvent_clone_ptr"))) TS_MessageSendEvent_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_MessageSendEvent_clone_ptr"))) TS_MessageSendEvent_clone_ptr(uint32_t arg) { LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)arg; - int64_t ret_val = MessageSendEvent_clone_ptr(arg_conv); + intptr_t ret_val = MessageSendEvent_clone_ptr(arg_conv); return ret_val; } @@ -16766,14 +16779,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_clone"))) TS_MessageSe LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)orig; LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_accept_channel"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16781,14 +16794,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_accept_channel")) msg_conv = AcceptChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_open_channel"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16796,14 +16809,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_open_channel"))) msg_conv = OpenChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_created"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16811,14 +16824,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_created") msg_conv = FundingCreated_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_signed"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16826,14 +16839,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_signed")) msg_conv = FundingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_locked"))) TS_MessageSendEvent_send_funding_locked(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16841,14 +16854,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_locked")) msg_conv = FundingLocked_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_announcement_signatures"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16856,14 +16869,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_announcement_sign msg_conv = AnnouncementSignatures_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_update_htlcs"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint32_t updates) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKCommitmentUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = (updates & 1) || (updates == 0); @@ -16871,14 +16884,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_update_htlcs"))) TS_Me updates_conv = CommitmentUpdate_clone(&updates_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_revoke_and_ack"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16886,14 +16899,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_revoke_and_ack")) msg_conv = RevokeAndACK_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_closing_signed"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16901,14 +16914,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_closing_signed")) msg_conv = ClosingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_shutdown"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16916,14 +16929,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_shutdown"))) TS_M msg_conv = Shutdown_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_reestablish"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16931,7 +16944,7 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_reestabli msg_conv = ChannelReestablish_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16948,7 +16961,7 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_anno update_msg_conv = ChannelUpdate_clone(&update_msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16960,7 +16973,7 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_broadcast_node_announc msg_conv = NodeAnnouncement_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16972,14 +16985,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_upda msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_update"))) TS_MessageSendEvent_send_channel_update(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16987,28 +17000,28 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_update")) msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_handle_error"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint32_t action) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); - void* action_ptr = (void*)(((uint64_t)action) & ~1); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + void* action_ptr = (void*)(((uintptr_t)action) & ~1); CHECK_ACCESS(action_ptr); LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); - action_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action) & ~1)); + action_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)action) & ~1)); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_range_query"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -17016,14 +17029,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_range_que msg_conv = QueryChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_short_ids_query"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -17031,14 +17044,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_short_ids_query") msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_reply_channel_range"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -17046,13 +17059,13 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_reply_channel_ran msg_conv = ReplyChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_MessageSendEventsProvider_free"))) TS_MessageSendEventsProvider_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -17061,7 +17074,7 @@ void __attribute__((export_name("TS_MessageSendEventsProvider_free"))) TS_Messa void __attribute__((export_name("TS_EventsProvider_free"))) TS_EventsProvider_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -17070,7 +17083,7 @@ void __attribute__((export_name("TS_EventsProvider_free"))) TS_EventsProvider_f void __attribute__((export_name("TS_EventHandler_free"))) TS_EventHandler_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -17079,7 +17092,7 @@ void __attribute__((export_name("TS_EventHandler_free"))) TS_EventHandler_free( void __attribute__((export_name("TS_APIError_free"))) TS_APIError_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -17089,12 +17102,12 @@ void __attribute__((export_name("TS_APIError_free"))) TS_APIError_free(uint32_t static inline uintptr_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_APIError_clone_ptr"))) TS_APIError_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_APIError_clone_ptr"))) TS_APIError_clone_ptr(uint32_t arg) { LDKAPIError* arg_conv = (LDKAPIError*)arg; - int64_t ret_val = APIError_clone_ptr(arg_conv); + intptr_t ret_val = APIError_clone_ptr(arg_conv); return ret_val; } @@ -17102,7 +17115,7 @@ uint32_t __attribute__((export_name("TS_APIError_clone"))) TS_APIError_clone(ui LDKAPIError* orig_conv = (LDKAPIError*)orig; LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -17110,7 +17123,7 @@ uint32_t __attribute__((export_name("TS_APIError_apimisuse_error"))) TS_APIErro LDKStr err_conv = str_ref_to_owned_c(err); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_apimisuse_error(err_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -17118,7 +17131,7 @@ uint32_t __attribute__((export_name("TS_APIError_fee_rate_too_high"))) TS_APIEr LDKStr err_conv = str_ref_to_owned_c(err); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -17126,7 +17139,7 @@ uint32_t __attribute__((export_name("TS_APIError_route_error"))) TS_APIError_ro LDKStr err_conv = str_ref_to_owned_c(err); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_route_error(err_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -17134,14 +17147,14 @@ uint32_t __attribute__((export_name("TS_APIError_channel_unavailable"))) TS_API LDKStr err_conv = str_ref_to_owned_c(err); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_channel_unavailable(err_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_APIError_monitor_update_failed"))) TS_APIError_monitor_update_failed() { LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_monitor_update_failed(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -17153,41 +17166,41 @@ uint32_t __attribute__((export_name("TS_APIError_incompatible_shutdown_script") script_conv = ShutdownScript_clone(&script_conv); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_incompatible_shutdown_script(script_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_sign"))) TS_sign(int8_tArray msg, int8_tArray sk) { LDKu8slice msg_ref; msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; + msg_ref.data = msg->elems /* XXX msg leaks */; unsigned char sk_arr[32]; CHECK(sk->arr_len == 32); - memcpy(sk_arr, sk->elems, 32); + memcpy(sk_arr, sk->elems, 32); FREE(sk); unsigned char (*sk_ref)[32] = &sk_arr; LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); *ret_conv = sign(msg_ref, sk_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_recover_pk"))) TS_recover_pk(int8_tArray msg, jstring sig) { LDKu8slice msg_ref; msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; + msg_ref.data = msg->elems /* XXX msg leaks */; LDKStr sig_conv = str_ref_to_owned_c(sig); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = recover_pk(msg_ref, sig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_verify"))) TS_verify(int8_tArray msg, jstring sig, int8_tArray pk) { LDKu8slice msg_ref; msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; + msg_ref.data = msg->elems /* XXX msg leaks */; LDKStr sig_conv = str_ref_to_owned_c(sig); LDKPublicKey pk_ref; CHECK(pk->arr_len == 33); - memcpy(pk_ref.compressed_form, pk->elems, 33); + memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk); jboolean ret_val = verify(msg_ref, sig_conv, pk_ref); return ret_val; } @@ -17351,22 +17364,22 @@ void __attribute__((export_name("TS_Record_set_line"))) TS_Record_set_line(uint static inline uintptr_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { LDKRecord ret_var = Record_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Record_clone_ptr"))) TS_Record_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Record_clone_ptr"))) TS_Record_clone_ptr(uint32_t arg) { LDKRecord arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Record_clone_ptr(&arg_conv); + intptr_t ret_val = Record_clone_ptr(&arg_conv); return ret_val; } @@ -17376,11 +17389,11 @@ uint32_t __attribute__((export_name("TS_Record_clone"))) TS_Record_clone(uint32 orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRecord ret_var = Record_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17389,7 +17402,7 @@ uint32_t __attribute__((export_name("TS_Record_clone"))) TS_Record_clone(uint32 void __attribute__((export_name("TS_Logger_free"))) TS_Logger_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -17457,11 +17470,11 @@ void __attribute__((export_name("TS_ChannelHandshakeConfig_set_our_htlc_minimum uint32_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) { LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17470,22 +17483,22 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeConfig_new"))) TS_Chann static inline uintptr_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone_ptr"))) TS_ChannelHandshakeConfig_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone_ptr"))) TS_ChannelHandshakeConfig_clone_ptr(uint32_t arg) { LDKChannelHandshakeConfig arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelHandshakeConfig_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelHandshakeConfig_clone_ptr(&arg_conv); return ret_val; } @@ -17495,11 +17508,11 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone"))) TS_Cha orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17508,11 +17521,11 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone"))) TS_Cha uint32_t __attribute__((export_name("TS_ChannelHandshakeConfig_default"))) TS_ChannelHandshakeConfig_default() { LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17665,11 +17678,11 @@ void __attribute__((export_name("TS_ChannelHandshakeLimits_set_their_to_self_de uint32_t __attribute__((export_name("TS_ChannelHandshakeLimits_new"))) TS_ChannelHandshakeLimits_new(int64_t min_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 force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_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, force_announced_channel_preference_arg, their_to_self_delay_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17678,22 +17691,22 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeLimits_new"))) TS_Chann static inline uintptr_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone_ptr"))) TS_ChannelHandshakeLimits_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone_ptr"))) TS_ChannelHandshakeLimits_clone_ptr(uint32_t arg) { LDKChannelHandshakeLimits arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelHandshakeLimits_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelHandshakeLimits_clone_ptr(&arg_conv); return ret_val; } @@ -17703,11 +17716,11 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone"))) TS_Cha orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17716,11 +17729,11 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone"))) TS_Cha uint32_t __attribute__((export_name("TS_ChannelHandshakeLimits_default"))) TS_ChannelHandshakeLimits_default() { LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17856,11 +17869,11 @@ void __attribute__((export_name("TS_ChannelConfig_set_force_close_avoidance_max uint32_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, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) { LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17869,22 +17882,22 @@ uint32_t __attribute__((export_name("TS_ChannelConfig_new"))) TS_ChannelConfig_ static inline uintptr_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { LDKChannelConfig ret_var = ChannelConfig_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelConfig_clone_ptr"))) TS_ChannelConfig_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelConfig_clone_ptr"))) TS_ChannelConfig_clone_ptr(uint32_t arg) { LDKChannelConfig arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelConfig_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelConfig_clone_ptr(&arg_conv); return ret_val; } @@ -17894,11 +17907,11 @@ uint32_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfi orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17907,11 +17920,11 @@ uint32_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfi uint32_t __attribute__((export_name("TS_ChannelConfig_default"))) TS_ChannelConfig_default() { LDKChannelConfig ret_var = ChannelConfig_default(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17924,7 +17937,7 @@ int8_tArray __attribute__((export_name("TS_ChannelConfig_write"))) TS_ChannelCo obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -17933,10 +17946,10 @@ int8_tArray __attribute__((export_name("TS_ChannelConfig_write"))) TS_ChannelCo uint32_t __attribute__((export_name("TS_ChannelConfig_read"))) TS_ChannelConfig_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = ChannelConfig_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_UserConfig_free"))) TS_UserConfig_free(uint32_t this_obj) { @@ -17953,11 +17966,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_get_own_channel_config"))) T this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17983,11 +17996,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_get_peer_channel_config_limi this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18013,11 +18026,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_get_channel_options"))) TS_U this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18088,11 +18101,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_new"))) TS_UserConfig_new(ui CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv); channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18101,22 +18114,22 @@ uint32_t __attribute__((export_name("TS_UserConfig_new"))) TS_UserConfig_new(ui static inline uintptr_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { LDKUserConfig ret_var = UserConfig_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UserConfig_clone_ptr"))) TS_UserConfig_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UserConfig_clone_ptr"))) TS_UserConfig_clone_ptr(uint32_t arg) { LDKUserConfig arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UserConfig_clone_ptr(&arg_conv); + intptr_t ret_val = UserConfig_clone_ptr(&arg_conv); return ret_val; } @@ -18126,11 +18139,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_clone"))) TS_UserConfig_clon orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUserConfig ret_var = UserConfig_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18139,11 +18152,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_clone"))) TS_UserConfig_clon uint32_t __attribute__((export_name("TS_UserConfig_default"))) TS_UserConfig_default() { LDKUserConfig ret_var = UserConfig_default(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18160,22 +18173,22 @@ void __attribute__((export_name("TS_BestBlock_free"))) TS_BestBlock_free(uint32 static inline uintptr_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { LDKBestBlock ret_var = BestBlock_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_BestBlock_clone_ptr"))) TS_BestBlock_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_BestBlock_clone_ptr"))) TS_BestBlock_clone_ptr(uint32_t arg) { LDKBestBlock arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = BestBlock_clone_ptr(&arg_conv); + intptr_t ret_val = BestBlock_clone_ptr(&arg_conv); return ret_val; } @@ -18185,11 +18198,11 @@ uint32_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone( orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBestBlock ret_var = BestBlock_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18199,11 +18212,11 @@ uint32_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone( uint32_t __attribute__((export_name("TS_BestBlock_from_genesis"))) TS_BestBlock_from_genesis(uint32_t network) { LDKNetwork network_conv = LDKNetwork_from_js(network); LDKBestBlock ret_var = BestBlock_from_genesis(network_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18213,13 +18226,13 @@ uint32_t __attribute__((export_name("TS_BestBlock_from_genesis"))) TS_BestBlock uint32_t __attribute__((export_name("TS_BestBlock_new"))) TS_BestBlock_new(int8_tArray block_hash, int32_t height) { LDKThirtyTwoBytes block_hash_ref; CHECK(block_hash->arr_len == 32); - memcpy(block_hash_ref.data, block_hash->elems, 32); + memcpy(block_hash_ref.data, block_hash->elems, 32); FREE(block_hash); LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18231,7 +18244,7 @@ int8_tArray __attribute__((export_name("TS_BestBlock_block_hash"))) TS_BestBloc this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, BestBlock_block_hash(&this_arg_conv).data, 32); return ret_arr; } @@ -18263,7 +18276,7 @@ uint32_t __attribute__((export_name("TS_AccessError_unknown_tx"))) TS_AccessErr void __attribute__((export_name("TS_Access_free"))) TS_Access_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18272,7 +18285,7 @@ void __attribute__((export_name("TS_Access_free"))) TS_Access_free(uint32_t thi void __attribute__((export_name("TS_Listen_free"))) TS_Listen_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18281,7 +18294,7 @@ void __attribute__((export_name("TS_Listen_free"))) TS_Listen_free(uint32_t thi void __attribute__((export_name("TS_Confirm_free"))) TS_Confirm_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18306,7 +18319,7 @@ uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_permanent_failu void __attribute__((export_name("TS_Watch_free"))) TS_Watch_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18315,7 +18328,7 @@ void __attribute__((export_name("TS_Watch_free"))) TS_Watch_free(uint32_t this_ void __attribute__((export_name("TS_Filter_free"))) TS_Filter_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18335,7 +18348,7 @@ int8_tArray __attribute__((export_name("TS_WatchedOutput_get_block_hash"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, WatchedOutput_get_block_hash(&this_ptr_conv).data, 32); return ret_arr; } @@ -18347,7 +18360,7 @@ void __attribute__((export_name("TS_WatchedOutput_set_block_hash"))) TS_Watched CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); WatchedOutput_set_block_hash(&this_ptr_conv, val_ref); } @@ -18357,11 +18370,11 @@ uint32_t __attribute__((export_name("TS_WatchedOutput_get_outpoint"))) TS_Watch this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18387,7 +18400,7 @@ int8_tArray __attribute__((export_name("TS_WatchedOutput_get_script_pubkey"))) this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -18400,14 +18413,14 @@ void __attribute__((export_name("TS_WatchedOutput_set_script_pubkey"))) TS_Watc LDKCVec_u8Z val_ref; val_ref.datalen = val->arr_len; val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); } uint32_t __attribute__((export_name("TS_WatchedOutput_new"))) TS_WatchedOutput_new(int8_tArray block_hash_arg, uint32_t outpoint_arg, int8_tArray script_pubkey_arg) { LDKThirtyTwoBytes block_hash_arg_ref; CHECK(block_hash_arg->arr_len == 32); - memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); + memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg); LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); @@ -18416,13 +18429,13 @@ uint32_t __attribute__((export_name("TS_WatchedOutput_new"))) TS_WatchedOutput_ LDKCVec_u8Z script_pubkey_arg_ref; script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len; script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); + memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg); LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18431,22 +18444,22 @@ uint32_t __attribute__((export_name("TS_WatchedOutput_new"))) TS_WatchedOutput_ static inline uintptr_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { LDKWatchedOutput ret_var = WatchedOutput_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_WatchedOutput_clone_ptr"))) TS_WatchedOutput_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_WatchedOutput_clone_ptr"))) TS_WatchedOutput_clone_ptr(uint32_t arg) { LDKWatchedOutput arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = WatchedOutput_clone_ptr(&arg_conv); + intptr_t ret_val = WatchedOutput_clone_ptr(&arg_conv); return ret_val; } @@ -18456,11 +18469,11 @@ uint32_t __attribute__((export_name("TS_WatchedOutput_clone"))) TS_WatchedOutpu orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18478,7 +18491,7 @@ int64_t __attribute__((export_name("TS_WatchedOutput_hash"))) TS_WatchedOutput_ void __attribute__((export_name("TS_BroadcasterInterface_free"))) TS_BroadcasterInterface_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18515,7 +18528,7 @@ jboolean __attribute__((export_name("TS_ConfirmationTarget_eq"))) TS_Confirmati void __attribute__((export_name("TS_FeeEstimator_free"))) TS_FeeEstimator_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18532,22 +18545,22 @@ void __attribute__((export_name("TS_MonitorUpdateId_free"))) TS_MonitorUpdateId static inline uintptr_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_MonitorUpdateId_clone_ptr"))) TS_MonitorUpdateId_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_MonitorUpdateId_clone_ptr"))) TS_MonitorUpdateId_clone_ptr(uint32_t arg) { LDKMonitorUpdateId arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = MonitorUpdateId_clone_ptr(&arg_conv); + intptr_t ret_val = MonitorUpdateId_clone_ptr(&arg_conv); return ret_val; } @@ -18557,11 +18570,11 @@ uint32_t __attribute__((export_name("TS_MonitorUpdateId_clone"))) TS_MonitorUpd orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18592,7 +18605,7 @@ jboolean __attribute__((export_name("TS_MonitorUpdateId_eq"))) TS_MonitorUpdate void __attribute__((export_name("TS_Persist_free"))) TS_Persist_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18616,31 +18629,31 @@ void __attribute__((export_name("TS_ChainMonitor_free"))) TS_ChainMonitor_free( } uint32_t __attribute__((export_name("TS_ChainMonitor_new"))) TS_ChainMonitor_new(uint32_t chain_source, uint32_t broadcaster, uint32_t logger, uint32_t feeest, uint32_t persister) { - void* chain_source_ptr = (void*)(((uint64_t)chain_source) & ~1); + void* chain_source_ptr = (void*)(((uintptr_t)chain_source) & ~1); CHECK_ACCESS(chain_source_ptr); LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); // Warning: we may need a move here but no clone is available for LDKCOption_FilterZ if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { // Manually implement clone for Java trait instances } - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - void* feeest_ptr = (void*)(((uint64_t)feeest) & ~1); + void* feeest_ptr = (void*)(((uintptr_t)feeest) & ~1); CHECK_ACCESS(feeest_ptr); LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); - void* persister_ptr = (void*)(((uint64_t)persister) & ~1); + void* persister_ptr = (void*)(((uintptr_t)persister) & ~1); CHECK_ACCESS(persister_ptr); LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18658,7 +18671,7 @@ uint32_tArray __attribute__((export_name("TS_ChainMonitor_get_claimable_balance ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); else ignored_channels_constr.data = NULL; - uint32_t* ignored_channels_vals = ignored_channels->elems; + uint32_t* ignored_channels_vals = ignored_channels->elems /* XXX ignored_channels leaks */; for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { uint32_t ignored_channels_conv_16 = ignored_channels_vals[q]; LDKChannelDetails ignored_channels_conv_16_conv; @@ -18670,12 +18683,12 @@ uint32_tArray __attribute__((export_name("TS_ChainMonitor_get_claimable_balance } LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t j = 0; j < ret_var.datalen; j++) { LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_conv_9_copy = ret_var.data[j]; - uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy; + uintptr_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; ret_arr_ptr[j] = ret_conv_9_ref; } @@ -18695,7 +18708,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_get_monitor"))) TS_ChainMo funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_tArray __attribute__((export_name("TS_ChainMonitor_list_monitors"))) TS_ChainMonitor_list_monitors(uint32_t this_arg) { @@ -18705,15 +18718,15 @@ uint32_tArray __attribute__((export_name("TS_ChainMonitor_list_monitors"))) TS_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t k = 0; k < ret_var.datalen; k++) { LDKOutPoint ret_conv_10_var = ret_var.data[k]; - uint64_t ret_conv_10_ref = 0; - CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_10_ref = 0; + CHECK((((uintptr_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); - ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner; + ret_conv_10_ref = (uintptr_t)ret_conv_10_var.inner; if (ret_conv_10_var.is_owned) { ret_conv_10_ref |= 1; } @@ -18741,7 +18754,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_channel_monitor_updated")) completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChainMonitor_as_Listen"))) TS_ChainMonitor_as_Listen(uint32_t this_arg) { @@ -18751,7 +18764,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_as_Listen"))) TS_ChainMoni CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChainMonitor_as_Confirm"))) TS_ChainMonitor_as_Confirm(uint32_t this_arg) { @@ -18761,7 +18774,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_as_Confirm"))) TS_ChainMon CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChainMonitor_as_Watch"))) TS_ChainMonitor_as_Watch(uint32_t this_arg) { @@ -18771,7 +18784,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_as_Watch"))) TS_ChainMonit CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChainMonitor_as_EventsProvider"))) TS_ChainMonitor_as_EventsProvider(uint32_t this_arg) { @@ -18781,7 +18794,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_as_EventsProvider"))) TS_C CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_ChannelMonitorUpdate_free"))) TS_ChannelMonitorUpdate_free(uint32_t this_obj) { @@ -18811,22 +18824,22 @@ void __attribute__((export_name("TS_ChannelMonitorUpdate_set_update_id"))) TS_C static inline uintptr_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone_ptr"))) TS_ChannelMonitorUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone_ptr"))) TS_ChannelMonitorUpdate_clone_ptr(uint32_t arg) { LDKChannelMonitorUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelMonitorUpdate_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelMonitorUpdate_clone_ptr(&arg_conv); return ret_val; } @@ -18836,11 +18849,11 @@ uint32_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone"))) TS_Chann orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18853,7 +18866,7 @@ int8_tArray __attribute__((export_name("TS_ChannelMonitorUpdate_write"))) TS_Ch obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -18862,15 +18875,15 @@ int8_tArray __attribute__((export_name("TS_ChannelMonitorUpdate_write"))) TS_Ch uint32_t __attribute__((export_name("TS_ChannelMonitorUpdate_read"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = ChannelMonitorUpdate_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_MonitorEvent_free"))) TS_MonitorEvent_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18880,12 +18893,12 @@ void __attribute__((export_name("TS_MonitorEvent_free"))) TS_MonitorEvent_free( static inline uintptr_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_MonitorEvent_clone_ptr"))) TS_MonitorEvent_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_MonitorEvent_clone_ptr"))) TS_MonitorEvent_clone_ptr(uint32_t arg) { LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg; - int64_t ret_val = MonitorEvent_clone_ptr(arg_conv); + intptr_t ret_val = MonitorEvent_clone_ptr(arg_conv); return ret_val; } @@ -18893,7 +18906,7 @@ uint32_t __attribute__((export_name("TS_MonitorEvent_clone"))) TS_MonitorEvent_ LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig; LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -18905,7 +18918,7 @@ uint32_t __attribute__((export_name("TS_MonitorEvent_htlcevent"))) TS_MonitorEv a_conv = HTLCUpdate_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_htlcevent(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -18917,7 +18930,7 @@ uint32_t __attribute__((export_name("TS_MonitorEvent_commitment_tx_confirmed")) a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -18929,7 +18942,7 @@ uint32_t __attribute__((export_name("TS_MonitorEvent_update_completed"))) TS_Mo funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -18941,14 +18954,14 @@ uint32_t __attribute__((export_name("TS_MonitorEvent_update_failed"))) TS_Monit a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_failed(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEvent_write(uint32_t obj) { LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)obj; LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -18957,10 +18970,10 @@ int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEve uint32_t __attribute__((export_name("TS_MonitorEvent_read"))) TS_MonitorEvent_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); *ret_conv = MonitorEvent_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_HTLCUpdate_free"))) TS_HTLCUpdate_free(uint32_t this_obj) { @@ -18973,22 +18986,22 @@ void __attribute__((export_name("TS_HTLCUpdate_free"))) TS_HTLCUpdate_free(uint static inline uintptr_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_HTLCUpdate_clone_ptr"))) TS_HTLCUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_HTLCUpdate_clone_ptr"))) TS_HTLCUpdate_clone_ptr(uint32_t arg) { LDKHTLCUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = HTLCUpdate_clone_ptr(&arg_conv); + intptr_t ret_val = HTLCUpdate_clone_ptr(&arg_conv); return ret_val; } @@ -18998,11 +19011,11 @@ uint32_t __attribute__((export_name("TS_HTLCUpdate_clone"))) TS_HTLCUpdate_clon orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19015,7 +19028,7 @@ int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_w obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -19024,15 +19037,15 @@ int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_w uint32_t __attribute__((export_name("TS_HTLCUpdate_read"))) TS_HTLCUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = HTLCUpdate_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_Balance_free"))) TS_Balance_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -19042,12 +19055,12 @@ void __attribute__((export_name("TS_Balance_free"))) TS_Balance_free(uint32_t t static inline uintptr_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_Balance_clone_ptr"))) TS_Balance_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Balance_clone_ptr"))) TS_Balance_clone_ptr(uint32_t arg) { LDKBalance* arg_conv = (LDKBalance*)arg; - int64_t ret_val = Balance_clone_ptr(arg_conv); + intptr_t ret_val = Balance_clone_ptr(arg_conv); return ret_val; } @@ -19055,35 +19068,35 @@ uint32_t __attribute__((export_name("TS_Balance_clone"))) TS_Balance_clone(uint LDKBalance* orig_conv = (LDKBalance*)orig; LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Balance_claimable_on_channel_close"))) TS_Balance_claimable_on_channel_close(int64_t claimable_amount_satoshis) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Balance_claimable_awaiting_confirmations"))) TS_Balance_claimable_awaiting_confirmations(int64_t claimable_amount_satoshis, int32_t confirmation_height) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Balance_contentious_claimable"))) TS_Balance_contentious_claimable(int64_t claimable_amount_satoshis, int32_t timeout_height) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_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) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -19104,22 +19117,22 @@ void __attribute__((export_name("TS_ChannelMonitor_free"))) TS_ChannelMonitor_f static inline uintptr_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelMonitor_clone_ptr"))) TS_ChannelMonitor_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelMonitor_clone_ptr"))) TS_ChannelMonitor_clone_ptr(uint32_t arg) { LDKChannelMonitor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelMonitor_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelMonitor_clone_ptr(&arg_conv); return ret_val; } @@ -19129,11 +19142,11 @@ uint32_t __attribute__((export_name("TS_ChannelMonitor_clone"))) TS_ChannelMoni orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19146,7 +19159,7 @@ int8_tArray __attribute__((export_name("TS_ChannelMonitor_write"))) TS_ChannelM obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -19161,18 +19174,18 @@ uint32_t __attribute__((export_name("TS_ChannelMonitor_update_monitor"))) TS_Ch updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); } LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); if (!(fee_estimator & 1)) { CHECK_ACCESS(fee_estimator_ptr); } LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int64_t __attribute__((export_name("TS_ChannelMonitor_get_latest_update_id"))) TS_ChannelMonitor_get_latest_update_id(uint32_t this_arg) { @@ -19191,7 +19204,7 @@ uint32_t __attribute__((export_name("TS_ChannelMonitor_get_funding_txo"))) TS_C CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_outputs_to_watch"))) TS_ChannelMonitor_get_outputs_to_watch(uint32_t this_arg) { @@ -19201,12 +19214,12 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_outputs_to_watc CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t o = 0; o < ret_var.datalen; o++) { LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); *ret_conv_40_conv = ret_var.data[o]; - ret_arr_ptr[o] = ((uint64_t)ret_conv_40_conv); + ret_arr_ptr[o] = ((uintptr_t)ret_conv_40_conv); } FREE(ret_var.data); @@ -19218,7 +19231,7 @@ void __attribute__((export_name("TS_ChannelMonitor_load_outputs_to_watch"))) TS this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* filter_ptr = (void*)(((uint64_t)filter) & ~1); + void* filter_ptr = (void*)(((uintptr_t)filter) & ~1); if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); } LDKFilter* filter_conv = (LDKFilter*)filter_ptr; ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv); @@ -19231,12 +19244,12 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pendi CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t o = 0; o < ret_var.datalen; o++) { LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_conv_14_copy = ret_var.data[o]; - uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy; + uintptr_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; ret_arr_ptr[o] = ret_conv_14_ref; } @@ -19251,12 +19264,12 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pendi CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t h = 0; h < ret_var.datalen; h++) { LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_conv_7_copy = ret_var.data[h]; - uint64_t ret_conv_7_ref = (uint64_t)ret_conv_7_copy; + uintptr_t ret_conv_7_ref = (uintptr_t)ret_conv_7_copy; ret_arr_ptr[h] = ret_conv_7_ref; } @@ -19269,16 +19282,16 @@ ptrArray __attribute__((export_name("TS_ChannelMonitor_get_latest_holder_commit this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { LDKTransaction ret_conv_12_var = ret_var.data[m]; - int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen); + int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__); memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen); Transaction_free(ret_conv_12_var); ret_arr_ptr[m] = ret_conv_12_arr; @@ -19295,7 +19308,7 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_block_connected"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; txdata_constr.datalen = txdata->arr_len; @@ -19303,32 +19316,32 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_block_connected"))) txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); else txdata_constr.data = NULL; - uint32_t* txdata_vals = txdata->elems; + uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */; for (size_t c = 0; c < txdata_constr.datalen; c++) { uint32_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1); + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); CHECK_ACCESS(txdata_conv_28_ptr); LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1)); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); txdata_constr.data[c] = txdata_conv_28_conv; } - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); 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); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t n = 0; n < ret_var.datalen; n++) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv); + ret_arr_ptr[n] = ((uintptr_t)ret_conv_39_conv); } FREE(ret_var.data); @@ -19342,15 +19355,15 @@ void __attribute__((export_name("TS_ChannelMonitor_block_disconnected"))) TS_Ch CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); @@ -19363,7 +19376,7 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_transactions_confir CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; txdata_constr.datalen = txdata->arr_len; @@ -19371,32 +19384,32 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_transactions_confir txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); else txdata_constr.data = NULL; - uint32_t* txdata_vals = txdata->elems; + uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */; for (size_t c = 0; c < txdata_constr.datalen; c++) { uint32_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1); + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); CHECK_ACCESS(txdata_conv_28_ptr); LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1)); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); txdata_constr.data[c] = txdata_conv_28_conv; } - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); 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); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t n = 0; n < ret_var.datalen; n++) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv); + ret_arr_ptr[n] = ((uintptr_t)ret_conv_39_conv); } FREE(ret_var.data); @@ -19410,15 +19423,15 @@ void __attribute__((export_name("TS_ChannelMonitor_transaction_unconfirmed"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char txid_arr[32]; CHECK(txid->arr_len == 32); - memcpy(txid_arr, txid->elems, 32); + memcpy(txid_arr, txid->elems, 32); FREE(txid); unsigned char (*txid_ref)[32] = &txid_arr; - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); @@ -19431,25 +19444,25 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_best_block_updated" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t n = 0; n < ret_var.datalen; n++) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv); + ret_arr_ptr[n] = ((uintptr_t)ret_conv_39_conv); } FREE(ret_var.data); @@ -19463,10 +19476,10 @@ ptrArray __attribute__((export_name("TS_ChannelMonitor_get_relevant_txids"))) T CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { - int8_tArray ret_conv_12_arr = init_int8_tArray(32); + int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__); memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32); ret_arr_ptr[m] = ret_conv_12_arr; } @@ -19481,11 +19494,11 @@ uint32_t __attribute__((export_name("TS_ChannelMonitor_current_best_block"))) T this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19499,12 +19512,12 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_claimable_balan CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t j = 0; j < ret_var.datalen; j++) { LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_conv_9_copy = ret_var.data[j]; - uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy; + uintptr_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; ret_arr_ptr[j] = ret_conv_9_ref; } @@ -19515,13 +19528,13 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_claimable_balan uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_read"))) TS_C2Tuple_BlockHashChannelMonitorZ_read(int8_tArray ser, uint32_t arg) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + ser_ref.data = ser->elems /* XXX ser leaks */; + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr; LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_OutPoint_free"))) TS_OutPoint_free(uint32_t this_obj) { @@ -19537,7 +19550,7 @@ int8_tArray __attribute__((export_name("TS_OutPoint_get_txid"))) TS_OutPoint_ge this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *OutPoint_get_txid(&this_ptr_conv), 32); return ret_arr; } @@ -19549,7 +19562,7 @@ void __attribute__((export_name("TS_OutPoint_set_txid"))) TS_OutPoint_set_txid( CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); OutPoint_set_txid(&this_ptr_conv, val_ref); } @@ -19573,13 +19586,13 @@ void __attribute__((export_name("TS_OutPoint_set_index"))) TS_OutPoint_set_inde uint32_t __attribute__((export_name("TS_OutPoint_new"))) TS_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) { LDKThirtyTwoBytes txid_arg_ref; CHECK(txid_arg->arr_len == 32); - memcpy(txid_arg_ref.data, txid_arg->elems, 32); + memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19588,22 +19601,22 @@ uint32_t __attribute__((export_name("TS_OutPoint_new"))) TS_OutPoint_new(int8_t static inline uintptr_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { LDKOutPoint ret_var = OutPoint_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_OutPoint_clone_ptr"))) TS_OutPoint_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_OutPoint_clone_ptr"))) TS_OutPoint_clone_ptr(uint32_t arg) { LDKOutPoint arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = OutPoint_clone_ptr(&arg_conv); + intptr_t ret_val = OutPoint_clone_ptr(&arg_conv); return ret_val; } @@ -19613,11 +19626,11 @@ uint32_t __attribute__((export_name("TS_OutPoint_clone"))) TS_OutPoint_clone(ui orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOutPoint ret_var = OutPoint_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19651,7 +19664,7 @@ int8_tArray __attribute__((export_name("TS_OutPoint_to_channel_id"))) TS_OutPoi this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, OutPoint_to_channel_id(&this_arg_conv).data, 32); return ret_arr; } @@ -19662,7 +19675,7 @@ int8_tArray __attribute__((export_name("TS_OutPoint_write"))) TS_OutPoint_write obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -19671,10 +19684,10 @@ int8_tArray __attribute__((export_name("TS_OutPoint_write"))) TS_OutPoint_write uint32_t __attribute__((export_name("TS_OutPoint_read"))) TS_OutPoint_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = OutPoint_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_free"))) TS_DelayedPaymentOutputDescriptor_free(uint32_t this_obj) { @@ -19691,11 +19704,11 @@ uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_outp this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19720,7 +19733,7 @@ int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_p this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -19732,7 +19745,7 @@ void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_per_comm CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); } @@ -19758,10 +19771,10 @@ void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_output") this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1)); + val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } @@ -19770,7 +19783,7 @@ int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_r this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -19782,7 +19795,7 @@ void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_revocati CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref); } @@ -19791,7 +19804,7 @@ int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_c this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); return ret_arr; } @@ -19803,7 +19816,7 @@ void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } @@ -19832,23 +19845,23 @@ uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_new"))) outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKPublicKey per_commitment_point_arg_ref; CHECK(per_commitment_point_arg->arr_len == 33); - memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); - void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1); + memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg); + void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); CHECK_ACCESS(output_arg_ptr); LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1)); + output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); LDKPublicKey revocation_pubkey_arg_ref; CHECK(revocation_pubkey_arg->arr_len == 33); - memcpy(revocation_pubkey_arg_ref.compressed_form, revocation_pubkey_arg->elems, 33); + memcpy(revocation_pubkey_arg_ref.compressed_form, revocation_pubkey_arg->elems, 33); FREE(revocation_pubkey_arg); LDKThirtyTwoBytes channel_keys_id_arg_ref; CHECK(channel_keys_id_arg->arr_len == 32); - memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); + memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19857,22 +19870,22 @@ uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_new"))) static inline uintptr_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone_ptr"))) TS_DelayedPaymentOutputDescriptor_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone_ptr"))) TS_DelayedPaymentOutputDescriptor_clone_ptr(uint32_t arg) { LDKDelayedPaymentOutputDescriptor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); + intptr_t ret_val = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_val; } @@ -19882,11 +19895,11 @@ uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone")) orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19899,7 +19912,7 @@ int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_write obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -19908,10 +19921,10 @@ int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_write uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_read"))) TS_DelayedPaymentOutputDescriptor_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_free"))) TS_StaticPaymentOutputDescriptor_free(uint32_t this_obj) { @@ -19928,11 +19941,11 @@ uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_outpo this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19957,10 +19970,10 @@ void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_output")) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1)); + val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } @@ -19969,7 +19982,7 @@ int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_ch this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); return ret_arr; } @@ -19981,7 +19994,7 @@ void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_k CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } @@ -20008,19 +20021,19 @@ uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_new"))) T outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1); + void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); CHECK_ACCESS(output_arg_ptr); LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1)); + output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); LDKThirtyTwoBytes channel_keys_id_arg_ref; CHECK(channel_keys_id_arg->arr_len == 32); - memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); + memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg); LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20029,22 +20042,22 @@ uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_new"))) T static inline uintptr_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone_ptr"))) TS_StaticPaymentOutputDescriptor_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone_ptr"))) TS_StaticPaymentOutputDescriptor_clone_ptr(uint32_t arg) { LDKStaticPaymentOutputDescriptor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + intptr_t ret_val = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_val; } @@ -20054,11 +20067,11 @@ uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone"))) orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20071,7 +20084,7 @@ int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_write" obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -20080,15 +20093,15 @@ int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_write" uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_read"))) TS_StaticPaymentOutputDescriptor_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_SpendableOutputDescriptor_free"))) TS_SpendableOutputDescriptor_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -20098,12 +20111,12 @@ void __attribute__((export_name("TS_SpendableOutputDescriptor_free"))) TS_Spend static inline uintptr_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone_ptr"))) TS_SpendableOutputDescriptor_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone_ptr"))) TS_SpendableOutputDescriptor_clone_ptr(uint32_t arg) { LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg; - int64_t ret_val = SpendableOutputDescriptor_clone_ptr(arg_conv); + intptr_t ret_val = SpendableOutputDescriptor_clone_ptr(arg_conv); return ret_val; } @@ -20111,7 +20124,7 @@ uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone"))) TS_ LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig; LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -20121,13 +20134,13 @@ uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_output outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); outpoint_conv = OutPoint_clone(&outpoint_conv); - void* output_ptr = (void*)(((uint64_t)output) & ~1); + void* output_ptr = (void*)(((uintptr_t)output) & ~1); CHECK_ACCESS(output_ptr); LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); - output_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output) & ~1)); + output_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output) & ~1)); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -20139,7 +20152,7 @@ uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_delayed_payme a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -20151,14 +20164,14 @@ uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_paymen a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_SpendableOutputDescriptor_write"))) TS_SpendableOutputDescriptor_write(uint32_t obj) { LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj; LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -20167,15 +20180,15 @@ int8_tArray __attribute__((export_name("TS_SpendableOutputDescriptor_write"))) uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_read"))) TS_SpendableOutputDescriptor_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = SpendableOutputDescriptor_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_BaseSign_free"))) TS_BaseSign_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -20185,28 +20198,28 @@ void __attribute__((export_name("TS_BaseSign_free"))) TS_BaseSign_free(uint32_t static inline uintptr_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) { LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = Sign_clone(arg); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } -int64_t __attribute__((export_name("TS_Sign_clone_ptr"))) TS_Sign_clone_ptr(uint32_t arg) { - void* arg_ptr = (void*)(((uint64_t)arg) & ~1); +intptr_t __attribute__((export_name("TS_Sign_clone_ptr"))) TS_Sign_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } LDKSign* arg_conv = (LDKSign*)arg_ptr; - int64_t ret_val = Sign_clone_ptr(arg_conv); + intptr_t ret_val = Sign_clone_ptr(arg_conv); return ret_val; } uint32_t __attribute__((export_name("TS_Sign_clone"))) TS_Sign_clone(uint32_t orig) { - void* orig_ptr = (void*)(((uint64_t)orig) & ~1); + void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } LDKSign* orig_conv = (LDKSign*)orig_ptr; LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = Sign_clone(orig_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_Sign_free"))) TS_Sign_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -20215,7 +20228,7 @@ void __attribute__((export_name("TS_Sign_free"))) TS_Sign_free(uint32_t this_pt void __attribute__((export_name("TS_KeysInterface_free"))) TS_KeysInterface_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -20235,7 +20248,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_funding_key"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_funding_key(&this_ptr_conv), 32); return ret_arr; } @@ -20247,7 +20260,7 @@ void __attribute__((export_name("TS_InMemorySigner_set_funding_key"))) TS_InMem CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); } @@ -20256,7 +20269,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_revocation_base_k this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32); return ret_arr; } @@ -20268,7 +20281,7 @@ void __attribute__((export_name("TS_InMemorySigner_set_revocation_base_key"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); } @@ -20277,7 +20290,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_payment_key"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_payment_key(&this_ptr_conv), 32); return ret_arr; } @@ -20289,7 +20302,7 @@ void __attribute__((export_name("TS_InMemorySigner_set_payment_key"))) TS_InMem CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); } @@ -20298,7 +20311,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_delayed_payment_b this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32); return ret_arr; } @@ -20310,7 +20323,7 @@ void __attribute__((export_name("TS_InMemorySigner_set_delayed_payment_base_key CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); } @@ -20319,7 +20332,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_htlc_base_key"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32); return ret_arr; } @@ -20331,7 +20344,7 @@ void __attribute__((export_name("TS_InMemorySigner_set_htlc_base_key"))) TS_InM CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); } @@ -20340,7 +20353,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_commitment_seed") this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32); return ret_arr; } @@ -20352,28 +20365,28 @@ void __attribute__((export_name("TS_InMemorySigner_set_commitment_seed"))) TS_I CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); } static inline uintptr_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { LDKInMemorySigner ret_var = InMemorySigner_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_InMemorySigner_clone_ptr"))) TS_InMemorySigner_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_InMemorySigner_clone_ptr"))) TS_InMemorySigner_clone_ptr(uint32_t arg) { LDKInMemorySigner arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = InMemorySigner_clone_ptr(&arg_conv); + intptr_t ret_val = InMemorySigner_clone_ptr(&arg_conv); return ret_val; } @@ -20383,11 +20396,11 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_clone"))) TS_InMemorySig orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20397,31 +20410,31 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_clone"))) TS_InMemorySig uint32_t __attribute__((export_name("TS_InMemorySigner_new"))) TS_InMemorySigner_new(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) { LDKSecretKey funding_key_ref; CHECK(funding_key->arr_len == 32); - memcpy(funding_key_ref.bytes, funding_key->elems, 32); + memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key); LDKSecretKey revocation_base_key_ref; CHECK(revocation_base_key->arr_len == 32); - memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); + memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); FREE(revocation_base_key); LDKSecretKey payment_key_ref; CHECK(payment_key->arr_len == 32); - memcpy(payment_key_ref.bytes, payment_key->elems, 32); + memcpy(payment_key_ref.bytes, payment_key->elems, 32); FREE(payment_key); LDKSecretKey delayed_payment_base_key_ref; CHECK(delayed_payment_base_key->arr_len == 32); - memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); + memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); FREE(delayed_payment_base_key); LDKSecretKey htlc_base_key_ref; CHECK(htlc_base_key->arr_len == 32); - memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); + memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); FREE(htlc_base_key); LDKThirtyTwoBytes commitment_seed_ref; CHECK(commitment_seed->arr_len == 32); - memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); + memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); FREE(commitment_seed); LDKThirtyTwoBytes channel_keys_id_ref; CHECK(channel_keys_id->arr_len == 32); - memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); + memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); LDKInMemorySigner ret_var = InMemorySigner_new(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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20434,11 +20447,11 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_counterparty_pubkeys"))) this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20478,11 +20491,11 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_funding_outpoint"))) TS_ this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20495,11 +20508,11 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_get_channel_parameters") this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20515,7 +20528,7 @@ jboolean __attribute__((export_name("TS_InMemorySigner_opt_anchors"))) TS_InMem return ret_val; } -uint32_t __attribute__((export_name("TS_InMemorySigner_sign_counterparty_payment_input"))) TS_InMemorySigner_sign_counterparty_payment_input(uint32_t this_arg, int8_tArray spend_tx, int64_t input_idx, uint32_t descriptor) { +uint32_t __attribute__((export_name("TS_InMemorySigner_sign_counterparty_payment_input"))) TS_InMemorySigner_sign_counterparty_payment_input(uint32_t this_arg, int8_tArray spend_tx, intptr_t input_idx, uint32_t descriptor) { LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; @@ -20523,7 +20536,7 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_sign_counterparty_paymen LDKTransaction spend_tx_ref; spend_tx_ref.datalen = spend_tx->arr_len; spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); + memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); spend_tx_ref.data_is_owned = true; LDKStaticPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); @@ -20531,10 +20544,10 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_sign_counterparty_paymen CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -uint32_t __attribute__((export_name("TS_InMemorySigner_sign_dynamic_p2wsh_input"))) TS_InMemorySigner_sign_dynamic_p2wsh_input(uint32_t this_arg, int8_tArray spend_tx, int64_t input_idx, uint32_t descriptor) { +uint32_t __attribute__((export_name("TS_InMemorySigner_sign_dynamic_p2wsh_input"))) TS_InMemorySigner_sign_dynamic_p2wsh_input(uint32_t this_arg, int8_tArray spend_tx, intptr_t input_idx, uint32_t descriptor) { LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; @@ -20542,7 +20555,7 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_sign_dynamic_p2wsh_input LDKTransaction spend_tx_ref; spend_tx_ref.datalen = spend_tx->arr_len; spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); + memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); spend_tx_ref.data_is_owned = true; LDKDelayedPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); @@ -20550,7 +20563,7 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_sign_dynamic_p2wsh_input CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_InMemorySigner_as_BaseSign"))) TS_InMemorySigner_as_BaseSign(uint32_t this_arg) { @@ -20560,7 +20573,7 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_as_BaseSign"))) TS_InMem CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign"); *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_InMemorySigner_as_Sign"))) TS_InMemorySigner_as_Sign(uint32_t this_arg) { @@ -20570,7 +20583,7 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_as_Sign"))) TS_InMemoryS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = InMemorySigner_as_Sign(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemorySigner_write(uint32_t obj) { @@ -20579,7 +20592,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemory obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -20588,10 +20601,10 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemory uint32_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = InMemorySigner_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_KeysManager_free"))) TS_KeysManager_free(uint32_t this_obj) { @@ -20605,14 +20618,14 @@ void __attribute__((export_name("TS_KeysManager_free"))) TS_KeysManager_free(ui uint32_t __attribute__((export_name("TS_KeysManager_new"))) TS_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { unsigned char seed_arr[32]; CHECK(seed->arr_len == 32); - memcpy(seed_arr, seed->elems, 32); + memcpy(seed_arr, seed->elems, 32); FREE(seed); unsigned char (*seed_ref)[32] = &seed_arr; LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20626,14 +20639,14 @@ uint32_t __attribute__((export_name("TS_KeysManager_derive_channel_keys"))) TS_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char params_arr[32]; CHECK(params->arr_len == 32); - memcpy(params_arr, params->elems, 32); + memcpy(params_arr, params->elems, 32); FREE(params); unsigned char (*params_ref)[32] = ¶ms_arr; LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20651,13 +20664,13 @@ uint32_t __attribute__((export_name("TS_KeysManager_spend_spendable_outputs"))) descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else descriptors_constr.data = NULL; - uint32_t* descriptors_vals = descriptors->elems; + uint32_t* descriptors_vals = descriptors->elems /* XXX descriptors leaks */; for (size_t b = 0; b < descriptors_constr.datalen; b++) { uint32_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = (void*)(((uint64_t)descriptors_conv_27) & ~1); + void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1); CHECK_ACCESS(descriptors_conv_27_ptr); LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1)); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1)); descriptors_constr.data[b] = descriptors_conv_27_conv; } LDKCVec_TxOutZ outputs_constr; @@ -20666,22 +20679,22 @@ uint32_t __attribute__((export_name("TS_KeysManager_spend_spendable_outputs"))) outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); else outputs_constr.data = NULL; - uint32_t* outputs_vals = outputs->elems; + uint32_t* outputs_vals = outputs->elems /* XXX outputs leaks */; for (size_t h = 0; h < outputs_constr.datalen; h++) { uint32_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = (void*)(((uint64_t)outputs_conv_7) & ~1); + void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1); CHECK_ACCESS(outputs_conv_7_ptr); LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1)); + outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1)); outputs_constr.data[h] = outputs_conv_7_conv; } LDKCVec_u8Z change_destination_script_ref; change_destination_script_ref.datalen = change_destination_script->arr_len; change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); + memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script); LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_KeysManager_as_KeysInterface"))) TS_KeysManager_as_KeysInterface(uint32_t this_arg) { @@ -20691,7 +20704,7 @@ uint32_t __attribute__((export_name("TS_KeysManager_as_KeysInterface"))) TS_Key CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_ChannelManager_free"))) TS_ChannelManager_free(uint32_t this_obj) { @@ -20734,11 +20747,11 @@ uint32_t __attribute__((export_name("TS_ChainParameters_get_best_block"))) TS_C this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20766,11 +20779,11 @@ uint32_t __attribute__((export_name("TS_ChainParameters_new"))) TS_ChainParamet CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20779,22 +20792,22 @@ uint32_t __attribute__((export_name("TS_ChainParameters_new"))) TS_ChainParamet static inline uintptr_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { LDKChainParameters ret_var = ChainParameters_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChainParameters_clone_ptr"))) TS_ChainParameters_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChainParameters_clone_ptr"))) TS_ChainParameters_clone_ptr(uint32_t arg) { LDKChainParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChainParameters_clone_ptr(&arg_conv); + intptr_t ret_val = ChainParameters_clone_ptr(&arg_conv); return ret_val; } @@ -20804,11 +20817,11 @@ uint32_t __attribute__((export_name("TS_ChainParameters_clone"))) TS_ChainParam orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20876,11 +20889,11 @@ void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_cltv_expiry_ uint32_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) { LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20889,22 +20902,22 @@ uint32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_new"))) TS_C static inline uintptr_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone_ptr"))) TS_CounterpartyForwardingInfo_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone_ptr"))) TS_CounterpartyForwardingInfo_clone_ptr(uint32_t arg) { LDKCounterpartyForwardingInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = CounterpartyForwardingInfo_clone_ptr(&arg_conv); + intptr_t ret_val = CounterpartyForwardingInfo_clone_ptr(&arg_conv); return ret_val; } @@ -20914,11 +20927,11 @@ uint32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone"))) TS orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20938,7 +20951,7 @@ int8_tArray __attribute__((export_name("TS_ChannelCounterparty_get_node_id"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -20950,7 +20963,7 @@ void __attribute__((export_name("TS_ChannelCounterparty_set_node_id"))) TS_Chan CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); } @@ -20960,11 +20973,11 @@ uint32_t __attribute__((export_name("TS_ChannelCounterparty_get_features"))) TS this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21007,12 +21020,12 @@ uint32_t __attribute__((export_name("TS_ChannelCounterparty_get_forwarding_info this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21036,7 +21049,7 @@ void __attribute__((export_name("TS_ChannelCounterparty_set_forwarding_info"))) uint32_t __attribute__((export_name("TS_ChannelCounterparty_new"))) TS_ChannelCounterparty_new(int8_tArray node_id_arg, uint32_t features_arg, int64_t unspendable_punishment_reserve_arg, uint32_t forwarding_info_arg) { LDKPublicKey node_id_arg_ref; CHECK(node_id_arg->arr_len == 33); - memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); + memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); @@ -21048,11 +21061,11 @@ uint32_t __attribute__((export_name("TS_ChannelCounterparty_new"))) TS_ChannelC CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21061,22 +21074,22 @@ uint32_t __attribute__((export_name("TS_ChannelCounterparty_new"))) TS_ChannelC static inline uintptr_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelCounterparty_clone_ptr"))) TS_ChannelCounterparty_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelCounterparty_clone_ptr"))) TS_ChannelCounterparty_clone_ptr(uint32_t arg) { LDKChannelCounterparty arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelCounterparty_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelCounterparty_clone_ptr(&arg_conv); return ret_val; } @@ -21086,11 +21099,11 @@ uint32_t __attribute__((export_name("TS_ChannelCounterparty_clone"))) TS_Channe orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21110,7 +21123,7 @@ int8_tArray __attribute__((export_name("TS_ChannelDetails_get_channel_id"))) TS this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ChannelDetails_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -21122,7 +21135,7 @@ void __attribute__((export_name("TS_ChannelDetails_set_channel_id"))) TS_Channe CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ChannelDetails_set_channel_id(&this_ptr_conv, val_ref); } @@ -21132,11 +21145,11 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_counterparty"))) TS_ this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21162,12 +21175,12 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_funding_txo"))) TS_C this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21195,7 +21208,7 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_short_channel_id"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21204,10 +21217,10 @@ void __attribute__((export_name("TS_ChannelDetails_set_short_channel_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); } @@ -21235,7 +21248,7 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_unspendable_punishme CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21244,10 +21257,10 @@ void __attribute__((export_name("TS_ChannelDetails_set_unspendable_punishment_r this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); } @@ -21326,7 +21339,7 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_confirmations_requir CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21335,10 +21348,10 @@ void __attribute__((export_name("TS_ChannelDetails_set_confirmations_required") this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); } @@ -21349,7 +21362,7 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_force_close_spend_de CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21358,10 +21371,10 @@ void __attribute__((export_name("TS_ChannelDetails_set_force_close_spend_delay" this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); - val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)val) & ~1)); ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); } @@ -21436,7 +21449,7 @@ void __attribute__((export_name("TS_ChannelDetails_set_is_public"))) TS_Channel uint32_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetails_new(int8_tArray channel_id_arg, uint32_t counterparty_arg, uint32_t funding_txo_arg, uint32_t short_channel_id_arg, int64_t channel_value_satoshis_arg, uint32_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, uint32_t confirmations_required_arg, uint32_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKChannelCounterparty counterparty_arg_conv; counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); @@ -21447,27 +21460,27 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetail funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); - void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1); + void* short_channel_id_arg_ptr = (void*)(((uintptr_t)short_channel_id_arg) & ~1); CHECK_ACCESS(short_channel_id_arg_ptr); LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); - short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1)); - void* unspendable_punishment_reserve_arg_ptr = (void*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1); + short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id_arg) & ~1)); + void* unspendable_punishment_reserve_arg_ptr = (void*)(((uintptr_t)unspendable_punishment_reserve_arg) & ~1); CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); - void* confirmations_required_arg_ptr = (void*)(((uint64_t)confirmations_required_arg) & ~1); + void* confirmations_required_arg_ptr = (void*)(((uintptr_t)confirmations_required_arg) & ~1); CHECK_ACCESS(confirmations_required_arg_ptr); LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr); - confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1)); - void* force_close_spend_delay_arg_ptr = (void*)(((uint64_t)force_close_spend_delay_arg) & ~1); + confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)confirmations_required_arg) & ~1)); + void* force_close_spend_delay_arg_ptr = (void*)(((uintptr_t)force_close_spend_delay_arg) & ~1); CHECK_ACCESS(force_close_spend_delay_arg_ptr); LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); - force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1)); + force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)force_close_spend_delay_arg) & ~1)); LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21476,22 +21489,22 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetail static inline uintptr_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { LDKChannelDetails ret_var = ChannelDetails_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelDetails_clone_ptr"))) TS_ChannelDetails_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelDetails_clone_ptr"))) TS_ChannelDetails_clone_ptr(uint32_t arg) { LDKChannelDetails arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelDetails_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelDetails_clone_ptr(&arg_conv); return ret_val; } @@ -21501,11 +21514,11 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_clone"))) TS_ChannelDeta orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21514,7 +21527,7 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_clone"))) TS_ChannelDeta void __attribute__((export_name("TS_PaymentSendFailure_free"))) TS_PaymentSendFailure_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -21524,12 +21537,12 @@ void __attribute__((export_name("TS_PaymentSendFailure_free"))) TS_PaymentSendF static inline uintptr_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_PaymentSendFailure_clone_ptr"))) TS_PaymentSendFailure_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_PaymentSendFailure_clone_ptr"))) TS_PaymentSendFailure_clone_ptr(uint32_t arg) { LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)arg; - int64_t ret_val = PaymentSendFailure_clone_ptr(arg_conv); + intptr_t ret_val = PaymentSendFailure_clone_ptr(arg_conv); return ret_val; } @@ -21537,18 +21550,18 @@ uint32_t __attribute__((export_name("TS_PaymentSendFailure_clone"))) TS_Payment LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig; LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_PaymentSendFailure_parameter_error"))) TS_PaymentSendFailure_parameter_error(uint32_t a) { - void* a_ptr = (void*)(((uint64_t)a) & ~1); + void* a_ptr = (void*)(((uintptr_t)a) & ~1); CHECK_ACCESS(a_ptr); LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); - a_conv = APIError_clone((LDKAPIError*)(((uint64_t)a) & ~1)); + a_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a) & ~1)); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_parameter_error(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21559,18 +21572,18 @@ uint32_t __attribute__((export_name("TS_PaymentSendFailure_path_parameter_error a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); else a_constr.data = NULL; - uint32_t* a_vals = a->elems; + uint32_t* a_vals = a->elems /* XXX a leaks */; for (size_t w = 0; w < a_constr.datalen; w++) { uint32_t a_conv_22 = a_vals[w]; - void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1); + void* a_conv_22_ptr = (void*)(((uintptr_t)a_conv_22) & ~1); CHECK_ACCESS(a_conv_22_ptr); LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr); - a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1)); + a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uintptr_t)a_conv_22) & ~1)); a_constr.data[w] = a_conv_22_conv; } LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_path_parameter_error(a_constr); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21581,18 +21594,18 @@ uint32_t __attribute__((export_name("TS_PaymentSendFailure_all_failed_retry_saf a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); else a_constr.data = NULL; - uint32_t* a_vals = a->elems; + uint32_t* a_vals = a->elems /* XXX a leaks */; for (size_t k = 0; k < a_constr.datalen; k++) { uint32_t a_conv_10 = a_vals[k]; - void* a_conv_10_ptr = (void*)(((uint64_t)a_conv_10) & ~1); + void* a_conv_10_ptr = (void*)(((uintptr_t)a_conv_10) & ~1); CHECK_ACCESS(a_conv_10_ptr); LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); - a_conv_10_conv = APIError_clone((LDKAPIError*)(((uint64_t)a_conv_10) & ~1)); + a_conv_10_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a_conv_10) & ~1)); a_constr.data[k] = a_conv_10_conv; } LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21603,10 +21616,10 @@ uint32_t __attribute__((export_name("TS_PaymentSendFailure_partial_failure"))) results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); else results_constr.data = NULL; - uint32_t* results_vals = results->elems; + uint32_t* results_vals = results->elems /* XXX results leaks */; for (size_t w = 0; w < results_constr.datalen; w++) { uint32_t results_conv_22 = results_vals[w]; - void* results_conv_22_ptr = (void*)(((uint64_t)results_conv_22) & ~1); + void* results_conv_22_ptr = (void*)(((uintptr_t)results_conv_22) & ~1); CHECK_ACCESS(results_conv_22_ptr); LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); results_constr.data[w] = results_conv_22_conv; @@ -21618,27 +21631,27 @@ uint32_t __attribute__((export_name("TS_PaymentSendFailure_partial_failure"))) failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ChannelManager_new"))) TS_ChannelManager_new(uint32_t fee_est, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t keys_manager, uint32_t config, uint32_t params) { - void* fee_est_ptr = (void*)(((uint64_t)fee_est) & ~1); + void* fee_est_ptr = (void*)(((uintptr_t)fee_est) & ~1); CHECK_ACCESS(fee_est_ptr); LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); - void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1); + void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); CHECK_ACCESS(chain_monitor_ptr); LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1); + void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); CHECK_ACCESS(tx_broadcaster_ptr); LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); + void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); LDKUserConfig config_conv; @@ -21652,11 +21665,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_new"))) TS_ChannelManage CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); params_conv = ChainParameters_clone(¶ms_conv); LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21669,11 +21682,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_get_current_default_conf this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21687,7 +21700,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_channel"))) TS_Ch CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_network_key_ref; CHECK(their_network_key->arr_len == 33); - memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); + memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key); LDKUserConfig override_config_conv; override_config_conv.inner = (void*)(override_config & (~1)); override_config_conv.is_owned = (override_config & 1) || (override_config == 0); @@ -21695,7 +21708,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_channel"))) TS_Ch override_config_conv = UserConfig_clone(&override_config_conv); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_tArray __attribute__((export_name("TS_ChannelManager_list_channels"))) TS_ChannelManager_list_channels(uint32_t this_arg) { @@ -21705,15 +21718,15 @@ uint32_tArray __attribute__((export_name("TS_ChannelManager_list_channels"))) T CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t q = 0; q < ret_var.datalen; q++) { LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - uint64_t ret_conv_16_ref = 0; - CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; } @@ -21731,15 +21744,15 @@ uint32_tArray __attribute__((export_name("TS_ChannelManager_list_usable_channel CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t q = 0; q < ret_var.datalen; q++) { LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - uint64_t ret_conv_16_ref = 0; - CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; } @@ -21757,11 +21770,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_close_channel"))) TS_Cha CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); + memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); unsigned char (*channel_id_ref)[32] = &channel_id_arr; LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_close_channel_with_target_feerate"))) TS_ChannelManager_close_channel_with_target_feerate(uint32_t this_arg, int8_tArray channel_id, int32_t target_feerate_sats_per_1000_weight) { @@ -21771,11 +21784,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_close_channel_with_targe CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); + memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); unsigned char (*channel_id_ref)[32] = &channel_id_arr; LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, target_feerate_sats_per_1000_weight); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_force_close_channel"))) TS_ChannelManager_force_close_channel(uint32_t this_arg, int8_tArray channel_id) { @@ -21785,11 +21798,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_force_close_channel"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); + memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); unsigned char (*channel_id_ref)[32] = &channel_id_arr; LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChannelManager_force_close_channel(&this_arg_conv, channel_id_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ChannelManager_force_close_all_channels"))) TS_ChannelManager_force_close_all_channels(uint32_t this_arg) { @@ -21811,13 +21824,13 @@ uint32_t __attribute__((export_name("TS_ChannelManager_send_payment"))) TS_Chan CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKThirtyTwoBytes payment_secret_ref; CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_retry_payment"))) TS_ChannelManager_retry_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_id) { @@ -21831,10 +21844,10 @@ uint32_t __attribute__((export_name("TS_ChannelManager_retry_payment"))) TS_Cha CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_ChannelManager_abandon_payment(uint32_t this_arg, int8_tArray payment_id) { @@ -21844,7 +21857,7 @@ void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_Chann CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); } @@ -21859,10 +21872,10 @@ uint32_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_payment CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_funding_transaction_generated"))) TS_ChannelManager_funding_transaction_generated(uint32_t this_arg, int8_tArray temporary_channel_id, int8_tArray funding_transaction) { @@ -21872,16 +21885,16 @@ uint32_t __attribute__((export_name("TS_ChannelManager_funding_transaction_gene CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char temporary_channel_id_arr[32]; CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); + memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id); unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; LDKTransaction funding_transaction_ref; funding_transaction_ref.datalen = funding_transaction->arr_len; funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); + memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); funding_transaction_ref.data_is_owned = true; LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, funding_transaction_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ChannelManager_broadcast_node_announcement"))) TS_ChannelManager_broadcast_node_announcement(uint32_t this_arg, int8_tArray rgb, int8_tArray alias, uint32_tArray addresses) { @@ -21891,20 +21904,20 @@ void __attribute__((export_name("TS_ChannelManager_broadcast_node_announcement" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThreeBytes rgb_ref; CHECK(rgb->arr_len == 3); - memcpy(rgb_ref.data, rgb->elems, 3); + memcpy(rgb_ref.data, rgb->elems, 3); FREE(rgb); LDKThirtyTwoBytes alias_ref; CHECK(alias->arr_len == 32); - memcpy(alias_ref.data, alias->elems, 32); + memcpy(alias_ref.data, alias->elems, 32); FREE(alias); LDKCVec_NetAddressZ addresses_constr; addresses_constr.datalen = addresses->arr_len; if (addresses_constr.datalen > 0) addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else addresses_constr.data = NULL; - uint32_t* addresses_vals = addresses->elems; + uint32_t* addresses_vals = addresses->elems /* XXX addresses leaks */; for (size_t m = 0; m < addresses_constr.datalen; m++) { uint32_t addresses_conv_12 = addresses_vals[m]; - void* addresses_conv_12_ptr = (void*)(((uint64_t)addresses_conv_12) & ~1); + void* addresses_conv_12_ptr = (void*)(((uintptr_t)addresses_conv_12) & ~1); CHECK_ACCESS(addresses_conv_12_ptr); LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr); addresses_constr.data[m] = addresses_conv_12_conv; @@ -21935,7 +21948,7 @@ jboolean __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_arr, payment_hash->elems, 32); + memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); unsigned char (*payment_hash_ref)[32] = &payment_hash_arr; jboolean ret_val = ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); return ret_val; @@ -21948,7 +21961,7 @@ jboolean __attribute__((export_name("TS_ChannelManager_claim_funds"))) TS_Chann CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); jboolean ret_val = ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); return ret_val; } @@ -21958,7 +21971,7 @@ int8_tArray __attribute__((export_name("TS_ChannelManager_get_our_node_id"))) T this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33); return ret_arr; } @@ -21968,13 +21981,13 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment") this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1)); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_legacy"))) TS_ChannelManager_create_inbound_payment_legacy(uint32_t this_arg, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) { @@ -21982,13 +21995,13 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_l this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1)); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_for_hash"))) TS_ChannelManager_create_inbound_payment_for_hash(uint32_t this_arg, int8_tArray payment_hash, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) { @@ -21998,14 +22011,14 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_f CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); - void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1)); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_for_hash_legacy"))) TS_ChannelManager_create_inbound_payment_for_hash_legacy(uint32_t this_arg, int8_tArray payment_hash, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) { @@ -22015,14 +22028,14 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_f CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); - void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1)); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_get_payment_preimage"))) TS_ChannelManager_get_payment_preimage(uint32_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { @@ -22032,13 +22045,13 @@ uint32_t __attribute__((export_name("TS_ChannelManager_get_payment_preimage"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKThirtyTwoBytes payment_secret_ref; CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_as_MessageSendEventsProvider"))) TS_ChannelManager_as_MessageSendEventsProvider(uint32_t this_arg) { @@ -22048,7 +22061,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_as_MessageSendEventsProv CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChannelManager_as_EventsProvider"))) TS_ChannelManager_as_EventsProvider(uint32_t this_arg) { @@ -22058,7 +22071,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_as_EventsProvider"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChannelManager_as_Listen"))) TS_ChannelManager_as_Listen(uint32_t this_arg) { @@ -22068,7 +22081,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_as_Listen"))) TS_Channel CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChannelManager_as_Listen(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_ChannelManager_as_Confirm(uint32_t this_arg) { @@ -22078,7 +22091,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_Channe CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_ChannelManager_await_persistable_update"))) TS_ChannelManager_await_persistable_update(uint32_t this_arg) { @@ -22095,11 +22108,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_current_best_block"))) T this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22113,7 +22126,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_as_ChannelMessageHandler CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } int8_tArray __attribute__((export_name("TS_ChannelManager_write"))) TS_ChannelManager_write(uint32_t obj) { @@ -22122,7 +22135,7 @@ int8_tArray __attribute__((export_name("TS_ChannelManager_write"))) TS_ChannelM obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -22142,7 +22155,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_keys_manager this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; return ret_ret; } @@ -22151,7 +22164,7 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_keys_manager"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr); ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv); @@ -22163,7 +22176,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_fee_estimato this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; return ret_ret; } @@ -22172,7 +22185,7 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_fee_estimator")) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); @@ -22184,7 +22197,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_chain_monito this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; return ret_ret; } @@ -22193,7 +22206,7 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_chain_monitor")) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKWatch val_conv = *(LDKWatch*)(val_ptr); ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); @@ -22205,7 +22218,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_tx_broadcast this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; return ret_ret; } @@ -22214,7 +22227,7 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_tx_broadcaster") this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); @@ -22226,7 +22239,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_logger"))) T this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; return ret_ret; } @@ -22235,7 +22248,7 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_logger"))) TS_Ch this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKLogger val_conv = *(LDKLogger*)(val_ptr); ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); @@ -22247,11 +22260,11 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_default_conf this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22272,19 +22285,19 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_default_config") } uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_ChannelManagerReadArgs_new(uint32_t keys_manager, uint32_t fee_estimator, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t default_config, uint32_tArray channel_monitors) { - void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); + void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1); + void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); CHECK_ACCESS(chain_monitor_ptr); LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1); + void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); CHECK_ACCESS(tx_broadcaster_ptr); LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); LDKUserConfig default_config_conv; @@ -22298,7 +22311,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_Chann channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); else channel_monitors_constr.data = NULL; - uint32_t* channel_monitors_vals = channel_monitors->elems; + uint32_t* channel_monitors_vals = channel_monitors->elems /* XXX channel_monitors leaks */; for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { uint32_t channel_monitors_conv_16 = channel_monitors_vals[q]; LDKChannelMonitor channel_monitors_conv_16_conv; @@ -22308,11 +22321,11 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_Chann channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; } 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22322,7 +22335,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_Chann uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_read"))) TS_C2Tuple_BlockHashChannelManagerZ_read(int8_tArray ser, uint32_t arg) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKChannelManagerReadArgs arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = (arg & 1) || (arg == 0); @@ -22330,7 +22343,7 @@ uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_read") // Warning: we need a move here but no clone is available for LDKChannelManagerReadArgs LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint32_t this_obj) { @@ -22343,22 +22356,22 @@ void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(ui static inline uintptr_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { LDKDecodeError ret_var = DecodeError_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint32_t arg) { LDKDecodeError arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = DecodeError_clone_ptr(&arg_conv); + intptr_t ret_val = DecodeError_clone_ptr(&arg_conv); return ret_val; } @@ -22368,11 +22381,11 @@ uint32_t __attribute__((export_name("TS_DecodeError_clone"))) TS_DecodeError_cl orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDecodeError ret_var = DecodeError_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22393,11 +22406,11 @@ uint32_t __attribute__((export_name("TS_Init_get_features"))) TS_Init_get_featu this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22424,11 +22437,11 @@ uint32_t __attribute__((export_name("TS_Init_new"))) TS_Init_new(uint32_t featu CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKInit ret_var = Init_new(features_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22437,22 +22450,22 @@ uint32_t __attribute__((export_name("TS_Init_new"))) TS_Init_new(uint32_t featu static inline uintptr_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { LDKInit ret_var = Init_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Init_clone_ptr"))) TS_Init_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Init_clone_ptr"))) TS_Init_clone_ptr(uint32_t arg) { LDKInit arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Init_clone_ptr(&arg_conv); + intptr_t ret_val = Init_clone_ptr(&arg_conv); return ret_val; } @@ -22462,11 +22475,11 @@ uint32_t __attribute__((export_name("TS_Init_clone"))) TS_Init_clone(uint32_t o orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInit ret_var = Init_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22486,7 +22499,7 @@ int8_tArray __attribute__((export_name("TS_ErrorMessage_get_channel_id"))) TS_E this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ErrorMessage_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -22498,7 +22511,7 @@ void __attribute__((export_name("TS_ErrorMessage_set_channel_id"))) TS_ErrorMes CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ErrorMessage_set_channel_id(&this_ptr_conv, val_ref); } @@ -22525,14 +22538,14 @@ void __attribute__((export_name("TS_ErrorMessage_set_data"))) TS_ErrorMessage_s uint32_t __attribute__((export_name("TS_ErrorMessage_new"))) TS_ErrorMessage_new(int8_tArray channel_id_arg, jstring data_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKStr data_arg_conv = str_ref_to_owned_c(data_arg); LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22541,22 +22554,22 @@ uint32_t __attribute__((export_name("TS_ErrorMessage_new"))) TS_ErrorMessage_ne static inline uintptr_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { LDKErrorMessage ret_var = ErrorMessage_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ErrorMessage_clone_ptr"))) TS_ErrorMessage_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ErrorMessage_clone_ptr"))) TS_ErrorMessage_clone_ptr(uint32_t arg) { LDKErrorMessage arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ErrorMessage_clone_ptr(&arg_conv); + intptr_t ret_val = ErrorMessage_clone_ptr(&arg_conv); return ret_val; } @@ -22566,11 +22579,11 @@ uint32_t __attribute__((export_name("TS_ErrorMessage_clone"))) TS_ErrorMessage_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22621,11 +22634,11 @@ void __attribute__((export_name("TS_Ping_set_byteslen"))) TS_Ping_set_byteslen( uint32_t __attribute__((export_name("TS_Ping_new"))) TS_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) { LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22634,22 +22647,22 @@ uint32_t __attribute__((export_name("TS_Ping_new"))) TS_Ping_new(int16_t pongle static inline uintptr_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { LDKPing ret_var = Ping_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Ping_clone_ptr"))) TS_Ping_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Ping_clone_ptr"))) TS_Ping_clone_ptr(uint32_t arg) { LDKPing arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Ping_clone_ptr(&arg_conv); + intptr_t ret_val = Ping_clone_ptr(&arg_conv); return ret_val; } @@ -22659,11 +22672,11 @@ uint32_t __attribute__((export_name("TS_Ping_clone"))) TS_Ping_clone(uint32_t o orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPing ret_var = Ping_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22697,11 +22710,11 @@ void __attribute__((export_name("TS_Pong_set_byteslen"))) TS_Pong_set_byteslen( uint32_t __attribute__((export_name("TS_Pong_new"))) TS_Pong_new(int16_t byteslen_arg) { LDKPong ret_var = Pong_new(byteslen_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22710,22 +22723,22 @@ uint32_t __attribute__((export_name("TS_Pong_new"))) TS_Pong_new(int16_t bytesl static inline uintptr_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { LDKPong ret_var = Pong_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Pong_clone_ptr"))) TS_Pong_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Pong_clone_ptr"))) TS_Pong_clone_ptr(uint32_t arg) { LDKPong arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Pong_clone_ptr(&arg_conv); + intptr_t ret_val = Pong_clone_ptr(&arg_conv); return ret_val; } @@ -22735,11 +22748,11 @@ uint32_t __attribute__((export_name("TS_Pong_clone"))) TS_Pong_clone(uint32_t o orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPong ret_var = Pong_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22759,7 +22772,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_chain_hash"))) TS_Op this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *OpenChannel_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -22771,7 +22784,7 @@ void __attribute__((export_name("TS_OpenChannel_set_chain_hash"))) TS_OpenChann CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); OpenChannel_set_chain_hash(&this_ptr_conv, val_ref); } @@ -22780,7 +22793,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_temporary_channel_id this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -22792,7 +22805,7 @@ void __attribute__((export_name("TS_OpenChannel_set_temporary_channel_id"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); } @@ -22954,7 +22967,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_funding_pubkey"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -22966,7 +22979,7 @@ void __attribute__((export_name("TS_OpenChannel_set_funding_pubkey"))) TS_OpenC CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref); } @@ -22975,7 +22988,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_revocation_basepoint this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -22987,7 +23000,7 @@ void __attribute__((export_name("TS_OpenChannel_set_revocation_basepoint"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); } @@ -22996,7 +23009,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_payment_point"))) TS this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23008,7 +23021,7 @@ void __attribute__((export_name("TS_OpenChannel_set_payment_point"))) TS_OpenCh CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_payment_point(&this_ptr_conv, val_ref); } @@ -23017,7 +23030,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_delayed_payment_base this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23029,7 +23042,7 @@ void __attribute__((export_name("TS_OpenChannel_set_delayed_payment_basepoint") CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } @@ -23038,7 +23051,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_htlc_basepoint"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23050,7 +23063,7 @@ void __attribute__((export_name("TS_OpenChannel_set_htlc_basepoint"))) TS_OpenC CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); } @@ -23059,7 +23072,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_first_per_commitment this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23071,7 +23084,7 @@ void __attribute__((export_name("TS_OpenChannel_set_first_per_commitment_point" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } @@ -23098,12 +23111,12 @@ uint32_t __attribute__((export_name("TS_OpenChannel_get_channel_type"))) TS_Ope this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23126,22 +23139,22 @@ void __attribute__((export_name("TS_OpenChannel_set_channel_type"))) TS_OpenCha static inline uintptr_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { LDKOpenChannel ret_var = OpenChannel_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_OpenChannel_clone_ptr"))) TS_OpenChannel_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_OpenChannel_clone_ptr"))) TS_OpenChannel_clone_ptr(uint32_t arg) { LDKOpenChannel arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = OpenChannel_clone_ptr(&arg_conv); + intptr_t ret_val = OpenChannel_clone_ptr(&arg_conv); return ret_val; } @@ -23151,11 +23164,11 @@ uint32_t __attribute__((export_name("TS_OpenChannel_clone"))) TS_OpenChannel_cl orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23175,7 +23188,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_temporary_channel_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -23187,7 +23200,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_temporary_channel_id"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); } @@ -23315,7 +23328,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_funding_pubkey"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23327,7 +23340,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_funding_pubkey"))) TS_Acc CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref); } @@ -23336,7 +23349,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_revocation_basepoi this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23348,7 +23361,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_revocation_basepoint"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); } @@ -23357,7 +23370,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_payment_point"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23369,7 +23382,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_payment_point"))) TS_Acce CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_payment_point(&this_ptr_conv, val_ref); } @@ -23378,7 +23391,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_delayed_payment_ba this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23390,7 +23403,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_delayed_payment_basepoint CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } @@ -23399,7 +23412,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_htlc_basepoint"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23411,7 +23424,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_htlc_basepoint"))) TS_Acc CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); } @@ -23420,7 +23433,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_first_per_commitme this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23432,28 +23445,28 @@ void __attribute__((export_name("TS_AcceptChannel_set_first_per_commitment_poin CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } static inline uintptr_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) { LDKAcceptChannel ret_var = AcceptChannel_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_AcceptChannel_clone_ptr"))) TS_AcceptChannel_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_AcceptChannel_clone_ptr"))) TS_AcceptChannel_clone_ptr(uint32_t arg) { LDKAcceptChannel arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = AcceptChannel_clone_ptr(&arg_conv); + intptr_t ret_val = AcceptChannel_clone_ptr(&arg_conv); return ret_val; } @@ -23463,11 +23476,11 @@ uint32_t __attribute__((export_name("TS_AcceptChannel_clone"))) TS_AcceptChanne orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23487,7 +23500,7 @@ int8_tArray __attribute__((export_name("TS_FundingCreated_get_temporary_channel this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *FundingCreated_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -23499,7 +23512,7 @@ void __attribute__((export_name("TS_FundingCreated_set_temporary_channel_id"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref); } @@ -23508,7 +23521,7 @@ int8_tArray __attribute__((export_name("TS_FundingCreated_get_funding_txid"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *FundingCreated_get_funding_txid(&this_ptr_conv), 32); return ret_arr; } @@ -23520,7 +23533,7 @@ void __attribute__((export_name("TS_FundingCreated_set_funding_txid"))) TS_Fund CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); FundingCreated_set_funding_txid(&this_ptr_conv, val_ref); } @@ -23546,7 +23559,7 @@ int8_tArray __attribute__((export_name("TS_FundingCreated_get_signature"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, FundingCreated_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -23558,26 +23571,26 @@ void __attribute__((export_name("TS_FundingCreated_set_signature"))) TS_Funding CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); FundingCreated_set_signature(&this_ptr_conv, val_ref); } uint32_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) { LDKThirtyTwoBytes temporary_channel_id_arg_ref; CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); + memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg); LDKThirtyTwoBytes funding_txid_arg_ref; CHECK(funding_txid_arg->arr_len == 32); - memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); + memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); FREE(funding_txid_arg); LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23586,22 +23599,22 @@ uint32_t __attribute__((export_name("TS_FundingCreated_new"))) TS_FundingCreate static inline uintptr_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { LDKFundingCreated ret_var = FundingCreated_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_FundingCreated_clone_ptr"))) TS_FundingCreated_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_FundingCreated_clone_ptr"))) TS_FundingCreated_clone_ptr(uint32_t arg) { LDKFundingCreated arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = FundingCreated_clone_ptr(&arg_conv); + intptr_t ret_val = FundingCreated_clone_ptr(&arg_conv); return ret_val; } @@ -23611,11 +23624,11 @@ uint32_t __attribute__((export_name("TS_FundingCreated_clone"))) TS_FundingCrea orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23635,7 +23648,7 @@ int8_tArray __attribute__((export_name("TS_FundingSigned_get_channel_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *FundingSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -23647,7 +23660,7 @@ void __attribute__((export_name("TS_FundingSigned_set_channel_id"))) TS_Funding CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); FundingSigned_set_channel_id(&this_ptr_conv, val_ref); } @@ -23656,7 +23669,7 @@ int8_tArray __attribute__((export_name("TS_FundingSigned_get_signature"))) TS_F this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, FundingSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -23668,23 +23681,23 @@ void __attribute__((export_name("TS_FundingSigned_set_signature"))) TS_FundingS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); FundingSigned_set_signature(&this_ptr_conv, val_ref); } uint32_t __attribute__((export_name("TS_FundingSigned_new"))) TS_FundingSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23693,22 +23706,22 @@ uint32_t __attribute__((export_name("TS_FundingSigned_new"))) TS_FundingSigned_ static inline uintptr_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { LDKFundingSigned ret_var = FundingSigned_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_FundingSigned_clone_ptr"))) TS_FundingSigned_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_FundingSigned_clone_ptr"))) TS_FundingSigned_clone_ptr(uint32_t arg) { LDKFundingSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = FundingSigned_clone_ptr(&arg_conv); + intptr_t ret_val = FundingSigned_clone_ptr(&arg_conv); return ret_val; } @@ -23718,11 +23731,11 @@ uint32_t __attribute__((export_name("TS_FundingSigned_clone"))) TS_FundingSigne orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23742,7 +23755,7 @@ int8_tArray __attribute__((export_name("TS_FundingLocked_get_channel_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *FundingLocked_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -23754,7 +23767,7 @@ void __attribute__((export_name("TS_FundingLocked_set_channel_id"))) TS_Funding CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); FundingLocked_set_channel_id(&this_ptr_conv, val_ref); } @@ -23763,7 +23776,7 @@ int8_tArray __attribute__((export_name("TS_FundingLocked_get_next_per_commitmen this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23775,23 +23788,23 @@ void __attribute__((export_name("TS_FundingLocked_set_next_per_commitment_point CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); FundingLocked_set_next_per_commitment_point(&this_ptr_conv, val_ref); } uint32_t __attribute__((export_name("TS_FundingLocked_new"))) TS_FundingLocked_new(int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKPublicKey next_per_commitment_point_arg_ref; CHECK(next_per_commitment_point_arg->arr_len == 33); - memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); + memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg); LDKFundingLocked ret_var = FundingLocked_new(channel_id_arg_ref, next_per_commitment_point_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23800,22 +23813,22 @@ uint32_t __attribute__((export_name("TS_FundingLocked_new"))) TS_FundingLocked_ static inline uintptr_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg) { LDKFundingLocked ret_var = FundingLocked_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_FundingLocked_clone_ptr"))) TS_FundingLocked_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_FundingLocked_clone_ptr"))) TS_FundingLocked_clone_ptr(uint32_t arg) { LDKFundingLocked arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = FundingLocked_clone_ptr(&arg_conv); + intptr_t ret_val = FundingLocked_clone_ptr(&arg_conv); return ret_val; } @@ -23825,11 +23838,11 @@ uint32_t __attribute__((export_name("TS_FundingLocked_clone"))) TS_FundingLocke orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingLocked ret_var = FundingLocked_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23849,7 +23862,7 @@ int8_tArray __attribute__((export_name("TS_Shutdown_get_channel_id"))) TS_Shutd this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *Shutdown_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -23861,7 +23874,7 @@ void __attribute__((export_name("TS_Shutdown_set_channel_id"))) TS_Shutdown_set CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); Shutdown_set_channel_id(&this_ptr_conv, val_ref); } @@ -23871,7 +23884,7 @@ int8_tArray __attribute__((export_name("TS_Shutdown_get_scriptpubkey"))) TS_Shu this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -23884,24 +23897,24 @@ void __attribute__((export_name("TS_Shutdown_set_scriptpubkey"))) TS_Shutdown_s LDKCVec_u8Z val_ref; val_ref.datalen = val->arr_len; val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref); } uint32_t __attribute__((export_name("TS_Shutdown_new"))) TS_Shutdown_new(int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKCVec_u8Z scriptpubkey_arg_ref; scriptpubkey_arg_ref.datalen = scriptpubkey_arg->arr_len; scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(scriptpubkey_arg_ref.data, scriptpubkey_arg->elems, scriptpubkey_arg_ref.datalen); + memcpy(scriptpubkey_arg_ref.data, scriptpubkey_arg->elems, scriptpubkey_arg_ref.datalen); FREE(scriptpubkey_arg); LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23910,22 +23923,22 @@ uint32_t __attribute__((export_name("TS_Shutdown_new"))) TS_Shutdown_new(int8_t static inline uintptr_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) { LDKShutdown ret_var = Shutdown_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Shutdown_clone_ptr"))) TS_Shutdown_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Shutdown_clone_ptr"))) TS_Shutdown_clone_ptr(uint32_t arg) { LDKShutdown arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Shutdown_clone_ptr(&arg_conv); + intptr_t ret_val = Shutdown_clone_ptr(&arg_conv); return ret_val; } @@ -23935,11 +23948,11 @@ uint32_t __attribute__((export_name("TS_Shutdown_clone"))) TS_Shutdown_clone(ui orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdown ret_var = Shutdown_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23990,11 +24003,11 @@ void __attribute__((export_name("TS_ClosingSignedFeeRange_set_max_fee_satoshis" uint32_t __attribute__((export_name("TS_ClosingSignedFeeRange_new"))) TS_ClosingSignedFeeRange_new(int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) { LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24003,22 +24016,22 @@ uint32_t __attribute__((export_name("TS_ClosingSignedFeeRange_new"))) TS_Closin static inline uintptr_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) { LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone_ptr"))) TS_ClosingSignedFeeRange_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone_ptr"))) TS_ClosingSignedFeeRange_clone_ptr(uint32_t arg) { LDKClosingSignedFeeRange arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ClosingSignedFeeRange_clone_ptr(&arg_conv); + intptr_t ret_val = ClosingSignedFeeRange_clone_ptr(&arg_conv); return ret_val; } @@ -24028,11 +24041,11 @@ uint32_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone"))) TS_Clos orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24052,7 +24065,7 @@ int8_tArray __attribute__((export_name("TS_ClosingSigned_get_channel_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ClosingSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24064,7 +24077,7 @@ void __attribute__((export_name("TS_ClosingSigned_set_channel_id"))) TS_Closing CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ClosingSigned_set_channel_id(&this_ptr_conv, val_ref); } @@ -24090,7 +24103,7 @@ int8_tArray __attribute__((export_name("TS_ClosingSigned_get_signature"))) TS_C this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ClosingSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -24102,7 +24115,7 @@ void __attribute__((export_name("TS_ClosingSigned_set_signature"))) TS_ClosingS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ClosingSigned_set_signature(&this_ptr_conv, val_ref); } @@ -24112,12 +24125,12 @@ uint32_t __attribute__((export_name("TS_ClosingSigned_get_fee_range"))) TS_Clos this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24141,21 +24154,21 @@ void __attribute__((export_name("TS_ClosingSigned_set_fee_range"))) TS_ClosingS uint32_t __attribute__((export_name("TS_ClosingSigned_new"))) TS_ClosingSigned_new(int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, uint32_t fee_range_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKClosingSignedFeeRange fee_range_arg_conv; fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1)); fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24164,22 +24177,22 @@ uint32_t __attribute__((export_name("TS_ClosingSigned_new"))) TS_ClosingSigned_ static inline uintptr_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) { LDKClosingSigned ret_var = ClosingSigned_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ClosingSigned_clone_ptr"))) TS_ClosingSigned_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ClosingSigned_clone_ptr"))) TS_ClosingSigned_clone_ptr(uint32_t arg) { LDKClosingSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ClosingSigned_clone_ptr(&arg_conv); + intptr_t ret_val = ClosingSigned_clone_ptr(&arg_conv); return ret_val; } @@ -24189,11 +24202,11 @@ uint32_t __attribute__((export_name("TS_ClosingSigned_clone"))) TS_ClosingSigne orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24213,7 +24226,7 @@ int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_channel_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateAddHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24225,7 +24238,7 @@ void __attribute__((export_name("TS_UpdateAddHTLC_set_channel_id"))) TS_UpdateA CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref); } @@ -24268,7 +24281,7 @@ int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_payment_hash"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv), 32); return ret_arr; } @@ -24280,7 +24293,7 @@ void __attribute__((export_name("TS_UpdateAddHTLC_set_payment_hash"))) TS_Updat CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref); } @@ -24303,22 +24316,22 @@ void __attribute__((export_name("TS_UpdateAddHTLC_set_cltv_expiry"))) TS_Update static inline uintptr_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UpdateAddHTLC_clone_ptr"))) TS_UpdateAddHTLC_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UpdateAddHTLC_clone_ptr"))) TS_UpdateAddHTLC_clone_ptr(uint32_t arg) { LDKUpdateAddHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UpdateAddHTLC_clone_ptr(&arg_conv); + intptr_t ret_val = UpdateAddHTLC_clone_ptr(&arg_conv); return ret_val; } @@ -24328,11 +24341,11 @@ uint32_t __attribute__((export_name("TS_UpdateAddHTLC_clone"))) TS_UpdateAddHTL orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24352,7 +24365,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_channel_id"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24364,7 +24377,7 @@ void __attribute__((export_name("TS_UpdateFulfillHTLC_set_channel_id"))) TS_Upd CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref); } @@ -24390,7 +24403,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_payment_preima this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv), 32); return ret_arr; } @@ -24402,23 +24415,23 @@ void __attribute__((export_name("TS_UpdateFulfillHTLC_set_payment_preimage"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref); } uint32_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) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKThirtyTwoBytes payment_preimage_arg_ref; CHECK(payment_preimage_arg->arr_len == 32); - memcpy(payment_preimage_arg_ref.data, payment_preimage_arg->elems, 32); + memcpy(payment_preimage_arg_ref.data, payment_preimage_arg->elems, 32); FREE(payment_preimage_arg); LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24427,22 +24440,22 @@ uint32_t __attribute__((export_name("TS_UpdateFulfillHTLC_new"))) TS_UpdateFulf static inline uintptr_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) { LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone_ptr"))) TS_UpdateFulfillHTLC_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone_ptr"))) TS_UpdateFulfillHTLC_clone_ptr(uint32_t arg) { LDKUpdateFulfillHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UpdateFulfillHTLC_clone_ptr(&arg_conv); + intptr_t ret_val = UpdateFulfillHTLC_clone_ptr(&arg_conv); return ret_val; } @@ -24452,11 +24465,11 @@ uint32_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone"))) TS_UpdateFu orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24476,7 +24489,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_get_channel_id"))) TS this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateFailHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24488,7 +24501,7 @@ void __attribute__((export_name("TS_UpdateFailHTLC_set_channel_id"))) TS_Update CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref); } @@ -24511,22 +24524,22 @@ void __attribute__((export_name("TS_UpdateFailHTLC_set_htlc_id"))) TS_UpdateFai static inline uintptr_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) { LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UpdateFailHTLC_clone_ptr"))) TS_UpdateFailHTLC_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UpdateFailHTLC_clone_ptr"))) TS_UpdateFailHTLC_clone_ptr(uint32_t arg) { LDKUpdateFailHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UpdateFailHTLC_clone_ptr(&arg_conv); + intptr_t ret_val = UpdateFailHTLC_clone_ptr(&arg_conv); return ret_val; } @@ -24536,11 +24549,11 @@ uint32_t __attribute__((export_name("TS_UpdateFailHTLC_clone"))) TS_UpdateFailH orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24560,7 +24573,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_channel_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24572,7 +24585,7 @@ void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_channel_id"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref); } @@ -24612,22 +24625,22 @@ void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_failure_code")) static inline uintptr_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) { LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone_ptr"))) TS_UpdateFailMalformedHTLC_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone_ptr"))) TS_UpdateFailMalformedHTLC_clone_ptr(uint32_t arg) { LDKUpdateFailMalformedHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); + intptr_t ret_val = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); return ret_val; } @@ -24637,11 +24650,11 @@ uint32_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone"))) TS_Up orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24661,7 +24674,7 @@ int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_channel_id"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *CommitmentSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24673,7 +24686,7 @@ void __attribute__((export_name("TS_CommitmentSigned_set_channel_id"))) TS_Comm CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref); } @@ -24682,7 +24695,7 @@ int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_signature"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, CommitmentSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -24694,7 +24707,7 @@ void __attribute__((export_name("TS_CommitmentSigned_set_signature"))) TS_Commi CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); CommitmentSigned_set_signature(&this_ptr_conv, val_ref); } @@ -24709,12 +24722,12 @@ void __attribute__((export_name("TS_CommitmentSigned_set_htlc_signatures"))) TS val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else val_constr.data = NULL; - int8_tArray* val_vals = (void*) val->elems; + int8_tArray* val_vals = (void*) val->elems /* XXX val leaks */; for (size_t m = 0; m < val_constr.datalen; m++) { int8_tArray val_conv_12 = val_vals[m]; LDKSignature val_conv_12_ref; CHECK(val_conv_12->arr_len == 64); - memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); + memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12); val_constr.data[m] = val_conv_12_ref; } CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); @@ -24723,30 +24736,30 @@ void __attribute__((export_name("TS_CommitmentSigned_set_htlc_signatures"))) TS uint32_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKCVec_SignatureZ htlc_signatures_arg_constr; htlc_signatures_arg_constr.datalen = htlc_signatures_arg->arr_len; if (htlc_signatures_arg_constr.datalen > 0) htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else htlc_signatures_arg_constr.data = NULL; - int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems; + int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems /* XXX htlc_signatures_arg leaks */; for (size_t m = 0; m < htlc_signatures_arg_constr.datalen; m++) { int8_tArray htlc_signatures_arg_conv_12 = htlc_signatures_arg_vals[m]; LDKSignature htlc_signatures_arg_conv_12_ref; CHECK(htlc_signatures_arg_conv_12->arr_len == 64); - memcpy(htlc_signatures_arg_conv_12_ref.compact_form, htlc_signatures_arg_conv_12->elems, 64); + memcpy(htlc_signatures_arg_conv_12_ref.compact_form, htlc_signatures_arg_conv_12->elems, 64); FREE(htlc_signatures_arg_conv_12); htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref; } LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24755,22 +24768,22 @@ uint32_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentS static inline uintptr_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) { LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_CommitmentSigned_clone_ptr"))) TS_CommitmentSigned_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CommitmentSigned_clone_ptr"))) TS_CommitmentSigned_clone_ptr(uint32_t arg) { LDKCommitmentSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = CommitmentSigned_clone_ptr(&arg_conv); + intptr_t ret_val = CommitmentSigned_clone_ptr(&arg_conv); return ret_val; } @@ -24780,11 +24793,11 @@ uint32_t __attribute__((export_name("TS_CommitmentSigned_clone"))) TS_Commitmen orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24804,7 +24817,7 @@ int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_channel_id"))) TS_R this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *RevokeAndACK_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24816,7 +24829,7 @@ void __attribute__((export_name("TS_RevokeAndACK_set_channel_id"))) TS_RevokeAn CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref); } @@ -24825,7 +24838,7 @@ int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_per_commitment_secr this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv), 32); return ret_arr; } @@ -24837,7 +24850,7 @@ void __attribute__((export_name("TS_RevokeAndACK_set_per_commitment_secret"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref); } @@ -24846,7 +24859,7 @@ int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_next_per_commitment this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -24858,26 +24871,26 @@ void __attribute__((export_name("TS_RevokeAndACK_set_next_per_commitment_point" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref); } uint32_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) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKThirtyTwoBytes per_commitment_secret_arg_ref; CHECK(per_commitment_secret_arg->arr_len == 32); - memcpy(per_commitment_secret_arg_ref.data, per_commitment_secret_arg->elems, 32); + memcpy(per_commitment_secret_arg_ref.data, per_commitment_secret_arg->elems, 32); FREE(per_commitment_secret_arg); LDKPublicKey next_per_commitment_point_arg_ref; CHECK(next_per_commitment_point_arg->arr_len == 33); - memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); + memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg); LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24886,22 +24899,22 @@ uint32_t __attribute__((export_name("TS_RevokeAndACK_new"))) TS_RevokeAndACK_ne static inline uintptr_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) { LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RevokeAndACK_clone_ptr"))) TS_RevokeAndACK_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RevokeAndACK_clone_ptr"))) TS_RevokeAndACK_clone_ptr(uint32_t arg) { LDKRevokeAndACK arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RevokeAndACK_clone_ptr(&arg_conv); + intptr_t ret_val = RevokeAndACK_clone_ptr(&arg_conv); return ret_val; } @@ -24911,11 +24924,11 @@ uint32_t __attribute__((export_name("TS_RevokeAndACK_clone"))) TS_RevokeAndACK_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24935,7 +24948,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFee_get_channel_id"))) TS_Upda this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateFee_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24947,7 +24960,7 @@ void __attribute__((export_name("TS_UpdateFee_set_channel_id"))) TS_UpdateFee_s CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateFee_set_channel_id(&this_ptr_conv, val_ref); } @@ -24971,13 +24984,13 @@ void __attribute__((export_name("TS_UpdateFee_set_feerate_per_kw"))) TS_UpdateF uint32_t __attribute__((export_name("TS_UpdateFee_new"))) TS_UpdateFee_new(int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24986,22 +24999,22 @@ uint32_t __attribute__((export_name("TS_UpdateFee_new"))) TS_UpdateFee_new(int8 static inline uintptr_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) { LDKUpdateFee ret_var = UpdateFee_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UpdateFee_clone_ptr"))) TS_UpdateFee_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UpdateFee_clone_ptr"))) TS_UpdateFee_clone_ptr(uint32_t arg) { LDKUpdateFee arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UpdateFee_clone_ptr(&arg_conv); + intptr_t ret_val = UpdateFee_clone_ptr(&arg_conv); return ret_val; } @@ -25011,11 +25024,11 @@ uint32_t __attribute__((export_name("TS_UpdateFee_clone"))) TS_UpdateFee_clone( orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25035,7 +25048,7 @@ int8_tArray __attribute__((export_name("TS_DataLossProtect_get_your_last_per_co this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv), 32); return ret_arr; } @@ -25047,7 +25060,7 @@ void __attribute__((export_name("TS_DataLossProtect_set_your_last_per_commitmen CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref); } @@ -25056,7 +25069,7 @@ int8_tArray __attribute__((export_name("TS_DataLossProtect_get_my_current_per_c this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25068,23 +25081,23 @@ void __attribute__((export_name("TS_DataLossProtect_set_my_current_per_commitme CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref); } uint32_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) { LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref; CHECK(your_last_per_commitment_secret_arg->arr_len == 32); - memcpy(your_last_per_commitment_secret_arg_ref.data, your_last_per_commitment_secret_arg->elems, 32); + memcpy(your_last_per_commitment_secret_arg_ref.data, your_last_per_commitment_secret_arg->elems, 32); FREE(your_last_per_commitment_secret_arg); LDKPublicKey my_current_per_commitment_point_arg_ref; CHECK(my_current_per_commitment_point_arg->arr_len == 33); - memcpy(my_current_per_commitment_point_arg_ref.compressed_form, my_current_per_commitment_point_arg->elems, 33); + 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); LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25093,22 +25106,22 @@ uint32_t __attribute__((export_name("TS_DataLossProtect_new"))) TS_DataLossProt static inline uintptr_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) { LDKDataLossProtect ret_var = DataLossProtect_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_DataLossProtect_clone_ptr"))) TS_DataLossProtect_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_DataLossProtect_clone_ptr"))) TS_DataLossProtect_clone_ptr(uint32_t arg) { LDKDataLossProtect arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = DataLossProtect_clone_ptr(&arg_conv); + intptr_t ret_val = DataLossProtect_clone_ptr(&arg_conv); return ret_val; } @@ -25118,11 +25131,11 @@ uint32_t __attribute__((export_name("TS_DataLossProtect_clone"))) TS_DataLossPr orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25142,7 +25155,7 @@ int8_tArray __attribute__((export_name("TS_ChannelReestablish_get_channel_id")) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ChannelReestablish_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -25154,7 +25167,7 @@ void __attribute__((export_name("TS_ChannelReestablish_set_channel_id"))) TS_Ch CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref); } @@ -25194,22 +25207,22 @@ void __attribute__((export_name("TS_ChannelReestablish_set_next_remote_commitme static inline uintptr_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) { LDKChannelReestablish ret_var = ChannelReestablish_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelReestablish_clone_ptr"))) TS_ChannelReestablish_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelReestablish_clone_ptr"))) TS_ChannelReestablish_clone_ptr(uint32_t arg) { LDKChannelReestablish arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelReestablish_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelReestablish_clone_ptr(&arg_conv); return ret_val; } @@ -25219,11 +25232,11 @@ uint32_t __attribute__((export_name("TS_ChannelReestablish_clone"))) TS_Channel orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25243,7 +25256,7 @@ int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_channel_i this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *AnnouncementSignatures_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -25255,7 +25268,7 @@ void __attribute__((export_name("TS_AnnouncementSignatures_set_channel_id"))) T CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref); } @@ -25281,7 +25294,7 @@ int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_node_sign this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -25293,7 +25306,7 @@ void __attribute__((export_name("TS_AnnouncementSignatures_set_node_signature") CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref); } @@ -25302,7 +25315,7 @@ int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_bitcoin_s this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -25314,26 +25327,26 @@ void __attribute__((export_name("TS_AnnouncementSignatures_set_bitcoin_signatur CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref); } uint32_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) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKSignature node_signature_arg_ref; CHECK(node_signature_arg->arr_len == 64); - memcpy(node_signature_arg_ref.compact_form, node_signature_arg->elems, 64); + memcpy(node_signature_arg_ref.compact_form, node_signature_arg->elems, 64); FREE(node_signature_arg); LDKSignature bitcoin_signature_arg_ref; CHECK(bitcoin_signature_arg->arr_len == 64); - memcpy(bitcoin_signature_arg_ref.compact_form, bitcoin_signature_arg->elems, 64); + memcpy(bitcoin_signature_arg_ref.compact_form, bitcoin_signature_arg->elems, 64); FREE(bitcoin_signature_arg); LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25342,22 +25355,22 @@ uint32_t __attribute__((export_name("TS_AnnouncementSignatures_new"))) TS_Annou static inline uintptr_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) { LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_AnnouncementSignatures_clone_ptr"))) TS_AnnouncementSignatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_AnnouncementSignatures_clone_ptr"))) TS_AnnouncementSignatures_clone_ptr(uint32_t arg) { LDKAnnouncementSignatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = AnnouncementSignatures_clone_ptr(&arg_conv); + intptr_t ret_val = AnnouncementSignatures_clone_ptr(&arg_conv); return ret_val; } @@ -25367,11 +25380,11 @@ uint32_t __attribute__((export_name("TS_AnnouncementSignatures_clone"))) TS_Ann orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25380,7 +25393,7 @@ uint32_t __attribute__((export_name("TS_AnnouncementSignatures_clone"))) TS_Ann void __attribute__((export_name("TS_NetAddress_free"))) TS_NetAddress_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -25390,12 +25403,12 @@ void __attribute__((export_name("TS_NetAddress_free"))) TS_NetAddress_free(uint static inline uintptr_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) { LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_NetAddress_clone_ptr"))) TS_NetAddress_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NetAddress_clone_ptr"))) TS_NetAddress_clone_ptr(uint32_t arg) { LDKNetAddress* arg_conv = (LDKNetAddress*)arg; - int64_t ret_val = NetAddress_clone_ptr(arg_conv); + intptr_t ret_val = NetAddress_clone_ptr(arg_conv); return ret_val; } @@ -25403,54 +25416,54 @@ uint32_t __attribute__((export_name("TS_NetAddress_clone"))) TS_NetAddress_clon LDKNetAddress* orig_conv = (LDKNetAddress*)orig; LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_NetAddress_ipv4"))) TS_NetAddress_ipv4(int8_tArray addr, int16_t port) { LDKFourBytes addr_ref; CHECK(addr->arr_len == 4); - memcpy(addr_ref.data, addr->elems, 4); + memcpy(addr_ref.data, addr->elems, 4); FREE(addr); LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_ipv4(addr_ref, port); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_NetAddress_ipv6"))) TS_NetAddress_ipv6(int8_tArray addr, int16_t port) { LDKSixteenBytes addr_ref; CHECK(addr->arr_len == 16); - memcpy(addr_ref.data, addr->elems, 16); + memcpy(addr_ref.data, addr->elems, 16); FREE(addr); LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_ipv6(addr_ref, port); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_NetAddress_onion_v2"))) TS_NetAddress_onion_v2(int8_tArray a) { LDKTwelveBytes a_ref; CHECK(a->arr_len == 12); - memcpy(a_ref.data, a->elems, 12); + memcpy(a_ref.data, a->elems, 12); FREE(a); LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_onion_v2(a_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_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) { LDKThirtyTwoBytes ed25519_pubkey_ref; CHECK(ed25519_pubkey->arr_len == 32); - memcpy(ed25519_pubkey_ref.data, ed25519_pubkey->elems, 32); + memcpy(ed25519_pubkey_ref.data, ed25519_pubkey->elems, 32); FREE(ed25519_pubkey); LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_NetAddress_write"))) TS_NetAddress_write(uint32_t obj) { LDKNetAddress* obj_conv = (LDKNetAddress*)obj; LDKCVec_u8Z ret_var = NetAddress_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -25459,10 +25472,10 @@ int8_tArray __attribute__((export_name("TS_NetAddress_write"))) TS_NetAddress_w uint32_t __attribute__((export_name("TS_NetAddress_read"))) TS_NetAddress_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = NetAddress_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_UnsignedNodeAnnouncement_free"))) TS_UnsignedNodeAnnouncement_free(uint32_t this_obj) { @@ -25479,11 +25492,11 @@ uint32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_features") this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25525,7 +25538,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_node_id this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25537,7 +25550,7 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_node_id"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref); } @@ -25546,7 +25559,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_rgb"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(3); + int8_tArray ret_arr = init_int8_tArray(3, __LINE__); memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv), 3); return ret_arr; } @@ -25558,7 +25571,7 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_rgb"))) TS_Uns CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK(val->arr_len == 3); - memcpy(val_ref.data, val->elems, 3); + memcpy(val_ref.data, val->elems, 3); FREE(val); UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref); } @@ -25567,7 +25580,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_alias") this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv), 32); return ret_arr; } @@ -25579,7 +25592,7 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_alias"))) TS_U CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref); } @@ -25594,13 +25607,13 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_addresses"))) val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t m = 0; m < val_constr.datalen; m++) { uint32_t val_conv_12 = val_vals[m]; - void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1); + void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1); CHECK_ACCESS(val_conv_12_ptr); LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr); - val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1)); + val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1)); val_constr.data[m] = val_conv_12_conv; } UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); @@ -25608,22 +25621,22 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_addresses"))) static inline uintptr_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone_ptr"))) TS_UnsignedNodeAnnouncement_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone_ptr"))) TS_UnsignedNodeAnnouncement_clone_ptr(uint32_t arg) { LDKUnsignedNodeAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); + intptr_t ret_val = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); return ret_val; } @@ -25633,11 +25646,11 @@ uint32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone"))) TS_U orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25657,7 +25670,7 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncement_get_signature"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -25669,7 +25682,7 @@ void __attribute__((export_name("TS_NodeAnnouncement_set_signature"))) TS_NodeA CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); NodeAnnouncement_set_signature(&this_ptr_conv, val_ref); } @@ -25679,11 +25692,11 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncement_get_contents"))) TS_No this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25706,18 +25719,18 @@ void __attribute__((export_name("TS_NodeAnnouncement_set_contents"))) TS_NodeAn uint32_t __attribute__((export_name("TS_NodeAnnouncement_new"))) TS_NodeAnnouncement_new(int8_tArray signature_arg, uint32_t contents_arg) { LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKUnsignedNodeAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25726,22 +25739,22 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncement_new"))) TS_NodeAnnounc static inline uintptr_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) { LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NodeAnnouncement_clone_ptr"))) TS_NodeAnnouncement_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NodeAnnouncement_clone_ptr"))) TS_NodeAnnouncement_clone_ptr(uint32_t arg) { LDKNodeAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NodeAnnouncement_clone_ptr(&arg_conv); + intptr_t ret_val = NodeAnnouncement_clone_ptr(&arg_conv); return ret_val; } @@ -25751,11 +25764,11 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncement_clone"))) TS_NodeAnnou orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25776,11 +25789,11 @@ uint32_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_feature this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25805,7 +25818,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_chai this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -25817,7 +25830,7 @@ void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_chain_hash" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref); } @@ -25843,7 +25856,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25855,7 +25868,7 @@ void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_1") CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref); } @@ -25864,7 +25877,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25876,7 +25889,7 @@ void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_2") CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref); } @@ -25885,7 +25898,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitc this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25897,7 +25910,7 @@ void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref); } @@ -25906,7 +25919,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitc this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25918,28 +25931,28 @@ void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref); } static inline uintptr_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) { LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone_ptr"))) TS_UnsignedChannelAnnouncement_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone_ptr"))) TS_UnsignedChannelAnnouncement_clone_ptr(uint32_t arg) { LDKUnsignedChannelAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); + intptr_t ret_val = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); return ret_val; } @@ -25949,11 +25962,11 @@ uint32_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone"))) T orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25973,7 +25986,7 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signatu this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -25985,7 +25998,7 @@ void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_1")) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref); } @@ -25994,7 +26007,7 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signatu this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -26006,7 +26019,7 @@ void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_2")) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref); } @@ -26015,7 +26028,7 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_sign this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -26027,7 +26040,7 @@ void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_1 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref); } @@ -26036,7 +26049,7 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_sign this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -26048,7 +26061,7 @@ void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_2 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref); } @@ -26058,11 +26071,11 @@ uint32_t __attribute__((export_name("TS_ChannelAnnouncement_get_contents"))) TS this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26085,27 +26098,27 @@ void __attribute__((export_name("TS_ChannelAnnouncement_set_contents"))) TS_Cha uint32_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, uint32_t contents_arg) { LDKSignature node_signature_1_arg_ref; CHECK(node_signature_1_arg->arr_len == 64); - memcpy(node_signature_1_arg_ref.compact_form, node_signature_1_arg->elems, 64); + memcpy(node_signature_1_arg_ref.compact_form, node_signature_1_arg->elems, 64); FREE(node_signature_1_arg); LDKSignature node_signature_2_arg_ref; CHECK(node_signature_2_arg->arr_len == 64); - memcpy(node_signature_2_arg_ref.compact_form, node_signature_2_arg->elems, 64); + memcpy(node_signature_2_arg_ref.compact_form, node_signature_2_arg->elems, 64); FREE(node_signature_2_arg); LDKSignature bitcoin_signature_1_arg_ref; CHECK(bitcoin_signature_1_arg->arr_len == 64); - memcpy(bitcoin_signature_1_arg_ref.compact_form, bitcoin_signature_1_arg->elems, 64); + memcpy(bitcoin_signature_1_arg_ref.compact_form, bitcoin_signature_1_arg->elems, 64); FREE(bitcoin_signature_1_arg); LDKSignature bitcoin_signature_2_arg_ref; CHECK(bitcoin_signature_2_arg->arr_len == 64); - memcpy(bitcoin_signature_2_arg_ref.compact_form, bitcoin_signature_2_arg->elems, 64); + memcpy(bitcoin_signature_2_arg_ref.compact_form, bitcoin_signature_2_arg->elems, 64); FREE(bitcoin_signature_2_arg); LDKUnsignedChannelAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26114,22 +26127,22 @@ uint32_t __attribute__((export_name("TS_ChannelAnnouncement_new"))) TS_ChannelA static inline uintptr_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) { LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelAnnouncement_clone_ptr"))) TS_ChannelAnnouncement_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelAnnouncement_clone_ptr"))) TS_ChannelAnnouncement_clone_ptr(uint32_t arg) { LDKChannelAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelAnnouncement_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelAnnouncement_clone_ptr(&arg_conv); return ret_val; } @@ -26139,11 +26152,11 @@ uint32_t __attribute__((export_name("TS_ChannelAnnouncement_clone"))) TS_Channe orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26163,7 +26176,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_chain_hash this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26175,7 +26188,7 @@ void __attribute__((export_name("TS_UnsignedChannelUpdate_set_chain_hash"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref); } @@ -26300,22 +26313,22 @@ void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_proportional_ static inline uintptr_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone_ptr"))) TS_UnsignedChannelUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone_ptr"))) TS_UnsignedChannelUpdate_clone_ptr(uint32_t arg) { LDKUnsignedChannelUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UnsignedChannelUpdate_clone_ptr(&arg_conv); + intptr_t ret_val = UnsignedChannelUpdate_clone_ptr(&arg_conv); return ret_val; } @@ -26325,11 +26338,11 @@ uint32_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone"))) TS_Unsi orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26349,7 +26362,7 @@ int8_tArray __attribute__((export_name("TS_ChannelUpdate_get_signature"))) TS_C this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -26361,7 +26374,7 @@ void __attribute__((export_name("TS_ChannelUpdate_set_signature"))) TS_ChannelU CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ChannelUpdate_set_signature(&this_ptr_conv, val_ref); } @@ -26371,11 +26384,11 @@ uint32_t __attribute__((export_name("TS_ChannelUpdate_get_contents"))) TS_Chann this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26398,18 +26411,18 @@ void __attribute__((export_name("TS_ChannelUpdate_set_contents"))) TS_ChannelUp uint32_t __attribute__((export_name("TS_ChannelUpdate_new"))) TS_ChannelUpdate_new(int8_tArray signature_arg, uint32_t contents_arg) { LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKUnsignedChannelUpdate contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26418,22 +26431,22 @@ uint32_t __attribute__((export_name("TS_ChannelUpdate_new"))) TS_ChannelUpdate_ static inline uintptr_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelUpdate_clone_ptr"))) TS_ChannelUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelUpdate_clone_ptr"))) TS_ChannelUpdate_clone_ptr(uint32_t arg) { LDKChannelUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelUpdate_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelUpdate_clone_ptr(&arg_conv); return ret_val; } @@ -26443,11 +26456,11 @@ uint32_t __attribute__((export_name("TS_ChannelUpdate_clone"))) TS_ChannelUpdat orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26467,7 +26480,7 @@ int8_tArray __attribute__((export_name("TS_QueryChannelRange_get_chain_hash"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *QueryChannelRange_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26479,7 +26492,7 @@ void __attribute__((export_name("TS_QueryChannelRange_set_chain_hash"))) TS_Que CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref); } @@ -26520,13 +26533,13 @@ void __attribute__((export_name("TS_QueryChannelRange_set_number_of_blocks"))) uint32_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) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26535,22 +26548,22 @@ uint32_t __attribute__((export_name("TS_QueryChannelRange_new"))) TS_QueryChann static inline uintptr_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_QueryChannelRange_clone_ptr"))) TS_QueryChannelRange_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_QueryChannelRange_clone_ptr"))) TS_QueryChannelRange_clone_ptr(uint32_t arg) { LDKQueryChannelRange arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = QueryChannelRange_clone_ptr(&arg_conv); + intptr_t ret_val = QueryChannelRange_clone_ptr(&arg_conv); return ret_val; } @@ -26560,11 +26573,11 @@ uint32_t __attribute__((export_name("TS_QueryChannelRange_clone"))) TS_QueryCha orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26584,7 +26597,7 @@ int8_tArray __attribute__((export_name("TS_ReplyChannelRange_get_chain_hash"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ReplyChannelRange_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26596,7 +26609,7 @@ void __attribute__((export_name("TS_ReplyChannelRange_set_chain_hash"))) TS_Rep CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref); } @@ -26662,7 +26675,7 @@ void __attribute__((export_name("TS_ReplyChannelRange_set_short_channel_ids"))) val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else val_constr.data = NULL; - int64_t* val_vals = val->elems; + int64_t* val_vals = val->elems /* XXX val leaks */; for (size_t i = 0; i < val_constr.datalen; i++) { int64_t val_conv_8 = val_vals[i]; val_constr.data[i] = val_conv_8; @@ -26673,24 +26686,24 @@ void __attribute__((export_name("TS_ReplyChannelRange_set_short_channel_ids"))) uint32_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) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); LDKCVec_u64Z short_channel_ids_arg_constr; short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len; if (short_channel_ids_arg_constr.datalen > 0) short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else short_channel_ids_arg_constr.data = NULL; - int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems; + int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems /* XXX short_channel_ids_arg leaks */; for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) { int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i]; short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8; } LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26699,22 +26712,22 @@ uint32_t __attribute__((export_name("TS_ReplyChannelRange_new"))) TS_ReplyChann static inline uintptr_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ReplyChannelRange_clone_ptr"))) TS_ReplyChannelRange_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ReplyChannelRange_clone_ptr"))) TS_ReplyChannelRange_clone_ptr(uint32_t arg) { LDKReplyChannelRange arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ReplyChannelRange_clone_ptr(&arg_conv); + intptr_t ret_val = ReplyChannelRange_clone_ptr(&arg_conv); return ret_val; } @@ -26724,11 +26737,11 @@ uint32_t __attribute__((export_name("TS_ReplyChannelRange_clone"))) TS_ReplyCha orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26748,7 +26761,7 @@ int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_chain_hash" this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26760,7 +26773,7 @@ void __attribute__((export_name("TS_QueryShortChannelIds_set_chain_hash"))) TS_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref); } @@ -26775,7 +26788,7 @@ void __attribute__((export_name("TS_QueryShortChannelIds_set_short_channel_ids" val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else val_constr.data = NULL; - int64_t* val_vals = val->elems; + int64_t* val_vals = val->elems /* XXX val leaks */; for (size_t i = 0; i < val_constr.datalen; i++) { int64_t val_conv_8 = val_vals[i]; val_constr.data[i] = val_conv_8; @@ -26786,24 +26799,24 @@ void __attribute__((export_name("TS_QueryShortChannelIds_set_short_channel_ids" uint32_t __attribute__((export_name("TS_QueryShortChannelIds_new"))) TS_QueryShortChannelIds_new(int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); LDKCVec_u64Z short_channel_ids_arg_constr; short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len; if (short_channel_ids_arg_constr.datalen > 0) short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else short_channel_ids_arg_constr.data = NULL; - int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems; + int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems /* XXX short_channel_ids_arg leaks */; for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) { int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i]; short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8; } LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26812,22 +26825,22 @@ uint32_t __attribute__((export_name("TS_QueryShortChannelIds_new"))) TS_QuerySh static inline uintptr_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_QueryShortChannelIds_clone_ptr"))) TS_QueryShortChannelIds_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_QueryShortChannelIds_clone_ptr"))) TS_QueryShortChannelIds_clone_ptr(uint32_t arg) { LDKQueryShortChannelIds arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = QueryShortChannelIds_clone_ptr(&arg_conv); + intptr_t ret_val = QueryShortChannelIds_clone_ptr(&arg_conv); return ret_val; } @@ -26837,11 +26850,11 @@ uint32_t __attribute__((export_name("TS_QueryShortChannelIds_clone"))) TS_Query orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26861,7 +26874,7 @@ int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_chain_ha this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26873,7 +26886,7 @@ void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_chain_hash"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref); } @@ -26897,13 +26910,13 @@ void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_full_informatio uint32_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_new"))) TS_ReplyShortChannelIdsEnd_new(int8_tArray chain_hash_arg, jboolean full_information_arg) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26912,22 +26925,22 @@ uint32_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_new"))) TS_Repl static inline uintptr_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone_ptr"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone_ptr"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint32_t arg) { LDKReplyShortChannelIdsEnd arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); + intptr_t ret_val = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); return ret_val; } @@ -26937,11 +26950,11 @@ uint32_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone"))) TS_Re orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26961,7 +26974,7 @@ int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_get_chain_hash this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26973,7 +26986,7 @@ void __attribute__((export_name("TS_GossipTimestampFilter_set_chain_hash"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref); } @@ -27014,13 +27027,13 @@ void __attribute__((export_name("TS_GossipTimestampFilter_set_timestamp_range") uint32_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) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27029,22 +27042,22 @@ uint32_t __attribute__((export_name("TS_GossipTimestampFilter_new"))) TS_Gossip static inline uintptr_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_GossipTimestampFilter_clone_ptr"))) TS_GossipTimestampFilter_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_GossipTimestampFilter_clone_ptr"))) TS_GossipTimestampFilter_clone_ptr(uint32_t arg) { LDKGossipTimestampFilter arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = GossipTimestampFilter_clone_ptr(&arg_conv); + intptr_t ret_val = GossipTimestampFilter_clone_ptr(&arg_conv); return ret_val; } @@ -27054,11 +27067,11 @@ uint32_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_Goss orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27067,7 +27080,7 @@ uint32_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_Goss void __attribute__((export_name("TS_ErrorAction_free"))) TS_ErrorAction_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -27077,12 +27090,12 @@ void __attribute__((export_name("TS_ErrorAction_free"))) TS_ErrorAction_free(ui static inline uintptr_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_ErrorAction_clone_ptr"))) TS_ErrorAction_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ErrorAction_clone_ptr"))) TS_ErrorAction_clone_ptr(uint32_t arg) { LDKErrorAction* arg_conv = (LDKErrorAction*)arg; - int64_t ret_val = ErrorAction_clone_ptr(arg_conv); + intptr_t ret_val = ErrorAction_clone_ptr(arg_conv); return ret_val; } @@ -27090,7 +27103,7 @@ uint32_t __attribute__((export_name("TS_ErrorAction_clone"))) TS_ErrorAction_cl LDKErrorAction* orig_conv = (LDKErrorAction*)orig; LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -27102,14 +27115,14 @@ uint32_t __attribute__((export_name("TS_ErrorAction_disconnect_peer"))) TS_Erro msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_disconnect_peer(msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ErrorAction_ignore_error"))) TS_ErrorAction_ignore_error() { LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_ignore_error(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -27117,14 +27130,14 @@ uint32_t __attribute__((export_name("TS_ErrorAction_ignore_and_log"))) TS_Error LDKLevel a_conv = LDKLevel_from_js(a); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_ignore_and_log(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ErrorAction_ignore_duplicate_gossip"))) TS_ErrorAction_ignore_duplicate_gossip() { LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_ignore_duplicate_gossip(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -27136,7 +27149,7 @@ uint32_t __attribute__((export_name("TS_ErrorAction_send_error_message"))) TS_E msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_send_error_message(msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -27175,7 +27188,7 @@ uint32_t __attribute__((export_name("TS_LightningError_get_action"))) TS_Lightn CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = LightningError_get_action(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -27184,25 +27197,25 @@ void __attribute__((export_name("TS_LightningError_set_action"))) TS_LightningE this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); - val_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)val) & ~1)); + val_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)val) & ~1)); LightningError_set_action(&this_ptr_conv, val_conv); } uint32_t __attribute__((export_name("TS_LightningError_new"))) TS_LightningError_new(jstring err_arg, uint32_t action_arg) { LDKStr err_arg_conv = str_ref_to_owned_c(err_arg); - void* action_arg_ptr = (void*)(((uint64_t)action_arg) & ~1); + void* action_arg_ptr = (void*)(((uintptr_t)action_arg) & ~1); CHECK_ACCESS(action_arg_ptr); LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr); - action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action_arg) & ~1)); + action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)action_arg) & ~1)); LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27211,22 +27224,22 @@ uint32_t __attribute__((export_name("TS_LightningError_new"))) TS_LightningErro static inline uintptr_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { LDKLightningError ret_var = LightningError_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_LightningError_clone_ptr"))) TS_LightningError_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_LightningError_clone_ptr"))) TS_LightningError_clone_ptr(uint32_t arg) { LDKLightningError arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = LightningError_clone_ptr(&arg_conv); + intptr_t ret_val = LightningError_clone_ptr(&arg_conv); return ret_val; } @@ -27236,11 +27249,11 @@ uint32_t __attribute__((export_name("TS_LightningError_clone"))) TS_LightningEr orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKLightningError ret_var = LightningError_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27262,15 +27275,15 @@ uint32_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_add_ht CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t p = 0; p < ret_var.datalen; p++) { LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p]; - uint64_t ret_conv_15_ref = 0; - CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_15_ref = 0; + CHECK((((uintptr_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); - ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner; + ret_conv_15_ref = (uintptr_t)ret_conv_15_var.inner; if (ret_conv_15_var.is_owned) { ret_conv_15_ref |= 1; } @@ -27292,7 +27305,7 @@ void __attribute__((export_name("TS_CommitmentUpdate_set_update_add_htlcs"))) T val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t p = 0; p < val_constr.datalen; p++) { uint32_t val_conv_15 = val_vals[p]; LDKUpdateAddHTLC val_conv_15_conv; @@ -27312,15 +27325,15 @@ uint32_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fulfil CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t t = 0; t < ret_var.datalen; t++) { LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t]; - uint64_t ret_conv_19_ref = 0; - CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_19_ref = 0; + CHECK((((uintptr_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); - ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner; + ret_conv_19_ref = (uintptr_t)ret_conv_19_var.inner; if (ret_conv_19_var.is_owned) { ret_conv_19_ref |= 1; } @@ -27342,7 +27355,7 @@ void __attribute__((export_name("TS_CommitmentUpdate_set_update_fulfill_htlcs") val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t t = 0; t < val_constr.datalen; t++) { uint32_t val_conv_19 = val_vals[t]; LDKUpdateFulfillHTLC val_conv_19_conv; @@ -27362,15 +27375,15 @@ uint32_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_h CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t q = 0; q < ret_var.datalen; q++) { LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q]; - uint64_t ret_conv_16_ref = 0; - CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; } @@ -27392,7 +27405,7 @@ void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_htlcs"))) val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t q = 0; q < val_constr.datalen; q++) { uint32_t val_conv_16 = val_vals[q]; LDKUpdateFailHTLC val_conv_16_conv; @@ -27412,15 +27425,15 @@ uint32_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_m CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t z = 0; z < ret_var.datalen; z++) { LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z]; - uint64_t ret_conv_25_ref = 0; - CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_25_ref = 0; + CHECK((((uintptr_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); - ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner; + ret_conv_25_ref = (uintptr_t)ret_conv_25_var.inner; if (ret_conv_25_var.is_owned) { ret_conv_25_ref |= 1; } @@ -27442,7 +27455,7 @@ void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_malformed_ val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t z = 0; z < val_constr.datalen; z++) { uint32_t val_conv_25 = val_vals[z]; LDKUpdateFailMalformedHTLC val_conv_25_conv; @@ -27461,12 +27474,12 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_get_update_fee"))) TS_ this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27493,11 +27506,11 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_get_commitment_signed" this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27524,7 +27537,7 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); else update_add_htlcs_arg_constr.data = NULL; - uint32_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems; + uint32_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems /* XXX update_add_htlcs_arg leaks */; for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) { uint32_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p]; LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; @@ -27540,7 +27553,7 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); else update_fulfill_htlcs_arg_constr.data = NULL; - uint32_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems; + uint32_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems /* XXX update_fulfill_htlcs_arg leaks */; for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) { uint32_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t]; LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; @@ -27556,7 +27569,7 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); else update_fail_htlcs_arg_constr.data = NULL; - uint32_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems; + uint32_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems /* XXX update_fail_htlcs_arg leaks */; for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) { uint32_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q]; LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; @@ -27572,7 +27585,7 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); else update_fail_malformed_htlcs_arg_constr.data = NULL; - uint32_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems; + uint32_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems /* XXX update_fail_malformed_htlcs_arg leaks */; for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) { uint32_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z]; LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; @@ -27593,11 +27606,11 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27606,22 +27619,22 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU static inline uintptr_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_CommitmentUpdate_clone_ptr"))) TS_CommitmentUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CommitmentUpdate_clone_ptr"))) TS_CommitmentUpdate_clone_ptr(uint32_t arg) { LDKCommitmentUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = CommitmentUpdate_clone_ptr(&arg_conv); + intptr_t ret_val = CommitmentUpdate_clone_ptr(&arg_conv); return ret_val; } @@ -27631,11 +27644,11 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_Commitmen orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27644,7 +27657,7 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_Commitmen void __attribute__((export_name("TS_ChannelMessageHandler_free"))) TS_ChannelMessageHandler_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -27653,7 +27666,7 @@ void __attribute__((export_name("TS_ChannelMessageHandler_free"))) TS_ChannelMe void __attribute__((export_name("TS_RoutingMessageHandler_free"))) TS_RoutingMessageHandler_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -27666,7 +27679,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_write"))) TS_AcceptCha obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27675,10 +27688,10 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_write"))) TS_AcceptCha uint32_t __attribute__((export_name("TS_AcceptChannel_read"))) TS_AcceptChannel_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = AcceptChannel_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_AnnouncementSignatures_write(uint32_t obj) { @@ -27687,7 +27700,7 @@ int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27696,10 +27709,10 @@ int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_ uint32_t __attribute__((export_name("TS_AnnouncementSignatures_read"))) TS_AnnouncementSignatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = AnnouncementSignatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_ChannelReestablish_write(uint32_t obj) { @@ -27708,7 +27721,7 @@ int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_Chan obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27717,10 +27730,10 @@ int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_Chan uint32_t __attribute__((export_name("TS_ChannelReestablish_read"))) TS_ChannelReestablish_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = ChannelReestablish_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSigned_write(uint32_t obj) { @@ -27729,7 +27742,7 @@ int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSi obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27738,10 +27751,10 @@ int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSi uint32_t __attribute__((export_name("TS_ClosingSigned_read"))) TS_ClosingSigned_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = ClosingSigned_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_ClosingSignedFeeRange_write(uint32_t obj) { @@ -27750,7 +27763,7 @@ int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_C obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27759,10 +27772,10 @@ int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_C uint32_t __attribute__((export_name("TS_ClosingSignedFeeRange_read"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = ClosingSignedFeeRange_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_CommitmentSigned_write(uint32_t obj) { @@ -27771,7 +27784,7 @@ int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_Commit obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27780,10 +27793,10 @@ int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_Commit uint32_t __attribute__((export_name("TS_CommitmentSigned_read"))) TS_CommitmentSigned_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CommitmentSigned_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingCreated_write(uint32_t obj) { @@ -27792,7 +27805,7 @@ int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingC obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27801,10 +27814,10 @@ int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingC uint32_t __attribute__((export_name("TS_FundingCreated_read"))) TS_FundingCreated_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = FundingCreated_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSigned_write(uint32_t obj) { @@ -27813,7 +27826,7 @@ int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSi obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27822,10 +27835,10 @@ int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSi uint32_t __attribute__((export_name("TS_FundingSigned_read"))) TS_FundingSigned_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = FundingSigned_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_FundingLocked_write"))) TS_FundingLocked_write(uint32_t obj) { @@ -27834,7 +27847,7 @@ int8_tArray __attribute__((export_name("TS_FundingLocked_write"))) TS_FundingLo obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27843,10 +27856,10 @@ int8_tArray __attribute__((export_name("TS_FundingLocked_write"))) TS_FundingLo uint32_t __attribute__((export_name("TS_FundingLocked_read"))) TS_FundingLocked_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = FundingLocked_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint32_t obj) { @@ -27855,7 +27868,7 @@ int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint32_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Init_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27864,10 +27877,10 @@ int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint32_ uint32_t __attribute__((export_name("TS_Init_read"))) TS_Init_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = Init_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel_write(uint32_t obj) { @@ -27876,7 +27889,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27885,10 +27898,10 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel uint32_t __attribute__((export_name("TS_OpenChannel_read"))) TS_OpenChannel_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = OpenChannel_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndACK_write(uint32_t obj) { @@ -27897,7 +27910,7 @@ int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndA obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27906,10 +27919,10 @@ int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndA uint32_t __attribute__((export_name("TS_RevokeAndACK_read"))) TS_RevokeAndACK_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = RevokeAndACK_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write(uint32_t obj) { @@ -27918,7 +27931,7 @@ int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27927,10 +27940,10 @@ int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write uint32_t __attribute__((export_name("TS_Shutdown_read"))) TS_Shutdown_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = Shutdown_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFailHTLC_write(uint32_t obj) { @@ -27939,7 +27952,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFa obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27948,10 +27961,10 @@ int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFa uint32_t __attribute__((export_name("TS_UpdateFailHTLC_read"))) TS_UpdateFailHTLC_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = UpdateFailHTLC_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS_UpdateFailMalformedHTLC_write(uint32_t obj) { @@ -27960,7 +27973,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27969,10 +27982,10 @@ int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS uint32_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_read"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = UpdateFailMalformedHTLC_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_write(uint32_t obj) { @@ -27981,7 +27994,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_wri obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27990,10 +28003,10 @@ int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_wri uint32_t __attribute__((export_name("TS_UpdateFee_read"))) TS_UpdateFee_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = UpdateFee_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_UpdateFulfillHTLC_write(uint32_t obj) { @@ -28002,7 +28015,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_Updat obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28011,10 +28024,10 @@ int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_Updat uint32_t __attribute__((export_name("TS_UpdateFulfillHTLC_read"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = UpdateFulfillHTLC_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAddHTLC_write(uint32_t obj) { @@ -28023,7 +28036,7 @@ int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAdd obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28032,10 +28045,10 @@ int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAdd uint32_t __attribute__((export_name("TS_UpdateAddHTLC_read"))) TS_UpdateAddHTLC_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = UpdateAddHTLC_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint32_t obj) { @@ -28044,7 +28057,7 @@ int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint32_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Ping_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28053,10 +28066,10 @@ int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint32_ uint32_t __attribute__((export_name("TS_Ping_read"))) TS_Ping_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = Ping_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint32_t obj) { @@ -28065,7 +28078,7 @@ int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint32_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Pong_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28074,10 +28087,10 @@ int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint32_ uint32_t __attribute__((export_name("TS_Pong_read"))) TS_Pong_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = Pong_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write"))) TS_UnsignedChannelAnnouncement_write(uint32_t obj) { @@ -28086,7 +28099,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write")) obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28095,10 +28108,10 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write")) uint32_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_read"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = UnsignedChannelAnnouncement_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_ChannelAnnouncement_write(uint32_t obj) { @@ -28107,7 +28120,7 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_Cha obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28116,10 +28129,10 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_Cha uint32_t __attribute__((export_name("TS_ChannelAnnouncement_read"))) TS_ChannelAnnouncement_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = ChannelAnnouncement_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_UnsignedChannelUpdate_write(uint32_t obj) { @@ -28128,7 +28141,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_U obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28137,10 +28150,10 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_U uint32_t __attribute__((export_name("TS_UnsignedChannelUpdate_read"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = UnsignedChannelUpdate_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUpdate_write(uint32_t obj) { @@ -28149,7 +28162,7 @@ int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUp obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28158,10 +28171,10 @@ int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUp uint32_t __attribute__((export_name("TS_ChannelUpdate_read"))) TS_ChannelUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = ChannelUpdate_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessage_write(uint32_t obj) { @@ -28170,7 +28183,7 @@ int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessa obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28179,10 +28192,10 @@ int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessa uint32_t __attribute__((export_name("TS_ErrorMessage_read"))) TS_ErrorMessage_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = ErrorMessage_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) TS_UnsignedNodeAnnouncement_write(uint32_t obj) { @@ -28191,7 +28204,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) T obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28200,10 +28213,10 @@ int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) T uint32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_read"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = UnsignedNodeAnnouncement_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAnnouncement_write(uint32_t obj) { @@ -28212,7 +28225,7 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAn obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28221,19 +28234,19 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAn uint32_t __attribute__((export_name("TS_NodeAnnouncement_read"))) TS_NodeAnnouncement_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = NodeAnnouncement_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_QueryShortChannelIds_read"))) TS_QueryShortChannelIds_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = QueryShortChannelIds_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_write"))) TS_QueryShortChannelIds_write(uint32_t obj) { @@ -28242,7 +28255,7 @@ int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_write"))) TS_Qu obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28254,7 +28267,7 @@ int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_write"))) TS obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28263,10 +28276,10 @@ int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_write"))) TS uint32_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_read"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int32_t __attribute__((export_name("TS_QueryChannelRange_end_blocknum"))) TS_QueryChannelRange_end_blocknum(uint32_t this_arg) { @@ -28284,7 +28297,7 @@ int8_tArray __attribute__((export_name("TS_QueryChannelRange_write"))) TS_Query obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28293,19 +28306,19 @@ int8_tArray __attribute__((export_name("TS_QueryChannelRange_write"))) TS_Query uint32_t __attribute__((export_name("TS_QueryChannelRange_read"))) TS_QueryChannelRange_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = QueryChannelRange_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ReplyChannelRange_read"))) TS_ReplyChannelRange_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = ReplyChannelRange_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ReplyChannelRange_write"))) TS_ReplyChannelRange_write(uint32_t obj) { @@ -28314,7 +28327,7 @@ int8_tArray __attribute__((export_name("TS_ReplyChannelRange_write"))) TS_Reply obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28326,7 +28339,7 @@ int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_write"))) TS_G obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28335,15 +28348,15 @@ int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_write"))) TS_G uint32_t __attribute__((export_name("TS_GossipTimestampFilter_read"))) TS_GossipTimestampFilter_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = GossipTimestampFilter_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CustomMessageHandler_free"))) TS_CustomMessageHandler_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -28360,11 +28373,11 @@ void __attribute__((export_name("TS_IgnoringMessageHandler_free"))) TS_Ignoring uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_new"))) TS_IgnoringMessageHandler_new() { LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28378,7 +28391,7 @@ uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_MessageSendEv CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_RoutingMessageHandler"))) TS_IgnoringMessageHandler_as_RoutingMessageHandler(uint32_t this_arg) { @@ -28388,7 +28401,7 @@ uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_RoutingMessag CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageReader"))) TS_IgnoringMessageHandler_as_CustomMessageReader(uint32_t this_arg) { @@ -28398,7 +28411,7 @@ uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessage CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageHandler"))) TS_IgnoringMessageHandler_as_CustomMessageHandler(uint32_t this_arg) { @@ -28408,7 +28421,7 @@ uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessage CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_ErroringMessageHandler_free"))) TS_ErroringMessageHandler_free(uint32_t this_obj) { @@ -28421,11 +28434,11 @@ void __attribute__((export_name("TS_ErroringMessageHandler_free"))) TS_Erroring uint32_t __attribute__((export_name("TS_ErroringMessageHandler_new"))) TS_ErroringMessageHandler_new() { LDKErroringMessageHandler ret_var = ErroringMessageHandler_new(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28439,7 +28452,7 @@ uint32_t __attribute__((export_name("TS_ErroringMessageHandler_as_MessageSendEv CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ErroringMessageHandler_as_ChannelMessageHandler"))) TS_ErroringMessageHandler_as_ChannelMessageHandler(uint32_t this_arg) { @@ -28449,7 +28462,7 @@ uint32_t __attribute__((export_name("TS_ErroringMessageHandler_as_ChannelMessag CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_MessageHandler_free"))) TS_MessageHandler_free(uint32_t this_obj) { @@ -28466,7 +28479,7 @@ uint32_t __attribute__((export_name("TS_MessageHandler_get_chan_handler"))) TS_ this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; return ret_ret; } @@ -28475,7 +28488,7 @@ void __attribute__((export_name("TS_MessageHandler_set_chan_handler"))) TS_Mess this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); MessageHandler_set_chan_handler(&this_ptr_conv, val_conv); @@ -28487,7 +28500,7 @@ uint32_t __attribute__((export_name("TS_MessageHandler_get_route_handler"))) TS this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; return ret_ret; } @@ -28496,25 +28509,25 @@ void __attribute__((export_name("TS_MessageHandler_set_route_handler"))) TS_Mes this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); MessageHandler_set_route_handler(&this_ptr_conv, val_conv); } uint32_t __attribute__((export_name("TS_MessageHandler_new"))) TS_MessageHandler_new(uint32_t chan_handler_arg, uint32_t route_handler_arg) { - void* chan_handler_arg_ptr = (void*)(((uint64_t)chan_handler_arg) & ~1); + void* chan_handler_arg_ptr = (void*)(((uintptr_t)chan_handler_arg) & ~1); CHECK_ACCESS(chan_handler_arg_ptr); LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr); - void* route_handler_arg_ptr = (void*)(((uint64_t)route_handler_arg) & ~1); + void* route_handler_arg_ptr = (void*)(((uintptr_t)route_handler_arg) & ~1); CHECK_ACCESS(route_handler_arg_ptr); LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr); LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28524,28 +28537,28 @@ uint32_t __attribute__((export_name("TS_MessageHandler_new"))) TS_MessageHandle static inline uintptr_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); *ret_ret = SocketDescriptor_clone(arg); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } -int64_t __attribute__((export_name("TS_SocketDescriptor_clone_ptr"))) TS_SocketDescriptor_clone_ptr(uint32_t arg) { - void* arg_ptr = (void*)(((uint64_t)arg) & ~1); +intptr_t __attribute__((export_name("TS_SocketDescriptor_clone_ptr"))) TS_SocketDescriptor_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; - int64_t ret_val = SocketDescriptor_clone_ptr(arg_conv); + intptr_t ret_val = SocketDescriptor_clone_ptr(arg_conv); return ret_val; } uint32_t __attribute__((export_name("TS_SocketDescriptor_clone"))) TS_SocketDescriptor_clone(uint32_t orig) { - void* orig_ptr = (void*)(((uint64_t)orig) & ~1); + void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr; LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); *ret_ret = SocketDescriptor_clone(orig_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_SocketDescriptor_free"))) TS_SocketDescriptor_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -28579,11 +28592,11 @@ void __attribute__((export_name("TS_PeerHandleError_set_no_connection_possible" uint32_t __attribute__((export_name("TS_PeerHandleError_new"))) TS_PeerHandleError_new(jboolean no_connection_possible_arg) { LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28592,22 +28605,22 @@ uint32_t __attribute__((export_name("TS_PeerHandleError_new"))) TS_PeerHandleEr static inline uintptr_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { LDKPeerHandleError ret_var = PeerHandleError_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_PeerHandleError_clone_ptr"))) TS_PeerHandleError_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_PeerHandleError_clone_ptr"))) TS_PeerHandleError_clone_ptr(uint32_t arg) { LDKPeerHandleError arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = PeerHandleError_clone_ptr(&arg_conv); + intptr_t ret_val = PeerHandleError_clone_ptr(&arg_conv); return ret_val; } @@ -28617,11 +28630,11 @@ uint32_t __attribute__((export_name("TS_PeerHandleError_clone"))) TS_PeerHandle orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28644,23 +28657,23 @@ uint32_t __attribute__((export_name("TS_PeerManager_new"))) TS_PeerManager_new( // Warning: we need a move here but no clone is available for LDKMessageHandler LDKSecretKey our_node_secret_ref; CHECK(our_node_secret->arr_len == 32); - memcpy(our_node_secret_ref.bytes, our_node_secret->elems, 32); + memcpy(our_node_secret_ref.bytes, our_node_secret->elems, 32); FREE(our_node_secret); unsigned char ephemeral_random_data_arr[32]; CHECK(ephemeral_random_data->arr_len == 32); - memcpy(ephemeral_random_data_arr, ephemeral_random_data->elems, 32); + memcpy(ephemeral_random_data_arr, ephemeral_random_data->elems, 32); FREE(ephemeral_random_data); unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr; - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - void* custom_message_handler_ptr = (void*)(((uint64_t)custom_message_handler) & ~1); + void* custom_message_handler_ptr = (void*)(((uintptr_t)custom_message_handler) & ~1); CHECK_ACCESS(custom_message_handler_ptr); LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr); LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28674,10 +28687,10 @@ ptrArray __attribute__((export_name("TS_PeerManager_get_peer_node_ids"))) TS_Pe CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { - int8_tArray ret_conv_12_arr = init_int8_tArray(33); + int8_tArray ret_conv_12_arr = init_int8_tArray(33, __LINE__); memcpy(ret_conv_12_arr->elems, ret_var.data[m].compressed_form, 33); ret_arr_ptr[m] = ret_conv_12_arr; } @@ -28693,13 +28706,13 @@ uint32_t __attribute__((export_name("TS_PeerManager_new_outbound_connection"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); - void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); CHECK_ACCESS(descriptor_ptr); LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_PeerManager_new_inbound_connection"))) TS_PeerManager_new_inbound_connection(uint32_t this_arg, uint32_t descriptor) { @@ -28707,12 +28720,12 @@ uint32_t __attribute__((export_name("TS_PeerManager_new_inbound_connection"))) this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); CHECK_ACCESS(descriptor_ptr); LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_PeerManager_write_buffer_space_avail"))) TS_PeerManager_write_buffer_space_avail(uint32_t this_arg, uint32_t descriptor) { @@ -28720,12 +28733,12 @@ uint32_t __attribute__((export_name("TS_PeerManager_write_buffer_space_avail")) this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_PeerManager_read_event"))) TS_PeerManager_read_event(uint32_t this_arg, uint32_t peer_descriptor, int8_tArray data) { @@ -28733,15 +28746,15 @@ uint32_t __attribute__((export_name("TS_PeerManager_read_event"))) TS_PeerManag this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* peer_descriptor_ptr = (void*)(((uint64_t)peer_descriptor) & ~1); + void* peer_descriptor_ptr = (void*)(((uintptr_t)peer_descriptor) & ~1); if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); } LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; LDKu8slice data_ref; data_ref.datalen = data->arr_len; - data_ref.data = data->elems; + data_ref.data = data->elems /* XXX data leaks */; LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_PeerManager_process_events"))) TS_PeerManager_process_events(uint32_t this_arg) { @@ -28757,7 +28770,7 @@ void __attribute__((export_name("TS_PeerManager_socket_disconnected"))) TS_Peer this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv); @@ -28770,7 +28783,7 @@ void __attribute__((export_name("TS_PeerManager_disconnect_by_node_id"))) TS_Pe CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible); } @@ -28803,9 +28816,9 @@ int64_t __attribute__((export_name("TS_htlc_timeout_tx_weight"))) TS_htlc_timeo int8_tArray __attribute__((export_name("TS_build_commitment_secret"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) { unsigned char commitment_seed_arr[32]; CHECK(commitment_seed->arr_len == 32); - memcpy(commitment_seed_arr, commitment_seed->elems, 32); + memcpy(commitment_seed_arr, commitment_seed->elems, 32); FREE(commitment_seed); unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, build_commitment_secret(commitment_seed_ref, idx).data, 32); return ret_arr; } @@ -28814,18 +28827,18 @@ int8_tArray __attribute__((export_name("TS_build_closing_transaction"))) TS_bui LDKCVec_u8Z to_holder_script_ref; to_holder_script_ref.datalen = to_holder_script->arr_len; to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); + memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script); LDKCVec_u8Z to_counterparty_script_ref; to_counterparty_script_ref.datalen = to_counterparty_script->arr_len; to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); + memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script); LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); 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); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); Transaction_free(ret_var); return ret_arr; @@ -28834,52 +28847,52 @@ int8_tArray __attribute__((export_name("TS_build_closing_transaction"))) TS_bui uint32_t __attribute__((export_name("TS_derive_private_key"))) TS_derive_private_key(int8_tArray per_commitment_point, int8_tArray base_secret) { LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); unsigned char base_secret_arr[32]; CHECK(base_secret->arr_len == 32); - memcpy(base_secret_arr, base_secret->elems, 32); + memcpy(base_secret_arr, base_secret->elems, 32); FREE(base_secret); unsigned char (*base_secret_ref)[32] = &base_secret_arr; LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_derive_public_key"))) TS_derive_public_key(int8_tArray per_commitment_point, int8_tArray base_point) { LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); LDKPublicKey base_point_ref; CHECK(base_point->arr_len == 33); - memcpy(base_point_ref.compressed_form, base_point->elems, 33); + memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_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) { unsigned char per_commitment_secret_arr[32]; CHECK(per_commitment_secret->arr_len == 32); - memcpy(per_commitment_secret_arr, per_commitment_secret->elems, 32); + memcpy(per_commitment_secret_arr, per_commitment_secret->elems, 32); FREE(per_commitment_secret); unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr; unsigned char countersignatory_revocation_base_secret_arr[32]; CHECK(countersignatory_revocation_base_secret->arr_len == 32); - memcpy(countersignatory_revocation_base_secret_arr, countersignatory_revocation_base_secret->elems, 32); + memcpy(countersignatory_revocation_base_secret_arr, countersignatory_revocation_base_secret->elems, 32); FREE(countersignatory_revocation_base_secret); unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr; LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_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) { LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); LDKPublicKey countersignatory_revocation_base_point_ref; CHECK(countersignatory_revocation_base_point->arr_len == 33); - memcpy(countersignatory_revocation_base_point_ref.compressed_form, countersignatory_revocation_base_point->elems, 33); + memcpy(countersignatory_revocation_base_point_ref.compressed_form, countersignatory_revocation_base_point->elems, 33); FREE(countersignatory_revocation_base_point); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_TxCreationKeys_free"))) TS_TxCreationKeys_free(uint32_t this_obj) { @@ -28895,7 +28908,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_per_commitment_po this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -28907,7 +28920,7 @@ void __attribute__((export_name("TS_TxCreationKeys_set_per_commitment_point"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref); } @@ -28916,7 +28929,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_revocation_key")) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -28928,7 +28941,7 @@ void __attribute__((export_name("TS_TxCreationKeys_set_revocation_key"))) TS_Tx CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref); } @@ -28937,7 +28950,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_htlc_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -28949,7 +28962,7 @@ void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_htlc_key"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref); } @@ -28958,7 +28971,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_countersignatory_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -28970,7 +28983,7 @@ void __attribute__((export_name("TS_TxCreationKeys_set_countersignatory_htlc_ke CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref); } @@ -28979,7 +28992,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_delay this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -28991,32 +29004,32 @@ void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_delayed_paym CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref); } uint32_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) { LDKPublicKey per_commitment_point_arg_ref; CHECK(per_commitment_point_arg->arr_len == 33); - memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); + memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg); LDKPublicKey revocation_key_arg_ref; CHECK(revocation_key_arg->arr_len == 33); - memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); + memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); FREE(revocation_key_arg); LDKPublicKey broadcaster_htlc_key_arg_ref; CHECK(broadcaster_htlc_key_arg->arr_len == 33); - memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); + memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); FREE(broadcaster_htlc_key_arg); LDKPublicKey countersignatory_htlc_key_arg_ref; CHECK(countersignatory_htlc_key_arg->arr_len == 33); - memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); + memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); FREE(countersignatory_htlc_key_arg); LDKPublicKey broadcaster_delayed_payment_key_arg_ref; CHECK(broadcaster_delayed_payment_key_arg->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); + memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); FREE(broadcaster_delayed_payment_key_arg); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29025,22 +29038,22 @@ uint32_t __attribute__((export_name("TS_TxCreationKeys_new"))) TS_TxCreationKey static inline uintptr_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_TxCreationKeys_clone_ptr"))) TS_TxCreationKeys_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_TxCreationKeys_clone_ptr"))) TS_TxCreationKeys_clone_ptr(uint32_t arg) { LDKTxCreationKeys arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = TxCreationKeys_clone_ptr(&arg_conv); + intptr_t ret_val = TxCreationKeys_clone_ptr(&arg_conv); return ret_val; } @@ -29050,11 +29063,11 @@ uint32_t __attribute__((export_name("TS_TxCreationKeys_clone"))) TS_TxCreationK orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29067,7 +29080,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_write"))) TS_TxCreati obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29076,10 +29089,10 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_write"))) TS_TxCreati uint32_t __attribute__((export_name("TS_TxCreationKeys_read"))) TS_TxCreationKeys_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = TxCreationKeys_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ChannelPublicKeys_free"))) TS_ChannelPublicKeys_free(uint32_t this_obj) { @@ -29095,7 +29108,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_funding_pubkey this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -29107,7 +29120,7 @@ void __attribute__((export_name("TS_ChannelPublicKeys_set_funding_pubkey"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref); } @@ -29116,7 +29129,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_revocation_bas this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -29128,7 +29141,7 @@ void __attribute__((export_name("TS_ChannelPublicKeys_set_revocation_basepoint" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref); } @@ -29137,7 +29150,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_payment_point" this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -29149,7 +29162,7 @@ void __attribute__((export_name("TS_ChannelPublicKeys_set_payment_point"))) TS_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref); } @@ -29158,7 +29171,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_delayed_paymen this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -29170,7 +29183,7 @@ void __attribute__((export_name("TS_ChannelPublicKeys_set_delayed_payment_basep CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } @@ -29179,7 +29192,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_htlc_basepoint this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -29191,32 +29204,32 @@ void __attribute__((export_name("TS_ChannelPublicKeys_set_htlc_basepoint"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref); } uint32_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) { LDKPublicKey funding_pubkey_arg_ref; CHECK(funding_pubkey_arg->arr_len == 33); - memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); + memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); LDKPublicKey revocation_basepoint_arg_ref; CHECK(revocation_basepoint_arg->arr_len == 33); - memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); + memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg); LDKPublicKey payment_point_arg_ref; CHECK(payment_point_arg->arr_len == 33); - memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); + memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg); LDKPublicKey delayed_payment_basepoint_arg_ref; CHECK(delayed_payment_basepoint_arg->arr_len == 33); - memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); + memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg); LDKPublicKey htlc_basepoint_arg_ref; CHECK(htlc_basepoint_arg->arr_len == 33); - memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); + memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29225,22 +29238,22 @@ uint32_t __attribute__((export_name("TS_ChannelPublicKeys_new"))) TS_ChannelPub static inline uintptr_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelPublicKeys_clone_ptr"))) TS_ChannelPublicKeys_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelPublicKeys_clone_ptr"))) TS_ChannelPublicKeys_clone_ptr(uint32_t arg) { LDKChannelPublicKeys arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelPublicKeys_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelPublicKeys_clone_ptr(&arg_conv); return ret_val; } @@ -29250,11 +29263,11 @@ uint32_t __attribute__((export_name("TS_ChannelPublicKeys_clone"))) TS_ChannelP orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29267,7 +29280,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_Chann obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29276,37 +29289,37 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_Chann uint32_t __attribute__((export_name("TS_ChannelPublicKeys_read"))) TS_ChannelPublicKeys_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = ChannelPublicKeys_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_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) { LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); LDKPublicKey broadcaster_delayed_payment_base_ref; CHECK(broadcaster_delayed_payment_base->arr_len == 33); - memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); + memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); FREE(broadcaster_delayed_payment_base); LDKPublicKey broadcaster_htlc_base_ref; CHECK(broadcaster_htlc_base->arr_len == 33); - memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); + memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); FREE(broadcaster_htlc_base); LDKPublicKey countersignatory_revocation_base_ref; CHECK(countersignatory_revocation_base->arr_len == 33); - memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); + memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); FREE(countersignatory_revocation_base); LDKPublicKey countersignatory_htlc_base_ref; CHECK(countersignatory_htlc_base->arr_len == 33); - memcpy(countersignatory_htlc_base_ref.compressed_form, countersignatory_htlc_base->elems, 33); + memcpy(countersignatory_htlc_base_ref.compressed_form, countersignatory_htlc_base->elems, 33); FREE(countersignatory_htlc_base); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *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); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_TxCreationKeys_from_channel_static_keys"))) TS_TxCreationKeys_from_channel_static_keys(int8_tArray per_commitment_point, uint32_t broadcaster_keys, uint32_t countersignatory_keys) { LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; @@ -29317,18 +29330,18 @@ uint32_t __attribute__((export_name("TS_TxCreationKeys_from_channel_static_keys CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } 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) { LDKPublicKey revocation_key_ref; CHECK(revocation_key->arr_len == 33); - memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); + memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key); LDKPublicKey broadcaster_delayed_payment_key_ref; CHECK(broadcaster_delayed_payment_key->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); + memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key); LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29398,7 +29411,7 @@ int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_get_payment_h this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv), 32); return ret_arr; } @@ -29410,7 +29423,7 @@ void __attribute__((export_name("TS_HTLCOutputInCommitment_set_payment_hash"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); } @@ -29421,7 +29434,7 @@ uint32_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_transaction_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -29430,27 +29443,27 @@ void __attribute__((export_name("TS_HTLCOutputInCommitment_set_transaction_outp this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv); } uint32_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, uint32_t transaction_output_index_arg) { LDKThirtyTwoBytes payment_hash_arg_ref; CHECK(payment_hash_arg->arr_len == 32); - memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); - void* transaction_output_index_arg_ptr = (void*)(((uint64_t)transaction_output_index_arg) & ~1); + memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); + void* transaction_output_index_arg_ptr = (void*)(((uintptr_t)transaction_output_index_arg) & ~1); CHECK_ACCESS(transaction_output_index_arg_ptr); LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr); - transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1)); + transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)transaction_output_index_arg) & ~1)); LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29459,22 +29472,22 @@ uint32_t __attribute__((export_name("TS_HTLCOutputInCommitment_new"))) TS_HTLCO static inline uintptr_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone_ptr"))) TS_HTLCOutputInCommitment_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone_ptr"))) TS_HTLCOutputInCommitment_clone_ptr(uint32_t arg) { LDKHTLCOutputInCommitment arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = HTLCOutputInCommitment_clone_ptr(&arg_conv); + intptr_t ret_val = HTLCOutputInCommitment_clone_ptr(&arg_conv); return ret_val; } @@ -29484,11 +29497,11 @@ uint32_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone"))) TS_HTL orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29501,7 +29514,7 @@ int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29510,10 +29523,10 @@ int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_ uint32_t __attribute__((export_name("TS_HTLCOutputInCommitment_read"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = HTLCOutputInCommitment_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htlc_redeemscript(uint32_t htlc, jboolean opt_anchors, uint32_t keys) { @@ -29526,7 +29539,7 @@ int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htl keys_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29535,12 +29548,12 @@ int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htl int8_tArray __attribute__((export_name("TS_make_funding_redeemscript"))) TS_make_funding_redeemscript(int8_tArray broadcaster, int8_tArray countersignatory) { LDKPublicKey broadcaster_ref; CHECK(broadcaster->arr_len == 33); - memcpy(broadcaster_ref.compressed_form, broadcaster->elems, 33); + memcpy(broadcaster_ref.compressed_form, broadcaster->elems, 33); FREE(broadcaster); LDKPublicKey countersignatory_ref; CHECK(countersignatory->arr_len == 33); - memcpy(countersignatory_ref.compressed_form, countersignatory->elems, 33); + memcpy(countersignatory_ref.compressed_form, countersignatory->elems, 33); FREE(countersignatory); LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29549,7 +29562,7 @@ int8_tArray __attribute__((export_name("TS_make_funding_redeemscript"))) TS_mak 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, uint32_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) { unsigned char commitment_txid_arr[32]; CHECK(commitment_txid->arr_len == 32); - memcpy(commitment_txid_arr, commitment_txid->elems, 32); + memcpy(commitment_txid_arr, commitment_txid->elems, 32); FREE(commitment_txid); unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr; LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); @@ -29557,12 +29570,12 @@ int8_tArray __attribute__((export_name("TS_build_htlc_transaction"))) TS_build_ CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKPublicKey broadcaster_delayed_payment_key_ref; CHECK(broadcaster_delayed_payment_key->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); + memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key); LDKPublicKey revocation_key_ref; CHECK(revocation_key->arr_len == 33); - memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); + memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key); 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); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); Transaction_free(ret_var); return ret_arr; @@ -29571,9 +29584,9 @@ int8_tArray __attribute__((export_name("TS_build_htlc_transaction"))) TS_build_ int8_tArray __attribute__((export_name("TS_get_anchor_redeemscript"))) TS_get_anchor_redeemscript(int8_tArray funding_pubkey) { LDKPublicKey funding_pubkey_ref; CHECK(funding_pubkey->arr_len == 33); - memcpy(funding_pubkey_ref.compressed_form, funding_pubkey->elems, 33); + memcpy(funding_pubkey_ref.compressed_form, funding_pubkey->elems, 33); FREE(funding_pubkey); LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29593,11 +29606,11 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29657,12 +29670,12 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_counte this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29689,12 +29702,12 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_fundin this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29751,11 +29764,11 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_new"))) TS funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_js(opt_anchors_arg); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29764,22 +29777,22 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_new"))) TS static inline uintptr_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone_ptr"))) TS_ChannelTransactionParameters_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelTransactionParameters_clone_ptr"))) TS_ChannelTransactionParameters_clone_ptr(uint32_t arg) { LDKChannelTransactionParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelTransactionParameters_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelTransactionParameters_clone_ptr(&arg_conv); return ret_val; } @@ -29789,11 +29802,11 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_clone"))) orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29814,11 +29827,11 @@ uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameter this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29862,11 +29875,11 @@ uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameter CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29875,22 +29888,22 @@ uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameter static inline uintptr_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone_ptr"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone_ptr"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint32_t arg) { LDKCounterpartyChannelTransactionParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); + intptr_t ret_val = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); return ret_val; } @@ -29900,11 +29913,11 @@ uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameter orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29926,11 +29939,11 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_as_holder_ this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29943,11 +29956,11 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_as_counter this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29960,7 +29973,7 @@ int8_tArray __attribute__((export_name("TS_CounterpartyChannelTransactionParame obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29969,10 +29982,10 @@ int8_tArray __attribute__((export_name("TS_CounterpartyChannelTransactionParame uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_read"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write"))) TS_ChannelTransactionParameters_write(uint32_t obj) { @@ -29981,7 +29994,7 @@ int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write") obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29990,10 +30003,10 @@ int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write") uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_read"))) TS_ChannelTransactionParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = ChannelTransactionParameters_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_DirectedChannelTransactionParameters_free"))) TS_DirectedChannelTransactionParameters_free(uint32_t this_obj) { @@ -30010,11 +30023,11 @@ uint32_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_br this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30027,11 +30040,11 @@ uint32_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_co this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30062,11 +30075,11 @@ uint32_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_fu this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30095,7 +30108,7 @@ int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_coun this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -30107,7 +30120,7 @@ void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterpart CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref); } @@ -30122,12 +30135,12 @@ void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterpart val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else val_constr.data = NULL; - int8_tArray* val_vals = (void*) val->elems; + int8_tArray* val_vals = (void*) val->elems /* XXX val leaks */; for (size_t m = 0; m < val_constr.datalen; m++) { int8_tArray val_conv_12 = val_vals[m]; LDKSignature val_conv_12_ref; CHECK(val_conv_12->arr_len == 64); - memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); + memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12); val_constr.data[m] = val_conv_12_ref; } HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); @@ -30135,22 +30148,22 @@ void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterpart static inline uintptr_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone_ptr"))) TS_HolderCommitmentTransaction_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone_ptr"))) TS_HolderCommitmentTransaction_clone_ptr(uint32_t arg) { LDKHolderCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = HolderCommitmentTransaction_clone_ptr(&arg_conv); + intptr_t ret_val = HolderCommitmentTransaction_clone_ptr(&arg_conv); return ret_val; } @@ -30160,11 +30173,11 @@ uint32_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone"))) T orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30177,7 +30190,7 @@ int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_write")) obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -30186,10 +30199,10 @@ int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_write")) uint32_t __attribute__((export_name("TS_HolderCommitmentTransaction_read"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = HolderCommitmentTransaction_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_HolderCommitmentTransaction_new"))) TS_HolderCommitmentTransaction_new(uint32_t commitment_tx, int8_tArray counterparty_sig, ptrArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) { @@ -30200,33 +30213,33 @@ uint32_t __attribute__((export_name("TS_HolderCommitmentTransaction_new"))) TS_ commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); LDKSignature counterparty_sig_ref; CHECK(counterparty_sig->arr_len == 64); - memcpy(counterparty_sig_ref.compact_form, counterparty_sig->elems, 64); + memcpy(counterparty_sig_ref.compact_form, counterparty_sig->elems, 64); FREE(counterparty_sig); LDKCVec_SignatureZ counterparty_htlc_sigs_constr; counterparty_htlc_sigs_constr.datalen = counterparty_htlc_sigs->arr_len; if (counterparty_htlc_sigs_constr.datalen > 0) counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else counterparty_htlc_sigs_constr.data = NULL; - int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems; + int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems /* XXX counterparty_htlc_sigs leaks */; for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) { int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m]; LDKSignature counterparty_htlc_sigs_conv_12_ref; CHECK(counterparty_htlc_sigs_conv_12->arr_len == 64); - memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); + memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); FREE(counterparty_htlc_sigs_conv_12); counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref; } LDKPublicKey holder_funding_key_ref; CHECK(holder_funding_key->arr_len == 33); - memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); + memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); FREE(holder_funding_key); LDKPublicKey counterparty_funding_key_ref; CHECK(counterparty_funding_key->arr_len == 33); - memcpy(counterparty_funding_key_ref.compressed_form, counterparty_funding_key->elems, 33); + memcpy(counterparty_funding_key_ref.compressed_form, counterparty_funding_key->elems, 33); FREE(counterparty_funding_key); LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30247,7 +30260,7 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_trans this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); Transaction_free(ret_var); return ret_arr; @@ -30261,7 +30274,7 @@ void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_transaction" LDKTransaction val_ref; val_ref.datalen = val->arr_len; val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); val_ref.data_is_owned = true; BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref); } @@ -30271,7 +30284,7 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_txid" this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv), 32); return ret_arr; } @@ -30283,7 +30296,7 @@ void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_txid"))) TS_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref); } @@ -30291,17 +30304,17 @@ uint32_t __attribute__((export_name("TS_BuiltCommitmentTransaction_new"))) TS_B LDKTransaction transaction_arg_ref; transaction_arg_ref.datalen = transaction_arg->arr_len; transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes"); - memcpy(transaction_arg_ref.data, transaction_arg->elems, transaction_arg_ref.datalen); + memcpy(transaction_arg_ref.data, transaction_arg->elems, transaction_arg_ref.datalen); FREE(transaction_arg); transaction_arg_ref.data_is_owned = true; LDKThirtyTwoBytes txid_arg_ref; CHECK(txid_arg->arr_len == 32); - memcpy(txid_arg_ref.data, txid_arg->elems, 32); + memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30310,22 +30323,22 @@ uint32_t __attribute__((export_name("TS_BuiltCommitmentTransaction_new"))) TS_B static inline uintptr_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone_ptr"))) TS_BuiltCommitmentTransaction_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone_ptr"))) TS_BuiltCommitmentTransaction_clone_ptr(uint32_t arg) { LDKBuiltCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = BuiltCommitmentTransaction_clone_ptr(&arg_conv); + intptr_t ret_val = BuiltCommitmentTransaction_clone_ptr(&arg_conv); return ret_val; } @@ -30335,11 +30348,11 @@ uint32_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone"))) TS orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30352,7 +30365,7 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_write"))) obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -30361,10 +30374,10 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_write"))) uint32_t __attribute__((export_name("TS_BuiltCommitmentTransaction_read"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = BuiltCommitmentTransaction_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_sighash_all"))) TS_BuiltCommitmentTransaction_get_sighash_all(uint32_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { @@ -30374,8 +30387,8 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_sigha CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; - funding_redeemscript_ref.data = funding_redeemscript->elems; - int8_tArray ret_arr = init_int8_tArray(32); + funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32); return ret_arr; } @@ -30387,12 +30400,12 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_sign"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK(funding_key->arr_len == 32); - memcpy(funding_key_arr, funding_key->elems, 32); + memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key); unsigned char (*funding_key_ref)[32] = &funding_key_arr; LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; - funding_redeemscript_ref.data = funding_redeemscript->elems; - int8_tArray ret_arr = init_int8_tArray(64); + funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */; + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64); return ret_arr; } @@ -30407,22 +30420,22 @@ void __attribute__((export_name("TS_ClosingTransaction_free"))) TS_ClosingTrans static inline uintptr_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { LDKClosingTransaction ret_var = ClosingTransaction_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ClosingTransaction_clone_ptr"))) TS_ClosingTransaction_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ClosingTransaction_clone_ptr"))) TS_ClosingTransaction_clone_ptr(uint32_t arg) { LDKClosingTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ClosingTransaction_clone_ptr(&arg_conv); + intptr_t ret_val = ClosingTransaction_clone_ptr(&arg_conv); return ret_val; } @@ -30432,11 +30445,11 @@ uint32_t __attribute__((export_name("TS_ClosingTransaction_clone"))) TS_Closing orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30456,22 +30469,22 @@ uint32_t __attribute__((export_name("TS_ClosingTransaction_new"))) TS_ClosingTr LDKCVec_u8Z to_holder_script_ref; to_holder_script_ref.datalen = to_holder_script->arr_len; to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); + memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script); LDKCVec_u8Z to_counterparty_script_ref; to_counterparty_script_ref.datalen = to_counterparty_script->arr_len; to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); + memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script); LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30484,11 +30497,11 @@ uint32_t __attribute__((export_name("TS_ClosingTransaction_trust"))) TS_Closing this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30507,7 +30520,7 @@ uint32_t __attribute__((export_name("TS_ClosingTransaction_verify"))) TS_Closin funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int64_t __attribute__((export_name("TS_ClosingTransaction_to_holder_value_sat"))) TS_ClosingTransaction_to_holder_value_sat(uint32_t this_arg) { @@ -30534,7 +30547,7 @@ int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_holder_script" this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -30545,7 +30558,7 @@ int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_counterparty_s this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -30564,7 +30577,7 @@ int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_built_tran this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); Transaction_free(ret_var); return ret_arr; @@ -30577,8 +30590,8 @@ int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_get_sighas CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; - funding_redeemscript_ref.data = funding_redeemscript->elems; - int8_tArray ret_arr = init_int8_tArray(32); + funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32); return ret_arr; } @@ -30590,12 +30603,12 @@ int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_sign"))) T CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK(funding_key->arr_len == 32); - memcpy(funding_key_arr, funding_key->elems, 32); + memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key); unsigned char (*funding_key_ref)[32] = &funding_key_arr; LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; - funding_redeemscript_ref.data = funding_redeemscript->elems; - int8_tArray ret_arr = init_int8_tArray(64); + funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */; + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64); return ret_arr; } @@ -30610,22 +30623,22 @@ void __attribute__((export_name("TS_CommitmentTransaction_free"))) TS_Commitmen static inline uintptr_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_CommitmentTransaction_clone_ptr"))) TS_CommitmentTransaction_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CommitmentTransaction_clone_ptr"))) TS_CommitmentTransaction_clone_ptr(uint32_t arg) { LDKCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = CommitmentTransaction_clone_ptr(&arg_conv); + intptr_t ret_val = CommitmentTransaction_clone_ptr(&arg_conv); return ret_val; } @@ -30635,11 +30648,11 @@ uint32_t __attribute__((export_name("TS_CommitmentTransaction_clone"))) TS_Comm orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30652,7 +30665,7 @@ int8_tArray __attribute__((export_name("TS_CommitmentTransaction_write"))) TS_C obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -30661,10 +30674,10 @@ int8_tArray __attribute__((export_name("TS_CommitmentTransaction_write"))) TS_C uint32_t __attribute__((export_name("TS_CommitmentTransaction_read"))) TS_CommitmentTransaction_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CommitmentTransaction_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int64_t __attribute__((export_name("TS_CommitmentTransaction_commitment_number"))) TS_CommitmentTransaction_commitment_number(uint32_t this_arg) { @@ -30709,11 +30722,11 @@ uint32_t __attribute__((export_name("TS_CommitmentTransaction_trust"))) TS_Comm this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30739,7 +30752,7 @@ uint32_t __attribute__((export_name("TS_CommitmentTransaction_verify"))) TS_Com CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_TrustedCommitmentTransaction_free"))) TS_TrustedCommitmentTransaction_free(uint32_t this_obj) { @@ -30755,7 +30768,7 @@ int8_tArray __attribute__((export_name("TS_TrustedCommitmentTransaction_txid")) this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32); return ret_arr; } @@ -30766,11 +30779,11 @@ uint32_t __attribute__((export_name("TS_TrustedCommitmentTransaction_built_tran this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30783,11 +30796,11 @@ uint32_t __attribute__((export_name("TS_TrustedCommitmentTransaction_keys"))) T this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30810,7 +30823,7 @@ uint32_t __attribute__((export_name("TS_TrustedCommitmentTransaction_get_htlc_s CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char htlc_base_key_arr[32]; CHECK(htlc_base_key->arr_len == 32); - memcpy(htlc_base_key_arr, htlc_base_key->elems, 32); + memcpy(htlc_base_key_arr, htlc_base_key->elems, 32); FREE(htlc_base_key); unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr; LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); @@ -30818,16 +30831,16 @@ uint32_t __attribute__((export_name("TS_TrustedCommitmentTransaction_get_htlc_s CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } 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) { LDKPublicKey broadcaster_payment_basepoint_ref; CHECK(broadcaster_payment_basepoint->arr_len == 33); - memcpy(broadcaster_payment_basepoint_ref.compressed_form, broadcaster_payment_basepoint->elems, 33); + memcpy(broadcaster_payment_basepoint_ref.compressed_form, broadcaster_payment_basepoint->elems, 33); FREE(broadcaster_payment_basepoint); LDKPublicKey countersignatory_payment_basepoint_ref; CHECK(countersignatory_payment_basepoint->arr_len == 33); - memcpy(countersignatory_payment_basepoint_ref.compressed_form, countersignatory_payment_basepoint->elems, 33); + memcpy(countersignatory_payment_basepoint_ref.compressed_form, countersignatory_payment_basepoint->elems, 33); FREE(countersignatory_payment_basepoint); int64_t ret_val = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster); return ret_val; } @@ -30899,22 +30912,22 @@ jboolean __attribute__((export_name("TS_ChannelTypeFeatures_eq"))) TS_ChannelTy static inline uintptr_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { LDKInitFeatures ret_var = InitFeatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_InitFeatures_clone_ptr"))) TS_InitFeatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_InitFeatures_clone_ptr"))) TS_InitFeatures_clone_ptr(uint32_t arg) { LDKInitFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = InitFeatures_clone_ptr(&arg_conv); + intptr_t ret_val = InitFeatures_clone_ptr(&arg_conv); return ret_val; } @@ -30924,11 +30937,11 @@ uint32_t __attribute__((export_name("TS_InitFeatures_clone"))) TS_InitFeatures_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30937,22 +30950,22 @@ uint32_t __attribute__((export_name("TS_InitFeatures_clone"))) TS_InitFeatures_ static inline uintptr_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { LDKNodeFeatures ret_var = NodeFeatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NodeFeatures_clone_ptr"))) TS_NodeFeatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NodeFeatures_clone_ptr"))) TS_NodeFeatures_clone_ptr(uint32_t arg) { LDKNodeFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NodeFeatures_clone_ptr(&arg_conv); + intptr_t ret_val = NodeFeatures_clone_ptr(&arg_conv); return ret_val; } @@ -30962,11 +30975,11 @@ uint32_t __attribute__((export_name("TS_NodeFeatures_clone"))) TS_NodeFeatures_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30975,22 +30988,22 @@ uint32_t __attribute__((export_name("TS_NodeFeatures_clone"))) TS_NodeFeatures_ static inline uintptr_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelFeatures_clone_ptr"))) TS_ChannelFeatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelFeatures_clone_ptr"))) TS_ChannelFeatures_clone_ptr(uint32_t arg) { LDKChannelFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelFeatures_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelFeatures_clone_ptr(&arg_conv); return ret_val; } @@ -31000,11 +31013,11 @@ uint32_t __attribute__((export_name("TS_ChannelFeatures_clone"))) TS_ChannelFea orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31013,22 +31026,22 @@ uint32_t __attribute__((export_name("TS_ChannelFeatures_clone"))) TS_ChannelFea static inline uintptr_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_InvoiceFeatures_clone_ptr"))) TS_InvoiceFeatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_InvoiceFeatures_clone_ptr"))) TS_InvoiceFeatures_clone_ptr(uint32_t arg) { LDKInvoiceFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = InvoiceFeatures_clone_ptr(&arg_conv); + intptr_t ret_val = InvoiceFeatures_clone_ptr(&arg_conv); return ret_val; } @@ -31038,11 +31051,11 @@ uint32_t __attribute__((export_name("TS_InvoiceFeatures_clone"))) TS_InvoiceFea orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31051,22 +31064,22 @@ uint32_t __attribute__((export_name("TS_InvoiceFeatures_clone"))) TS_InvoiceFea static inline uintptr_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone_ptr"))) TS_ChannelTypeFeatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelTypeFeatures_clone_ptr"))) TS_ChannelTypeFeatures_clone_ptr(uint32_t arg) { LDKChannelTypeFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelTypeFeatures_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelTypeFeatures_clone_ptr(&arg_conv); return ret_val; } @@ -31076,11 +31089,11 @@ uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_clone"))) TS_Channe orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31129,11 +31142,11 @@ void __attribute__((export_name("TS_ChannelTypeFeatures_free"))) TS_ChannelType uint32_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_empty() { LDKInitFeatures ret_var = InitFeatures_empty(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31142,11 +31155,11 @@ uint32_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_ uint32_t __attribute__((export_name("TS_InitFeatures_known"))) TS_InitFeatures_known() { LDKInitFeatures ret_var = InitFeatures_known(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31164,11 +31177,11 @@ jboolean __attribute__((export_name("TS_InitFeatures_requires_unknown_bits"))) uint32_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_empty() { LDKNodeFeatures ret_var = NodeFeatures_empty(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31177,11 +31190,11 @@ uint32_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_ uint32_t __attribute__((export_name("TS_NodeFeatures_known"))) TS_NodeFeatures_known() { LDKNodeFeatures ret_var = NodeFeatures_known(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31199,11 +31212,11 @@ jboolean __attribute__((export_name("TS_NodeFeatures_requires_unknown_bits"))) uint32_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFeatures_empty() { LDKChannelFeatures ret_var = ChannelFeatures_empty(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31212,11 +31225,11 @@ uint32_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFea uint32_t __attribute__((export_name("TS_ChannelFeatures_known"))) TS_ChannelFeatures_known() { LDKChannelFeatures ret_var = ChannelFeatures_known(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31234,11 +31247,11 @@ jboolean __attribute__((export_name("TS_ChannelFeatures_requires_unknown_bits") uint32_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFeatures_empty() { LDKInvoiceFeatures ret_var = InvoiceFeatures_empty(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31247,11 +31260,11 @@ uint32_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFea uint32_t __attribute__((export_name("TS_InvoiceFeatures_known"))) TS_InvoiceFeatures_known() { LDKInvoiceFeatures ret_var = InvoiceFeatures_known(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31269,11 +31282,11 @@ jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_unknown_bits") uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_ChannelTypeFeatures_empty() { LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31282,11 +31295,11 @@ uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_Channe uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_known"))) TS_ChannelTypeFeatures_known() { LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31308,7 +31321,7 @@ int8_tArray __attribute__((export_name("TS_InitFeatures_write"))) TS_InitFeatur obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31317,10 +31330,10 @@ int8_tArray __attribute__((export_name("TS_InitFeatures_write"))) TS_InitFeatur uint32_t __attribute__((export_name("TS_InitFeatures_read"))) TS_InitFeatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = InitFeatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_ChannelFeatures_write(uint32_t obj) { @@ -31329,7 +31342,7 @@ int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_Channel obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31338,10 +31351,10 @@ int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_Channel uint32_t __attribute__((export_name("TS_ChannelFeatures_read"))) TS_ChannelFeatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = ChannelFeatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatures_write(uint32_t obj) { @@ -31350,7 +31363,7 @@ int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatur obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31359,10 +31372,10 @@ int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatur uint32_t __attribute__((export_name("TS_NodeFeatures_read"))) TS_NodeFeatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = NodeFeatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_InvoiceFeatures_write(uint32_t obj) { @@ -31371,7 +31384,7 @@ int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_Invoice obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31380,10 +31393,10 @@ int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_Invoice uint32_t __attribute__((export_name("TS_InvoiceFeatures_read"))) TS_InvoiceFeatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = InvoiceFeatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_ChannelTypeFeatures_write(uint32_t obj) { @@ -31392,7 +31405,7 @@ int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_Cha obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31401,10 +31414,10 @@ int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_Cha uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_read"))) TS_ChannelTypeFeatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); *ret_conv = ChannelTypeFeatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ShutdownScript_free"))) TS_ShutdownScript_free(uint32_t this_obj) { @@ -31417,22 +31430,22 @@ void __attribute__((export_name("TS_ShutdownScript_free"))) TS_ShutdownScript_f static inline uintptr_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { LDKShutdownScript ret_var = ShutdownScript_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ShutdownScript_clone_ptr"))) TS_ShutdownScript_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ShutdownScript_clone_ptr"))) TS_ShutdownScript_clone_ptr(uint32_t arg) { LDKShutdownScript arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ShutdownScript_clone_ptr(&arg_conv); + intptr_t ret_val = ShutdownScript_clone_ptr(&arg_conv); return ret_val; } @@ -31442,11 +31455,11 @@ uint32_t __attribute__((export_name("TS_ShutdownScript_clone"))) TS_ShutdownScr orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31467,7 +31480,7 @@ int8_tArray __attribute__((export_name("TS_InvalidShutdownScript_get_script"))) this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -31480,7 +31493,7 @@ void __attribute__((export_name("TS_InvalidShutdownScript_set_script"))) TS_Inv LDKCVec_u8Z val_ref; val_ref.datalen = val->arr_len; val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); } @@ -31488,13 +31501,13 @@ uint32_t __attribute__((export_name("TS_InvalidShutdownScript_new"))) TS_Invali LDKCVec_u8Z script_arg_ref; script_arg_ref.datalen = script_arg->arr_len; script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); + memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg); LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31503,22 +31516,22 @@ uint32_t __attribute__((export_name("TS_InvalidShutdownScript_new"))) TS_Invali static inline uintptr_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_InvalidShutdownScript_clone_ptr"))) TS_InvalidShutdownScript_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_InvalidShutdownScript_clone_ptr"))) TS_InvalidShutdownScript_clone_ptr(uint32_t arg) { LDKInvalidShutdownScript arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = InvalidShutdownScript_clone_ptr(&arg_conv); + intptr_t ret_val = InvalidShutdownScript_clone_ptr(&arg_conv); return ret_val; } @@ -31528,11 +31541,11 @@ uint32_t __attribute__((export_name("TS_InvalidShutdownScript_clone"))) TS_Inva orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31545,7 +31558,7 @@ int8_tArray __attribute__((export_name("TS_ShutdownScript_write"))) TS_Shutdown obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31554,23 +31567,23 @@ int8_tArray __attribute__((export_name("TS_ShutdownScript_write"))) TS_Shutdown uint32_t __attribute__((export_name("TS_ShutdownScript_read"))) TS_ShutdownScript_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = ShutdownScript_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) { unsigned char pubkey_hash_arr[20]; CHECK(pubkey_hash->arr_len == 20); - memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); + memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash); unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr; LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31580,14 +31593,14 @@ uint32_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_Shutdo uint32_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_ShutdownScript_new_p2wsh(int8_tArray script_hash) { unsigned char script_hash_arr[32]; CHECK(script_hash->arr_len == 32); - memcpy(script_hash_arr, script_hash->elems, 32); + memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash); unsigned char (*script_hash_ref)[32] = &script_hash_arr; LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31597,10 +31610,10 @@ uint32_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_Shutdow uint32_t __attribute__((export_name("TS_ShutdownScript_new_witness_program"))) TS_ShutdownScript_new_witness_program(int8_t version, int8_tArray program) { LDKu8slice program_ref; program_ref.datalen = program->arr_len; - program_ref.data = program->elems; + program_ref.data = program->elems /* XXX program leaks */; LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = ShutdownScript_new_witness_program(version, program_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ShutdownScript_into_inner"))) TS_ShutdownScript_into_inner(uint32_t this_arg) { @@ -31610,7 +31623,7 @@ int8_tArray __attribute__((export_name("TS_ShutdownScript_into_inner"))) TS_Shu CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = ShutdownScript_clone(&this_arg_conv); LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31621,7 +31634,7 @@ int8_tArray __attribute__((export_name("TS_ShutdownScript_as_legacy_pubkey"))) this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33); return ret_arr; } @@ -31641,7 +31654,7 @@ jboolean __attribute__((export_name("TS_ShutdownScript_is_compatible"))) TS_Shu void __attribute__((export_name("TS_CustomMessageReader_free"))) TS_CustomMessageReader_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -31651,28 +31664,28 @@ void __attribute__((export_name("TS_CustomMessageReader_free"))) TS_CustomMessa static inline uintptr_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); *ret_ret = Type_clone(arg); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } -int64_t __attribute__((export_name("TS_Type_clone_ptr"))) TS_Type_clone_ptr(uint32_t arg) { - void* arg_ptr = (void*)(((uint64_t)arg) & ~1); +intptr_t __attribute__((export_name("TS_Type_clone_ptr"))) TS_Type_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } LDKType* arg_conv = (LDKType*)arg_ptr; - int64_t ret_val = Type_clone_ptr(arg_conv); + intptr_t ret_val = Type_clone_ptr(arg_conv); return ret_val; } uint32_t __attribute__((export_name("TS_Type_clone"))) TS_Type_clone(uint32_t orig) { - void* orig_ptr = (void*)(((uint64_t)orig) & ~1); + void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } LDKType* orig_conv = (LDKType*)orig_ptr; LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); *ret_ret = Type_clone(orig_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_Type_free"))) TS_Type_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -31689,22 +31702,22 @@ void __attribute__((export_name("TS_NodeId_free"))) TS_NodeId_free(uint32_t thi static inline uintptr_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { LDKNodeId ret_var = NodeId_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NodeId_clone_ptr"))) TS_NodeId_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NodeId_clone_ptr"))) TS_NodeId_clone_ptr(uint32_t arg) { LDKNodeId arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NodeId_clone_ptr(&arg_conv); + intptr_t ret_val = NodeId_clone_ptr(&arg_conv); return ret_val; } @@ -31714,11 +31727,11 @@ uint32_t __attribute__((export_name("TS_NodeId_clone"))) TS_NodeId_clone(uint32 orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeId ret_var = NodeId_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31728,13 +31741,13 @@ uint32_t __attribute__((export_name("TS_NodeId_clone"))) TS_NodeId_clone(uint32 uint32_t __attribute__((export_name("TS_NodeId_from_pubkey"))) TS_NodeId_from_pubkey(int8_tArray pubkey) { LDKPublicKey pubkey_ref; CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31747,7 +31760,7 @@ int8_tArray __attribute__((export_name("TS_NodeId_as_slice"))) TS_NodeId_as_sli this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -31767,7 +31780,7 @@ int8_tArray __attribute__((export_name("TS_NodeId_write"))) TS_NodeId_write(uin obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31776,10 +31789,10 @@ int8_tArray __attribute__((export_name("TS_NodeId_write"))) TS_NodeId_write(uin uint32_t __attribute__((export_name("TS_NodeId_read"))) TS_NodeId_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = NodeId_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_NetworkGraph_free"))) TS_NetworkGraph_free(uint32_t this_obj) { @@ -31792,22 +31805,22 @@ void __attribute__((export_name("TS_NetworkGraph_free"))) TS_NetworkGraph_free( static inline uintptr_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg) { LDKNetworkGraph ret_var = NetworkGraph_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NetworkGraph_clone_ptr"))) TS_NetworkGraph_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NetworkGraph_clone_ptr"))) TS_NetworkGraph_clone_ptr(uint32_t arg) { LDKNetworkGraph arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NetworkGraph_clone_ptr(&arg_conv); + intptr_t ret_val = NetworkGraph_clone_ptr(&arg_conv); return ret_val; } @@ -31817,11 +31830,11 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_clone"))) TS_NetworkGraph_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31838,7 +31851,7 @@ void __attribute__((export_name("TS_ReadOnlyNetworkGraph_free"))) TS_ReadOnlyNe void __attribute__((export_name("TS_NetworkUpdate_free"))) TS_NetworkUpdate_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -31848,12 +31861,12 @@ void __attribute__((export_name("TS_NetworkUpdate_free"))) TS_NetworkUpdate_fre static inline uintptr_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_NetworkUpdate_clone_ptr"))) TS_NetworkUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NetworkUpdate_clone_ptr"))) TS_NetworkUpdate_clone_ptr(uint32_t arg) { LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)arg; - int64_t ret_val = NetworkUpdate_clone_ptr(arg_conv); + intptr_t ret_val = NetworkUpdate_clone_ptr(arg_conv); return ret_val; } @@ -31861,7 +31874,7 @@ uint32_t __attribute__((export_name("TS_NetworkUpdate_clone"))) TS_NetworkUpdat LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)orig; LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -31873,31 +31886,31 @@ uint32_t __attribute__((export_name("TS_NetworkUpdate_channel_update_message")) msg_conv = ChannelUpdate_clone(&msg_conv); LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_channel_update_message(msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_NetworkUpdate_channel_closed"))) TS_NetworkUpdate_channel_closed(int64_t short_channel_id, jboolean is_permanent) { LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_channel_closed(short_channel_id, is_permanent); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_NetworkUpdate_node_failure"))) TS_NetworkUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_NetworkUpdate_write"))) TS_NetworkUpdate_write(uint32_t obj) { LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)obj; LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31906,10 +31919,10 @@ int8_tArray __attribute__((export_name("TS_NetworkUpdate_write"))) TS_NetworkUp uint32_t __attribute__((export_name("TS_NetworkUpdate_read"))) TS_NetworkUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); *ret_conv = NetworkUpdate_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_as_EventHandler"))) TS_NetGraphMsgHandler_as_EventHandler(uint32_t this_arg) { @@ -31919,7 +31932,7 @@ uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_as_EventHandler"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_NetGraphMsgHandler_free"))) TS_NetGraphMsgHandler_free(uint32_t this_obj) { @@ -31935,22 +31948,22 @@ uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_new"))) TS_NetGraphM network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); + void* chain_access_ptr = (void*)(((uintptr_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); // Warning: we may need a move here but no clone is available for LDKCOption_AccessZ if (chain_access_conv.tag == LDKCOption_AccessZ_Some) { // Manually implement clone for Java trait instances } - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(&network_graph_conv, chain_access_conv, logger_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31962,7 +31975,7 @@ void __attribute__((export_name("TS_NetGraphMsgHandler_add_chain_access"))) TS_ this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); + void* chain_access_ptr = (void*)(((uintptr_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); // Warning: we may need a move here but no clone is available for LDKCOption_AccessZ @@ -31979,7 +31992,7 @@ uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_as_RoutingMessageHan CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_as_MessageSendEventsProvider"))) TS_NetGraphMsgHandler_as_MessageSendEventsProvider(uint32_t this_arg) { @@ -31989,7 +32002,7 @@ uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_as_MessageSendEvents CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_DirectionalChannelInfo_free"))) TS_DirectionalChannelInfo_free(uint32_t this_obj) { @@ -32075,7 +32088,7 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_get_htlc_maximum CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = DirectionalChannelInfo_get_htlc_maximum_msat(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -32084,10 +32097,10 @@ void __attribute__((export_name("TS_DirectionalChannelInfo_set_htlc_maximum_msa this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); DirectionalChannelInfo_set_htlc_maximum_msat(&this_ptr_conv, val_conv); } @@ -32097,11 +32110,11 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_get_fees"))) TS_ this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32127,12 +32140,12 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_get_last_update_ this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32154,10 +32167,10 @@ void __attribute__((export_name("TS_DirectionalChannelInfo_set_last_update_mess } uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_new"))) TS_DirectionalChannelInfo_new(int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, uint32_t htlc_maximum_msat_arg, uint32_t fees_arg, uint32_t last_update_message_arg) { - void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1); + void* htlc_maximum_msat_arg_ptr = (void*)(((uintptr_t)htlc_maximum_msat_arg) & ~1); CHECK_ACCESS(htlc_maximum_msat_arg_ptr); LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); - htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1)); + htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)htlc_maximum_msat_arg) & ~1)); LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); @@ -32169,11 +32182,11 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_new"))) TS_Direc CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_message_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32182,22 +32195,22 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_new"))) TS_Direc static inline uintptr_t DirectionalChannelInfo_clone_ptr(LDKDirectionalChannelInfo *NONNULL_PTR arg) { LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_DirectionalChannelInfo_clone_ptr"))) TS_DirectionalChannelInfo_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_DirectionalChannelInfo_clone_ptr"))) TS_DirectionalChannelInfo_clone_ptr(uint32_t arg) { LDKDirectionalChannelInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = DirectionalChannelInfo_clone_ptr(&arg_conv); + intptr_t ret_val = DirectionalChannelInfo_clone_ptr(&arg_conv); return ret_val; } @@ -32207,11 +32220,11 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_clone"))) TS_Dir orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32224,7 +32237,7 @@ int8_tArray __attribute__((export_name("TS_DirectionalChannelInfo_write"))) TS_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DirectionalChannelInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -32233,10 +32246,10 @@ int8_tArray __attribute__((export_name("TS_DirectionalChannelInfo_write"))) TS_ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_read"))) TS_DirectionalChannelInfo_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = DirectionalChannelInfo_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ChannelInfo_free"))) TS_ChannelInfo_free(uint32_t this_obj) { @@ -32253,11 +32266,11 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_features"))) TS_Channel this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32283,11 +32296,11 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_node_one"))) TS_Channel this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32313,12 +32326,12 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_one_to_two"))) TS_Chann this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32345,11 +32358,11 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_node_two"))) TS_Channel this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32375,12 +32388,12 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_two_to_one"))) TS_Chann this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32408,7 +32421,7 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_capacity_sats"))) TS_Ch CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -32417,10 +32430,10 @@ void __attribute__((export_name("TS_ChannelInfo_set_capacity_sats"))) TS_Channe this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); } @@ -32430,12 +32443,12 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_announcement_message")) this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32458,22 +32471,22 @@ void __attribute__((export_name("TS_ChannelInfo_set_announcement_message"))) TS static inline uintptr_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { LDKChannelInfo ret_var = ChannelInfo_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelInfo_clone_ptr"))) TS_ChannelInfo_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelInfo_clone_ptr"))) TS_ChannelInfo_clone_ptr(uint32_t arg) { LDKChannelInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelInfo_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelInfo_clone_ptr(&arg_conv); return ret_val; } @@ -32483,11 +32496,11 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_clone"))) TS_ChannelInfo_cl orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32500,7 +32513,7 @@ int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -32509,10 +32522,10 @@ int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo uint32_t __attribute__((export_name("TS_ChannelInfo_read"))) TS_ChannelInfo_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = ChannelInfo_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_RoutingFees_free"))) TS_RoutingFees_free(uint32_t this_obj) { @@ -32559,11 +32572,11 @@ void __attribute__((export_name("TS_RoutingFees_set_proportional_millionths"))) uint32_t __attribute__((export_name("TS_RoutingFees_new"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) { LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32585,22 +32598,22 @@ jboolean __attribute__((export_name("TS_RoutingFees_eq"))) TS_RoutingFees_eq(ui static inline uintptr_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { LDKRoutingFees ret_var = RoutingFees_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RoutingFees_clone_ptr"))) TS_RoutingFees_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RoutingFees_clone_ptr"))) TS_RoutingFees_clone_ptr(uint32_t arg) { LDKRoutingFees arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RoutingFees_clone_ptr(&arg_conv); + intptr_t ret_val = RoutingFees_clone_ptr(&arg_conv); return ret_val; } @@ -32610,11 +32623,11 @@ uint32_t __attribute__((export_name("TS_RoutingFees_clone"))) TS_RoutingFees_cl orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32636,7 +32649,7 @@ int8_tArray __attribute__((export_name("TS_RoutingFees_write"))) TS_RoutingFees obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -32645,10 +32658,10 @@ int8_tArray __attribute__((export_name("TS_RoutingFees_write"))) TS_RoutingFees uint32_t __attribute__((export_name("TS_RoutingFees_read"))) TS_RoutingFees_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = RoutingFees_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_NodeAnnouncementInfo_free"))) TS_NodeAnnouncementInfo_free(uint32_t this_obj) { @@ -32665,11 +32678,11 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_features"))) T this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32711,7 +32724,7 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_rgb"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(3); + int8_tArray ret_arr = init_int8_tArray(3, __LINE__); memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3); return ret_arr; } @@ -32723,7 +32736,7 @@ void __attribute__((export_name("TS_NodeAnnouncementInfo_set_rgb"))) TS_NodeAnn CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK(val->arr_len == 3); - memcpy(val_ref.data, val->elems, 3); + memcpy(val_ref.data, val->elems, 3); FREE(val); NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref); } @@ -32732,7 +32745,7 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_alias"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_alias(&this_ptr_conv), 32); return ret_arr; } @@ -32744,7 +32757,7 @@ void __attribute__((export_name("TS_NodeAnnouncementInfo_set_alias"))) TS_NodeA CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_ref); } @@ -32759,13 +32772,13 @@ void __attribute__((export_name("TS_NodeAnnouncementInfo_set_addresses"))) TS_N val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t m = 0; m < val_constr.datalen; m++) { uint32_t val_conv_12 = val_vals[m]; - void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1); + void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1); CHECK_ACCESS(val_conv_12_ptr); LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr); - val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1)); + val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1)); val_constr.data[m] = val_conv_12_conv; } NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr); @@ -32777,12 +32790,12 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_announcement_m this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32811,20 +32824,20 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_new"))) TS_NodeAnn features_arg_conv = NodeFeatures_clone(&features_arg_conv); LDKThreeBytes rgb_arg_ref; CHECK(rgb_arg->arr_len == 3); - memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); + memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg); LDKThirtyTwoBytes alias_arg_ref; CHECK(alias_arg->arr_len == 32); - memcpy(alias_arg_ref.data, alias_arg->elems, 32); + memcpy(alias_arg_ref.data, alias_arg->elems, 32); FREE(alias_arg); LDKCVec_NetAddressZ addresses_arg_constr; addresses_arg_constr.datalen = addresses_arg->arr_len; if (addresses_arg_constr.datalen > 0) addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else addresses_arg_constr.data = NULL; - uint32_t* addresses_arg_vals = addresses_arg->elems; + uint32_t* addresses_arg_vals = addresses_arg->elems /* XXX addresses_arg leaks */; for (size_t m = 0; m < addresses_arg_constr.datalen; m++) { uint32_t addresses_arg_conv_12 = addresses_arg_vals[m]; - void* addresses_arg_conv_12_ptr = (void*)(((uint64_t)addresses_arg_conv_12) & ~1); + void* addresses_arg_conv_12_ptr = (void*)(((uintptr_t)addresses_arg_conv_12) & ~1); CHECK_ACCESS(addresses_arg_conv_12_ptr); LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr); addresses_arg_constr.data[m] = addresses_arg_conv_12_conv; @@ -32835,11 +32848,11 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_new"))) TS_NodeAnn CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, announcement_message_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32848,22 +32861,22 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_new"))) TS_NodeAnn static inline uintptr_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone_ptr"))) TS_NodeAnnouncementInfo_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone_ptr"))) TS_NodeAnnouncementInfo_clone_ptr(uint32_t arg) { LDKNodeAnnouncementInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NodeAnnouncementInfo_clone_ptr(&arg_conv); + intptr_t ret_val = NodeAnnouncementInfo_clone_ptr(&arg_conv); return ret_val; } @@ -32873,11 +32886,11 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone"))) TS_NodeA orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32890,7 +32903,7 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_No obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -32899,10 +32912,10 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_No uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_read"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = NodeAnnouncementInfo_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_NodeInfo_free"))) TS_NodeInfo_free(uint32_t this_obj) { @@ -32924,7 +32937,7 @@ void __attribute__((export_name("TS_NodeInfo_set_channels"))) TS_NodeInfo_set_c val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else val_constr.data = NULL; - int64_t* val_vals = val->elems; + int64_t* val_vals = val->elems /* XXX val leaks */; for (size_t i = 0; i < val_constr.datalen; i++) { int64_t val_conv_8 = val_vals[i]; val_constr.data[i] = val_conv_8; @@ -32938,12 +32951,12 @@ uint32_t __attribute__((export_name("TS_NodeInfo_get_lowest_inbound_channel_fee this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32970,12 +32983,12 @@ uint32_t __attribute__((export_name("TS_NodeInfo_get_announcement_info"))) TS_N this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33003,7 +33016,7 @@ uint32_t __attribute__((export_name("TS_NodeInfo_new"))) TS_NodeInfo_new(int64_ channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else channels_arg_constr.data = NULL; - int64_t* channels_arg_vals = channels_arg->elems; + int64_t* channels_arg_vals = channels_arg->elems /* XXX channels_arg leaks */; for (size_t i = 0; i < channels_arg_constr.datalen; i++) { int64_t channels_arg_conv_8 = channels_arg_vals[i]; channels_arg_constr.data[i] = channels_arg_conv_8; @@ -33019,11 +33032,11 @@ uint32_t __attribute__((export_name("TS_NodeInfo_new"))) TS_NodeInfo_new(int64_ CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv); announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv); LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33032,22 +33045,22 @@ uint32_t __attribute__((export_name("TS_NodeInfo_new"))) TS_NodeInfo_new(int64_ static inline uintptr_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { LDKNodeInfo ret_var = NodeInfo_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NodeInfo_clone_ptr"))) TS_NodeInfo_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NodeInfo_clone_ptr"))) TS_NodeInfo_clone_ptr(uint32_t arg) { LDKNodeInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NodeInfo_clone_ptr(&arg_conv); + intptr_t ret_val = NodeInfo_clone_ptr(&arg_conv); return ret_val; } @@ -33057,11 +33070,11 @@ uint32_t __attribute__((export_name("TS_NodeInfo_clone"))) TS_NodeInfo_clone(ui orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33074,7 +33087,7 @@ int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -33083,10 +33096,10 @@ int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write uint32_t __attribute__((export_name("TS_NodeInfo_read"))) TS_NodeInfo_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = NodeInfo_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGraph_write(uint32_t obj) { @@ -33095,7 +33108,7 @@ int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGra obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -33104,22 +33117,22 @@ int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGra uint32_t __attribute__((export_name("TS_NetworkGraph_read"))) TS_NetworkGraph_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = NetworkGraph_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetworkGraph_new"))) TS_NetworkGraph_new(int8_tArray genesis_hash) { LDKThirtyTwoBytes genesis_hash_ref; CHECK(genesis_hash->arr_len == 32); - memcpy(genesis_hash_ref.data, genesis_hash->elems, 32); + memcpy(genesis_hash_ref.data, genesis_hash->elems, 32); FREE(genesis_hash); LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33132,11 +33145,11 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_read_only"))) TS_NetworkGr this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33154,7 +33167,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_node_from_announcem CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetworkGraph_update_node_from_unsigned_announcement"))) TS_NetworkGraph_update_node_from_unsigned_announcement(uint32_t this_arg, uint32_t msg) { @@ -33168,7 +33181,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_node_from_unsigned_ CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_announcement"))) TS_NetworkGraph_update_channel_from_announcement(uint32_t this_arg, uint32_t msg, uint32_t chain_access) { @@ -33180,7 +33193,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_announ msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); + void* chain_access_ptr = (void*)(((uintptr_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); // Warning: we may need a move here but no clone is available for LDKCOption_AccessZ @@ -33189,7 +33202,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_announ } LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_unsigned_announcement"))) TS_NetworkGraph_update_channel_from_unsigned_announcement(uint32_t this_arg, uint32_t msg, uint32_t chain_access) { @@ -33201,7 +33214,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_unsign msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); + void* chain_access_ptr = (void*)(((uintptr_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); // Warning: we may need a move here but no clone is available for LDKCOption_AccessZ @@ -33210,7 +33223,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_unsign } LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_NetworkGraph_close_channel_from_update"))) TS_NetworkGraph_close_channel_from_update(uint32_t this_arg, int64_t short_channel_id, jboolean is_permanent) { @@ -33228,7 +33241,7 @@ void __attribute__((export_name("TS_NetworkGraph_fail_node"))) TS_NetworkGraph_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey _node_id_ref; CHECK(_node_id->arr_len == 33); - memcpy(_node_id_ref.compressed_form, _node_id->elems, 33); + memcpy(_node_id_ref.compressed_form, _node_id->elems, 33); FREE(_node_id); NetworkGraph_fail_node(&this_arg_conv, _node_id_ref, is_permanent); } @@ -33251,7 +33264,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel"))) TS_Netw CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_unsigned"))) TS_NetworkGraph_update_channel_unsigned(uint32_t this_arg, uint32_t msg) { @@ -33265,7 +33278,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_unsigned")) CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_get_addresses"))) TS_ReadOnlyNetworkGraph_get_addresses(uint32_t this_arg, int8_tArray pubkey) { @@ -33275,10 +33288,10 @@ uint32_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_get_addresses"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey pubkey_ref; CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -33295,7 +33308,7 @@ int8_tArray __attribute__((export_name("TS_RouteHop_get_pubkey"))) TS_RouteHop_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -33307,7 +33320,7 @@ void __attribute__((export_name("TS_RouteHop_set_pubkey"))) TS_RouteHop_set_pub CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); RouteHop_set_pubkey(&this_ptr_conv, val_ref); } @@ -33317,11 +33330,11 @@ uint32_t __attribute__((export_name("TS_RouteHop_get_node_features"))) TS_Route this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33364,11 +33377,11 @@ uint32_t __attribute__((export_name("TS_RouteHop_get_channel_features"))) TS_Ro this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33425,7 +33438,7 @@ void __attribute__((export_name("TS_RouteHop_set_cltv_expiry_delta"))) TS_Route uint32_t __attribute__((export_name("TS_RouteHop_new"))) TS_RouteHop_new(int8_tArray pubkey_arg, uint32_t node_features_arg, int64_t short_channel_id_arg, uint32_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg) { LDKPublicKey pubkey_arg_ref; CHECK(pubkey_arg->arr_len == 33); - memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); + memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg); LDKNodeFeatures node_features_arg_conv; node_features_arg_conv.inner = (void*)(node_features_arg & (~1)); node_features_arg_conv.is_owned = (node_features_arg & 1) || (node_features_arg == 0); @@ -33437,11 +33450,11 @@ uint32_t __attribute__((export_name("TS_RouteHop_new"))) TS_RouteHop_new(int8_t CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33450,22 +33463,22 @@ uint32_t __attribute__((export_name("TS_RouteHop_new"))) TS_RouteHop_new(int8_t static inline uintptr_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { LDKRouteHop ret_var = RouteHop_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RouteHop_clone_ptr"))) TS_RouteHop_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RouteHop_clone_ptr"))) TS_RouteHop_clone_ptr(uint32_t arg) { LDKRouteHop arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RouteHop_clone_ptr(&arg_conv); + intptr_t ret_val = RouteHop_clone_ptr(&arg_conv); return ret_val; } @@ -33475,11 +33488,11 @@ uint32_t __attribute__((export_name("TS_RouteHop_clone"))) TS_RouteHop_clone(ui orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHop ret_var = RouteHop_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33514,7 +33527,7 @@ int8_tArray __attribute__((export_name("TS_RouteHop_write"))) TS_RouteHop_write obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -33523,10 +33536,10 @@ int8_tArray __attribute__((export_name("TS_RouteHop_write"))) TS_RouteHop_write uint32_t __attribute__((export_name("TS_RouteHop_read"))) TS_RouteHop_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = RouteHop_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_Route_free"))) TS_Route_free(uint32_t this_obj) { @@ -33544,20 +33557,20 @@ ptrArray __attribute__((export_name("TS_Route_get_paths"))) TS_Route_get_paths( CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); uint32_tArray *ret_arr_ptr = (uint32_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m]; uint32_tArray ret_conv_12_arr = NULL; - ret_conv_12_arr = init_uint32_tArray(ret_conv_12_var.datalen); + ret_conv_12_arr = init_uint32_tArray(ret_conv_12_var.datalen, __LINE__); uint32_t *ret_conv_12_arr_ptr = (uint32_t*)(((uint8_t*)ret_conv_12_arr) + 4); for (size_t k = 0; k < ret_conv_12_var.datalen; k++) { LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k]; - uint64_t ret_conv_12_conv_10_ref = 0; - CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_12_conv_10_ref = 0; + CHECK((((uintptr_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var); - ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner; + ret_conv_12_conv_10_ref = (uintptr_t)ret_conv_12_conv_10_var.inner; if (ret_conv_12_conv_10_var.is_owned) { ret_conv_12_conv_10_ref |= 1; } @@ -33583,7 +33596,7 @@ void __attribute__((export_name("TS_Route_set_paths"))) TS_Route_set_paths(uint val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements"); else val_constr.data = NULL; - uint32_tArray* val_vals = (void*) val->elems; + uint32_tArray* val_vals = (void*) val->elems /* XXX val leaks */; for (size_t m = 0; m < val_constr.datalen; m++) { uint32_tArray val_conv_12 = val_vals[m]; LDKCVec_RouteHopZ val_conv_12_constr; @@ -33592,7 +33605,7 @@ void __attribute__((export_name("TS_Route_set_paths"))) TS_Route_set_paths(uint val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else val_conv_12_constr.data = NULL; - uint32_t* val_conv_12_vals = val_conv_12->elems; + uint32_t* val_conv_12_vals = val_conv_12->elems /* XXX val_conv_12 leaks */; for (size_t k = 0; k < val_conv_12_constr.datalen; k++) { uint32_t val_conv_12_conv_10 = val_conv_12_vals[k]; LDKRouteHop val_conv_12_conv_10_conv; @@ -33613,12 +33626,12 @@ uint32_t __attribute__((export_name("TS_Route_get_payee"))) TS_Route_get_payee( this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = Route_get_payee(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33646,7 +33659,7 @@ uint32_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray pat paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements"); else paths_arg_constr.data = NULL; - uint32_tArray* paths_arg_vals = (void*) paths_arg->elems; + uint32_tArray* paths_arg_vals = (void*) paths_arg->elems /* XXX paths_arg leaks */; for (size_t m = 0; m < paths_arg_constr.datalen; m++) { uint32_tArray paths_arg_conv_12 = paths_arg_vals[m]; LDKCVec_RouteHopZ paths_arg_conv_12_constr; @@ -33655,7 +33668,7 @@ uint32_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray pat paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else paths_arg_conv_12_constr.data = NULL; - uint32_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems; + uint32_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems /* XXX paths_arg_conv_12 leaks */; for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) { uint32_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k]; LDKRouteHop paths_arg_conv_12_conv_10_conv; @@ -33673,11 +33686,11 @@ uint32_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray pat CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRoute ret_var = Route_new(paths_arg_constr, payee_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33686,22 +33699,22 @@ uint32_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray pat static inline uintptr_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { LDKRoute ret_var = Route_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Route_clone_ptr"))) TS_Route_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Route_clone_ptr"))) TS_Route_clone_ptr(uint32_t arg) { LDKRoute arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Route_clone_ptr(&arg_conv); + intptr_t ret_val = Route_clone_ptr(&arg_conv); return ret_val; } @@ -33711,11 +33724,11 @@ uint32_t __attribute__((export_name("TS_Route_clone"))) TS_Route_clone(uint32_t orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoute ret_var = Route_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33768,7 +33781,7 @@ int8_tArray __attribute__((export_name("TS_Route_write"))) TS_Route_write(uint3 obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Route_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -33777,10 +33790,10 @@ int8_tArray __attribute__((export_name("TS_Route_write"))) TS_Route_write(uint3 uint32_t __attribute__((export_name("TS_Route_read"))) TS_Route_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = Route_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_RouteParameters_free"))) TS_RouteParameters_free(uint32_t this_obj) { @@ -33797,11 +33810,11 @@ uint32_t __attribute__((export_name("TS_RouteParameters_get_payee"))) TS_RouteP this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33862,11 +33875,11 @@ uint32_t __attribute__((export_name("TS_RouteParameters_new"))) TS_RouteParamet CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33875,22 +33888,22 @@ uint32_t __attribute__((export_name("TS_RouteParameters_new"))) TS_RouteParamet static inline uintptr_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { LDKRouteParameters ret_var = RouteParameters_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RouteParameters_clone_ptr"))) TS_RouteParameters_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RouteParameters_clone_ptr"))) TS_RouteParameters_clone_ptr(uint32_t arg) { LDKRouteParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RouteParameters_clone_ptr(&arg_conv); + intptr_t ret_val = RouteParameters_clone_ptr(&arg_conv); return ret_val; } @@ -33900,11 +33913,11 @@ uint32_t __attribute__((export_name("TS_RouteParameters_clone"))) TS_RouteParam orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33917,7 +33930,7 @@ int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RoutePa obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -33926,10 +33939,10 @@ int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RoutePa uint32_t __attribute__((export_name("TS_RouteParameters_read"))) TS_RouteParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = RouteParameters_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_Payee_free"))) TS_Payee_free(uint32_t this_obj) { @@ -33945,7 +33958,7 @@ int8_tArray __attribute__((export_name("TS_Payee_get_pubkey"))) TS_Payee_get_pu this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, Payee_get_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -33957,7 +33970,7 @@ void __attribute__((export_name("TS_Payee_set_pubkey"))) TS_Payee_set_pubkey(ui CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); Payee_set_pubkey(&this_ptr_conv, val_ref); } @@ -33967,12 +33980,12 @@ uint32_t __attribute__((export_name("TS_Payee_get_features"))) TS_Payee_get_fea this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures ret_var = Payee_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34000,15 +34013,15 @@ uint32_tArray __attribute__((export_name("TS_Payee_get_route_hints"))) TS_Payee CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t l = 0; l < ret_var.datalen; l++) { LDKRouteHint ret_conv_11_var = ret_var.data[l]; - uint64_t ret_conv_11_ref = 0; - CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_11_ref = 0; + CHECK((((uintptr_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); - ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; + ret_conv_11_ref = (uintptr_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; } @@ -34030,7 +34043,7 @@ void __attribute__((export_name("TS_Payee_set_route_hints"))) TS_Payee_set_rout val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t l = 0; l < val_constr.datalen; l++) { uint32_t val_conv_11 = val_vals[l]; LDKRouteHint val_conv_11_conv; @@ -34050,7 +34063,7 @@ uint32_t __attribute__((export_name("TS_Payee_get_expiry_time"))) TS_Payee_get_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Payee_get_expiry_time(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -34059,17 +34072,17 @@ void __attribute__((export_name("TS_Payee_set_expiry_time"))) TS_Payee_set_expi this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); Payee_set_expiry_time(&this_ptr_conv, val_conv); } uint32_t __attribute__((export_name("TS_Payee_new"))) TS_Payee_new(int8_tArray pubkey_arg, uint32_t features_arg, uint32_tArray route_hints_arg, uint32_t expiry_time_arg) { LDKPublicKey pubkey_arg_ref; CHECK(pubkey_arg->arr_len == 33); - memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); + memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg); LDKInvoiceFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); @@ -34081,7 +34094,7 @@ uint32_t __attribute__((export_name("TS_Payee_new"))) TS_Payee_new(int8_tArray route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); else route_hints_arg_constr.data = NULL; - uint32_t* route_hints_arg_vals = route_hints_arg->elems; + uint32_t* route_hints_arg_vals = route_hints_arg->elems /* XXX route_hints_arg leaks */; for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) { uint32_t route_hints_arg_conv_11 = route_hints_arg_vals[l]; LDKRouteHint route_hints_arg_conv_11_conv; @@ -34091,16 +34104,16 @@ uint32_t __attribute__((export_name("TS_Payee_new"))) TS_Payee_new(int8_tArray route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv); route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv; } - void* expiry_time_arg_ptr = (void*)(((uint64_t)expiry_time_arg) & ~1); + void* expiry_time_arg_ptr = (void*)(((uintptr_t)expiry_time_arg) & ~1); CHECK_ACCESS(expiry_time_arg_ptr); LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); - expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)expiry_time_arg) & ~1)); + expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)expiry_time_arg) & ~1)); LDKPayee ret_var = Payee_new(pubkey_arg_ref, features_arg_conv, route_hints_arg_constr, expiry_time_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34109,22 +34122,22 @@ uint32_t __attribute__((export_name("TS_Payee_new"))) TS_Payee_new(int8_tArray static inline uintptr_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { LDKPayee ret_var = Payee_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Payee_clone_ptr"))) TS_Payee_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Payee_clone_ptr"))) TS_Payee_clone_ptr(uint32_t arg) { LDKPayee arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Payee_clone_ptr(&arg_conv); + intptr_t ret_val = Payee_clone_ptr(&arg_conv); return ret_val; } @@ -34134,11 +34147,11 @@ uint32_t __attribute__((export_name("TS_Payee_clone"))) TS_Payee_clone(uint32_t orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayee ret_var = Payee_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34173,7 +34186,7 @@ int8_tArray __attribute__((export_name("TS_Payee_write"))) TS_Payee_write(uint3 obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Payee_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -34182,22 +34195,22 @@ int8_tArray __attribute__((export_name("TS_Payee_write"))) TS_Payee_write(uint3 uint32_t __attribute__((export_name("TS_Payee_read"))) TS_Payee_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = Payee_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_Payee_from_node_id"))) TS_Payee_from_node_id(int8_tArray pubkey) { LDKPublicKey pubkey_ref; CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); LDKPayee ret_var = Payee_from_node_id(pubkey_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34207,13 +34220,13 @@ uint32_t __attribute__((export_name("TS_Payee_from_node_id"))) TS_Payee_from_no uint32_t __attribute__((export_name("TS_Payee_for_keysend"))) TS_Payee_for_keysend(int8_tArray pubkey) { LDKPublicKey pubkey_ref; CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); LDKPayee ret_var = Payee_for_keysend(pubkey_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34235,15 +34248,15 @@ uint32_tArray __attribute__((export_name("TS_RouteHint_get_a"))) TS_RouteHint_g CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t o = 0; o < ret_var.datalen; o++) { LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; - uint64_t ret_conv_14_ref = 0; - CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_14_ref = 0; + CHECK((((uintptr_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); - ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; + ret_conv_14_ref = (uintptr_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; } @@ -34265,7 +34278,7 @@ void __attribute__((export_name("TS_RouteHint_set_a"))) TS_RouteHint_set_a(uint val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t o = 0; o < val_constr.datalen; o++) { uint32_t val_conv_14 = val_vals[o]; LDKRouteHintHop val_conv_14_conv; @@ -34285,7 +34298,7 @@ uint32_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); else a_arg_constr.data = NULL; - uint32_t* a_arg_vals = a_arg->elems; + uint32_t* a_arg_vals = a_arg->elems /* XXX a_arg leaks */; for (size_t o = 0; o < a_arg_constr.datalen; o++) { uint32_t a_arg_conv_14 = a_arg_vals[o]; LDKRouteHintHop a_arg_conv_14_conv; @@ -34296,11 +34309,11 @@ uint32_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint a_arg_constr.data[o] = a_arg_conv_14_conv; } LDKRouteHint ret_var = RouteHint_new(a_arg_constr); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34309,22 +34322,22 @@ uint32_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint static inline uintptr_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { LDKRouteHint ret_var = RouteHint_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RouteHint_clone_ptr"))) TS_RouteHint_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RouteHint_clone_ptr"))) TS_RouteHint_clone_ptr(uint32_t arg) { LDKRouteHint arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RouteHint_clone_ptr(&arg_conv); + intptr_t ret_val = RouteHint_clone_ptr(&arg_conv); return ret_val; } @@ -34334,11 +34347,11 @@ uint32_t __attribute__((export_name("TS_RouteHint_clone"))) TS_RouteHint_clone( orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHint ret_var = RouteHint_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34373,7 +34386,7 @@ int8_tArray __attribute__((export_name("TS_RouteHint_write"))) TS_RouteHint_wri obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -34382,10 +34395,10 @@ int8_tArray __attribute__((export_name("TS_RouteHint_write"))) TS_RouteHint_wri uint32_t __attribute__((export_name("TS_RouteHint_read"))) TS_RouteHint_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = RouteHint_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_RouteHintHop_free"))) TS_RouteHintHop_free(uint32_t this_obj) { @@ -34401,7 +34414,7 @@ int8_tArray __attribute__((export_name("TS_RouteHintHop_get_src_node_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -34413,7 +34426,7 @@ void __attribute__((export_name("TS_RouteHintHop_set_src_node_id"))) TS_RouteHi CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); } @@ -34440,11 +34453,11 @@ uint32_t __attribute__((export_name("TS_RouteHintHop_get_fees"))) TS_RouteHintH this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34488,7 +34501,7 @@ uint32_t __attribute__((export_name("TS_RouteHintHop_get_htlc_minimum_msat"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -34497,10 +34510,10 @@ void __attribute__((export_name("TS_RouteHintHop_set_htlc_minimum_msat"))) TS_R this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); } @@ -34511,7 +34524,7 @@ uint32_t __attribute__((export_name("TS_RouteHintHop_get_htlc_maximum_msat"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -34520,36 +34533,36 @@ void __attribute__((export_name("TS_RouteHintHop_set_htlc_maximum_msat"))) TS_R this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); } uint32_t __attribute__((export_name("TS_RouteHintHop_new"))) TS_RouteHintHop_new(int8_tArray src_node_id_arg, int64_t short_channel_id_arg, uint32_t fees_arg, int16_t cltv_expiry_delta_arg, uint32_t htlc_minimum_msat_arg, uint32_t htlc_maximum_msat_arg) { LDKPublicKey src_node_id_arg_ref; CHECK(src_node_id_arg->arr_len == 33); - memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); + memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg); LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1); + void* htlc_minimum_msat_arg_ptr = (void*)(((uintptr_t)htlc_minimum_msat_arg) & ~1); CHECK_ACCESS(htlc_minimum_msat_arg_ptr); LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); - htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1)); - void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1); + htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)htlc_minimum_msat_arg) & ~1)); + void* htlc_maximum_msat_arg_ptr = (void*)(((uintptr_t)htlc_maximum_msat_arg) & ~1); CHECK_ACCESS(htlc_maximum_msat_arg_ptr); LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); - htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1)); + htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)htlc_maximum_msat_arg) & ~1)); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34558,22 +34571,22 @@ uint32_t __attribute__((export_name("TS_RouteHintHop_new"))) TS_RouteHintHop_ne static inline uintptr_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { LDKRouteHintHop ret_var = RouteHintHop_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RouteHintHop_clone_ptr"))) TS_RouteHintHop_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RouteHintHop_clone_ptr"))) TS_RouteHintHop_clone_ptr(uint32_t arg) { LDKRouteHintHop arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RouteHintHop_clone_ptr(&arg_conv); + intptr_t ret_val = RouteHintHop_clone_ptr(&arg_conv); return ret_val; } @@ -34583,11 +34596,11 @@ uint32_t __attribute__((export_name("TS_RouteHintHop_clone"))) TS_RouteHintHop_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34622,7 +34635,7 @@ int8_tArray __attribute__((export_name("TS_RouteHintHop_write"))) TS_RouteHintH obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -34631,16 +34644,16 @@ int8_tArray __attribute__((export_name("TS_RouteHintHop_write"))) TS_RouteHintH uint32_t __attribute__((export_name("TS_RouteHintHop_read"))) TS_RouteHintHop_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = RouteHintHop_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_find_route"))) TS_find_route(int8_tArray our_node_pubkey, uint32_t params, uint32_t network, uint32_tArray first_hops, uint32_t logger, uint32_t scorer) { LDKPublicKey our_node_pubkey_ref; CHECK(our_node_pubkey->arr_len == 33); - memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); + memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; @@ -34657,7 +34670,7 @@ uint32_t __attribute__((export_name("TS_find_route"))) TS_find_route(int8_tArra first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); else first_hops_constr.data = NULL; - uint32_t* first_hops_vals = first_hops->elems; + uint32_t* first_hops_vals = first_hops->elems /* XXX first_hops leaks */; for (size_t q = 0; q < first_hops_constr.datalen; q++) { uint32_t first_hops_conv_16 = first_hops_vals[q]; LDKChannelDetails first_hops_conv_16_conv; @@ -34668,21 +34681,21 @@ uint32_t __attribute__((export_name("TS_find_route"))) TS_find_route(int8_tArra } first_hops_ptr = &first_hops_constr; } - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1); + void* scorer_ptr = (void*)(((uintptr_t)scorer) & ~1); if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); } LDKScore* scorer_conv = (LDKScore*)scorer_ptr; LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = find_route(our_node_pubkey_ref, ¶ms_conv, &network_conv, first_hops_ptr, logger_conv, scorer_conv); if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_Score_free"))) TS_Score_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -34691,7 +34704,7 @@ void __attribute__((export_name("TS_Score_free"))) TS_Score_free(uint32_t this_ void __attribute__((export_name("TS_LockableScore_free"))) TS_LockableScore_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -34707,15 +34720,15 @@ void __attribute__((export_name("TS_MultiThreadedLockableScore_free"))) TS_Mult } uint32_t __attribute__((export_name("TS_MultiThreadedLockableScore_new"))) TS_MultiThreadedLockableScore_new(uint32_t score) { - void* score_ptr = (void*)(((uint64_t)score) & ~1); + void* score_ptr = (void*)(((uintptr_t)score) & ~1); CHECK_ACCESS(score_ptr); LDKScore score_conv = *(LDKScore*)(score_ptr); LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34817,11 +34830,11 @@ void __attribute__((export_name("TS_ScoringParameters_set_failure_penalty_half_ uint32_t __attribute__((export_name("TS_ScoringParameters_new"))) TS_ScoringParameters_new(int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int16_t overuse_penalty_start_1024th_arg, int64_t overuse_penalty_msat_per_1024th_arg, int64_t failure_penalty_half_life_arg) { LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34834,7 +34847,7 @@ int8_tArray __attribute__((export_name("TS_ScoringParameters_write"))) TS_Scori obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ScoringParameters_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -34843,19 +34856,19 @@ int8_tArray __attribute__((export_name("TS_ScoringParameters_write"))) TS_Scori uint32_t __attribute__((export_name("TS_ScoringParameters_read"))) TS_ScoringParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = ScoringParameters_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ScoringParameters_default"))) TS_ScoringParameters_default() { LDKScoringParameters ret_var = ScoringParameters_default(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } diff --git a/ts/bindings.c.body b/ts/bindings.c.body index 3e655d01..8169a425 100644 --- a/ts/bindings.c.body +++ b/ts/bindings.c.body @@ -21,6 +21,7 @@ void *malloc(size_t size); void free(void *ptr); #define MALLOC(a, _) malloc(a) +#define do_MALLOC(a, _b, _c) malloc(a) #define FREE(p) if ((unsigned long)(p) > 4096) { free(p); } #define DO_ASSERT(a) (void)(a) #define CHECK(a) @@ -40,8 +41,8 @@ _Static_assert(sizeof(void*) == 4, "Pointers mut be 32 bits"); ty elems[]; \ }; \ typedef struct name##array * name##Array; \ - static inline name##Array init_##name##Array(size_t arr_len) { \ - name##Array arr = (name##Array)MALLOC(arr_len * sizeof(ty) + sizeof(uint32_t), "##name array init"); \ + static inline name##Array init_##name##Array(size_t arr_len, int lineno) { \ + name##Array arr = (name##Array)do_MALLOC(arr_len * sizeof(ty) + sizeof(uint32_t), #name" array init", lineno); \ arr->arr_len = arr_len; \ return arr; \ } @@ -54,7 +55,7 @@ DECL_ARR_TYPE(char, char); typedef charArray jstring; static inline jstring str_ref_to_ts(const char* chars, size_t len) { - charArray arr = init_charArray(len); + charArray arr = init_charArray(len, __LINE__); memcpy(arr->elems, chars, len); return arr; } @@ -78,6 +79,18 @@ uint32_t __attribute__((export_name("TS_malloc"))) TS_malloc(uint32_t size) { void __attribute__((export_name("TS_free"))) TS_free(uint32_t ptr) { FREE((void*)ptr); } + +jstring __attribute__((export_name("TS_get_ldk_c_bindings_version"))) TS_get_ldk_c_bindings_version() { + const char *res = check_get_ldk_bindings_version(); + if (res == NULL) return NULL; + return str_ref_to_ts(res, strlen(res)); +} +jstring __attribute__((export_name("TS_get_ldk_version"))) get_ldk_version() { + const char *res = check_get_ldk_version(); + if (res == NULL) return NULL; + return str_ref_to_ts(res, strlen(res)); +} +#include "version.c" static inline struct LDKThirtyTwoBytes ThirtyTwoBytes_clone(const struct LDKThirtyTwoBytes *orig) { struct LDKThirtyTwoBytes ret; memcpy(ret.data, orig->data, 32); return ret; } static inline LDKAccessError LDKAccessError_from_js(int32_t ord) { switch (ord) { @@ -213,7 +226,7 @@ static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) { 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(uint32_t thing) { LDKTxOut* thing_conv = (LDKTxOut*)(thing & ~1); LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -232,11 +245,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(owner & ~1); LDKChannelConfig ret_var = CResult_ChannelConfigDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -250,11 +263,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_err"))) TS_CResult_ChannelConfigDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -268,11 +281,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_ok"))) TS_CResult_OutPointDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)(owner & ~1); LDKOutPoint ret_var = CResult_OutPointDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -286,11 +299,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_err"))) TS_CResult_OutPointDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_OutPointDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -303,7 +316,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_ok"))) TS_CResult_SecretKeyErrorZ_get_ok(uint32_t owner) { LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes, 32); return ret_arr; } @@ -324,7 +337,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_ok"))) TS_CResult_PublicKeyErrorZ_get_ok(uint32_t owner) { LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form, 33); return ret_arr; } @@ -346,11 +359,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(owner & ~1); LDKTxCreationKeys ret_var = CResult_TxCreationKeysDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -364,11 +377,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -382,11 +395,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(owner & ~1); LDKChannelPublicKeys ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -400,11 +413,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -418,11 +431,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_ok"))) TS_CResult_TxCreationKeysErrorZ_get_ok(uint32_t owner) { LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)(owner & ~1); LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -459,11 +472,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(owner & ~1); LDKHTLCOutputInCommitment ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -477,11 +490,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -495,11 +508,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(owner & ~1); LDKCounterpartyChannelTransactionParameters ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -513,11 +526,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -531,11 +544,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(owner & ~1); LDKChannelTransactionParameters ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -549,11 +562,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -567,11 +580,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKHolderCommitmentTransaction ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -585,11 +598,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -603,11 +616,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKBuiltCommitmentTransaction ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -621,11 +634,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -639,11 +652,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_get_ok(uint32_t owner) { LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)(owner & ~1); LDKTrustedClosingTransaction ret_var = *CResult_TrustedClosingTransactionNoneZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner & ~1; + ret_ref = (uintptr_t)ret_var.inner & ~1; return ret_ref; } @@ -663,11 +676,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKCommitmentTransaction ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -681,11 +694,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -699,11 +712,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok(uint32_t owner) { LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)(owner & ~1); LDKTrustedCommitmentTransaction ret_var = *CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner & ~1; + ret_ref = (uintptr_t)ret_var.inner & ~1; return ret_ref; } @@ -724,10 +737,10 @@ ptrArray __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_ok"))) LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)(owner & ~1); LDKCVec_SignatureZ ret_var = CResult_CVec_SignatureZNoneZ_get_ok(owner_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { - int8_tArray ret_conv_12_arr = init_int8_tArray(64); + int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__); memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64); ret_arr_ptr[m] = ret_conv_12_arr; } @@ -751,11 +764,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(owner & ~1); LDKShutdownScript ret_var = CResult_ShutdownScriptDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -769,11 +782,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -787,11 +800,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(uint32_t owner) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(owner & ~1); LDKShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -805,11 +818,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(uint32_t owner) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(owner & ~1); LDKInvalidShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -842,7 +855,7 @@ LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) { LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(ret_ref.data, ret->elems, ret_ref.datalen); + memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); return ret_ref; } static void LDKType_JCalls_cloned(LDKType* new_obj) { @@ -870,7 +883,7 @@ long __attribute__((export_name("TS_LDKType_new"))) TS_LDKType_new(JSValue o) { return (long)res_ptr; } int16_t __attribute__((export_name("TS_Type_type_id"))) TS_Type_type_id(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKType* this_arg_conv = (LDKType*)this_arg_ptr; int16_t ret_val = (this_arg_conv->type_id)(this_arg_conv->this_arg); @@ -878,7 +891,7 @@ int16_t __attribute__((export_name("TS_Type_type_id"))) TS_Type_type_id(uint32_ } jstring __attribute__((export_name("TS_Type_debug_str"))) TS_Type_debug_str(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKType* this_arg_conv = (LDKType*)this_arg_ptr; LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg); @@ -888,11 +901,11 @@ jstring __attribute__((export_name("TS_Type_debug_str"))) TS_Type_debug_str(uin } int8_tArray __attribute__((export_name("TS_Type_write"))) TS_Type_write(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKType* this_arg_conv = (LDKType*)this_arg_ptr; LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -911,7 +924,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_TypeZ_Some_get_some"))) TS_LD assert(obj->tag == LDKCOption_TypeZ_Some); LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType"); *some_ret = Type_clone(&obj->some); - return (uint64_t)some_ret; + return (uintptr_t)some_ret; } static inline struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); @@ -921,7 +934,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_o LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(owner & ~1); LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -932,11 +945,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_err"))) TS_CResult_COption_TypeZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -971,11 +984,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(owner & ~1); LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -989,11 +1002,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -1014,33 +1027,33 @@ uint32_t __attribute__((export_name("TS_LDKMonitorEvent_HTLCEvent_get_htlc_event LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); assert(obj->tag == LDKMonitorEvent_HTLCEvent); LDKHTLCUpdate htlc_event_var = obj->htlc_event; - uint64_t htlc_event_ref = 0; - CHECK((((uint64_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t htlc_event_ref = 0; + CHECK((((uintptr_t)htlc_event_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&htlc_event_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var); - htlc_event_ref = (uint64_t)htlc_event_var.inner & ~1; + htlc_event_ref = (uintptr_t)htlc_event_var.inner & ~1; return htlc_event_ref; } uint32_t __attribute__((export_name("TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed"))) TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(uint32_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); assert(obj->tag == LDKMonitorEvent_CommitmentTxConfirmed); LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed; - uint64_t commitment_tx_confirmed_ref = 0; - CHECK((((uint64_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t commitment_tx_confirmed_ref = 0; + CHECK((((uintptr_t)commitment_tx_confirmed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&commitment_tx_confirmed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var); - commitment_tx_confirmed_ref = (uint64_t)commitment_tx_confirmed_var.inner & ~1; + commitment_tx_confirmed_ref = (uintptr_t)commitment_tx_confirmed_var.inner & ~1; return commitment_tx_confirmed_ref; } uint32_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo"))) TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo(uint32_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); assert(obj->tag == LDKMonitorEvent_UpdateCompleted); LDKOutPoint funding_txo_var = obj->update_completed.funding_txo; - uint64_t funding_txo_ref = 0; - CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t funding_txo_ref = 0; + CHECK((((uintptr_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); - funding_txo_ref = (uint64_t)funding_txo_var.inner & ~1; + funding_txo_ref = (uintptr_t)funding_txo_var.inner & ~1; return funding_txo_ref; } int64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id"))) TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(uint32_t ptr) { @@ -1052,11 +1065,11 @@ uint32_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateFailed_get_update_ LDKMonitorEvent *obj = (LDKMonitorEvent*)(ptr & ~1); assert(obj->tag == LDKMonitorEvent_UpdateFailed); LDKOutPoint update_failed_var = obj->update_failed; - uint64_t update_failed_ref = 0; - CHECK((((uint64_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t update_failed_ref = 0; + CHECK((((uintptr_t)update_failed_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_failed_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var); - update_failed_ref = (uint64_t)update_failed_var.inner & ~1; + update_failed_ref = (uintptr_t)update_failed_var.inner & ~1; return update_failed_ref; } uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_ty_from_ptr"))) TS_LDKCOption_MonitorEventZ_ty_from_ptr(uint32_t ptr) { @@ -1070,7 +1083,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_ty_from_ptr"))) uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_Some_get_some"))) TS_LDKCOption_MonitorEventZ_Some_get_some(uint32_t ptr) { LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)(ptr & ~1); assert(obj->tag == LDKCOption_MonitorEventZ_Some); - uint64_t some_ref = ((uint64_t)&obj->some) | 1; + uintptr_t some_ref = ((uintptr_t)&obj->some) | 1; return some_ref; } static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){ @@ -1081,7 +1094,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErro LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(owner & ~1); LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -1092,11 +1105,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -1110,11 +1123,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(owner & ~1); LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -1128,11 +1141,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -1163,11 +1176,11 @@ static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPoi uint32_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_a"))) TS_C2Tuple_OutPointScriptZ_get_a(uint32_t owner) { LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)(owner & ~1); LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -1180,7 +1193,7 @@ static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPoi int8_tArray __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_b"))) TS_C2Tuple_OutPointScriptZ_get_b(uint32_t owner) { LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)(owner & ~1); LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -1201,7 +1214,7 @@ static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ int8_tArray __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_b"))) TS_C2Tuple_u32ScriptZ_get_b(uint32_t owner) { LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)(owner & ~1); LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_get_b(owner_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -1212,7 +1225,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get } int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(uint32_t owner) { LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -1224,12 +1237,12 @@ uint32_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32Script LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(owner & ~1); LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t v = 0; v < ret_var.datalen; v++) { LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = &ret_var.data[v]; // Warning: we really need to clone here, but no clone is available for LDKC2Tuple_u32ScriptZ - ret_arr_ptr[v] = ((uint64_t)ret_conv_21_conv) | 1; + ret_arr_ptr[v] = ((uintptr_t)ret_conv_21_conv) | 1; } return ret_arr; @@ -1253,21 +1266,21 @@ uint32_t __attribute__((export_name("TS_LDKPaymentPurpose_ty_from_ptr"))) TS_LDK int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(uint32_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); assert(obj->tag == LDKPaymentPurpose_InvoicePayment); - int8_tArray payment_preimage_arr = init_int8_tArray(32); + int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__); memcpy(payment_preimage_arr->elems, obj->invoice_payment.payment_preimage.data, 32); return payment_preimage_arr; } int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret(uint32_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); assert(obj->tag == LDKPaymentPurpose_InvoicePayment); - int8_tArray payment_secret_arr = init_int8_tArray(32); + int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); memcpy(payment_secret_arr->elems, obj->invoice_payment.payment_secret.data, 32); return payment_secret_arr; } int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment"))) TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(uint32_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1); assert(obj->tag == LDKPaymentPurpose_SpontaneousPayment); - int8_tArray spontaneous_payment_arr = init_int8_tArray(32); + int8_tArray spontaneous_payment_arr = init_int8_tArray(32, __LINE__); memcpy(spontaneous_payment_arr->elems, obj->spontaneous_payment.data, 32); return spontaneous_payment_arr; } @@ -1297,11 +1310,11 @@ uint32_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelUpdateMessage_ge LDKNetworkUpdate *obj = (LDKNetworkUpdate*)(ptr & ~1); assert(obj->tag == LDKNetworkUpdate_ChannelUpdateMessage); LDKChannelUpdate msg_var = obj->channel_update_message.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelClosed_get_short_channel_id"))) TS_LDKNetworkUpdate_ChannelClosed_get_short_channel_id(uint32_t ptr) { @@ -1317,7 +1330,7 @@ jboolean __attribute__((export_name("TS_LDKNetworkUpdate_ChannelClosed_get_is_pe int8_tArray __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_node_id"))) TS_LDKNetworkUpdate_NodeFailure_get_node_id(uint32_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)(ptr & ~1); assert(obj->tag == LDKNetworkUpdate_NodeFailure); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->node_failure.node_id.compressed_form, 33); return node_id_arr; } @@ -1337,7 +1350,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_ty_from_ptr")) uint32_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_Some_get_some"))) TS_LDKCOption_NetworkUpdateZ_Some_get_some(uint32_t ptr) { LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)(ptr & ~1); assert(obj->tag == LDKCOption_NetworkUpdateZ_Some); - uint64_t some_ref = ((uint64_t)&obj->some) | 1; + uintptr_t some_ref = ((uintptr_t)&obj->some) | 1; return some_ref; } static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) { @@ -1360,39 +1373,39 @@ uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutpu LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)(ptr & ~1); assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput); LDKOutPoint outpoint_var = obj->static_output.outpoint; - uint64_t outpoint_ref = 0; - CHECK((((uint64_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t outpoint_ref = 0; + CHECK((((uintptr_t)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); - outpoint_ref = (uint64_t)outpoint_var.inner & ~1; + outpoint_ref = (uintptr_t)outpoint_var.inner & ~1; return outpoint_ref; } uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_output"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_output(uint32_t ptr) { LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)(ptr & ~1); assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput); - uint64_t output_ref = ((uint64_t)&obj->static_output.output) | 1; - return (uint64_t)output_ref; + uintptr_t output_ref = ((uintptr_t)&obj->static_output.output) | 1; + return (uintptr_t)output_ref; } uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output"))) TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(uint32_t ptr) { LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)(ptr & ~1); assert(obj->tag == LDKSpendableOutputDescriptor_DelayedPaymentOutput); LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output; - uint64_t delayed_payment_output_ref = 0; - CHECK((((uint64_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t delayed_payment_output_ref = 0; + CHECK((((uintptr_t)delayed_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&delayed_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var); - delayed_payment_output_ref = (uint64_t)delayed_payment_output_var.inner & ~1; + delayed_payment_output_ref = (uintptr_t)delayed_payment_output_var.inner & ~1; return delayed_payment_output_ref; } uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output"))) TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output(uint32_t ptr) { LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)(ptr & ~1); assert(obj->tag == LDKSpendableOutputDescriptor_StaticPaymentOutput); LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output; - uint64_t static_payment_output_ref = 0; - CHECK((((uint64_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t static_payment_output_ref = 0; + CHECK((((uintptr_t)static_payment_output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&static_payment_output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var); - static_payment_output_ref = (uint64_t)static_payment_output_var.inner & ~1; + static_payment_output_ref = (uintptr_t)static_payment_output_var.inner & ~1; return static_payment_output_ref; } static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) { @@ -1450,7 +1463,7 @@ uint32_t __attribute__((export_name("TS_LDKEvent_ty_from_ptr"))) TS_LDKEvent_ty_ int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_FundingGenerationReady); - int8_tArray temporary_channel_id_arr = init_int8_tArray(32); + int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__); memcpy(temporary_channel_id_arr->elems, obj->funding_generation_ready.temporary_channel_id.data, 32); return temporary_channel_id_arr; } @@ -1463,7 +1476,7 @@ int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_o LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_FundingGenerationReady); LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script; - int8_tArray output_script_arr = init_int8_tArray(output_script_var.datalen); + int8_tArray output_script_arr = init_int8_tArray(output_script_var.datalen, __LINE__); memcpy(output_script_arr->elems, output_script_var.data, output_script_var.datalen); return output_script_arr; } @@ -1475,7 +1488,7 @@ int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_user_ int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_payment_hash"))) TS_LDKEvent_PaymentReceived_get_payment_hash(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentReceived); - int8_tArray payment_hash_arr = init_int8_tArray(32); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); memcpy(payment_hash_arr->elems, obj->payment_received.payment_hash.data, 32); return payment_hash_arr; } @@ -1487,47 +1500,47 @@ int64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_amt"))) TS_L uint32_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_purpose"))) TS_LDKEvent_PaymentReceived_get_purpose(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentReceived); - uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1; + uintptr_t purpose_ref = ((uintptr_t)&obj->payment_received.purpose) | 1; return purpose_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_id"))) TS_LDKEvent_PaymentSent_get_payment_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentSent); - int8_tArray payment_id_arr = init_int8_tArray(32); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, obj->payment_sent.payment_id.data, 32); return payment_id_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_preimage"))) TS_LDKEvent_PaymentSent_get_payment_preimage(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentSent); - int8_tArray payment_preimage_arr = init_int8_tArray(32); + int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__); memcpy(payment_preimage_arr->elems, obj->payment_sent.payment_preimage.data, 32); return payment_preimage_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_hash"))) TS_LDKEvent_PaymentSent_get_payment_hash(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentSent); - int8_tArray payment_hash_arr = init_int8_tArray(32); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); memcpy(payment_hash_arr->elems, obj->payment_sent.payment_hash.data, 32); return payment_hash_arr; } uint32_t __attribute__((export_name("TS_LDKEvent_PaymentSent_get_fee_paid_msat"))) TS_LDKEvent_PaymentSent_get_fee_paid_msat(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentSent); - uint64_t fee_paid_msat_ref = ((uint64_t)&obj->payment_sent.fee_paid_msat) | 1; + uintptr_t fee_paid_msat_ref = ((uintptr_t)&obj->payment_sent.fee_paid_msat) | 1; return fee_paid_msat_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_id"))) TS_LDKEvent_PaymentPathFailed_get_payment_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathFailed); - int8_tArray payment_id_arr = init_int8_tArray(32); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, obj->payment_path_failed.payment_id.data, 32); return payment_id_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_hash"))) TS_LDKEvent_PaymentPathFailed_get_payment_hash(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathFailed); - int8_tArray payment_hash_arr = init_int8_tArray(32); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); memcpy(payment_hash_arr->elems, obj->payment_path_failed.payment_hash.data, 32); return payment_hash_arr; } @@ -1539,7 +1552,7 @@ jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_rejected_ uint32_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_network_update"))) TS_LDKEvent_PaymentPathFailed_get_network_update(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathFailed); - uint64_t network_update_ref = ((uint64_t)&obj->payment_path_failed.network_update) | 1; + uintptr_t network_update_ref = ((uintptr_t)&obj->payment_path_failed.network_update) | 1; return network_update_ref; } jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_all_paths_failed"))) TS_LDKEvent_PaymentPathFailed_get_all_paths_failed(uint32_t ptr) { @@ -1552,15 +1565,15 @@ uint32_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_path assert(obj->tag == LDKEvent_PaymentPathFailed); LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path; uint32_tArray path_arr = NULL; - path_arr = init_uint32_tArray(path_var.datalen); + path_arr = init_uint32_tArray(path_var.datalen, __LINE__); uint32_t *path_arr_ptr = (uint32_t*)(((uint8_t*)path_arr) + 4); for (size_t k = 0; k < path_var.datalen; k++) { LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner & ~1; path_arr_ptr[k] = path_conv_10_ref; } @@ -1569,33 +1582,33 @@ uint32_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_path uint32_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_short_channel_id"))) TS_LDKEvent_PaymentPathFailed_get_short_channel_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathFailed); - uint64_t short_channel_id_ref = ((uint64_t)&obj->payment_path_failed.short_channel_id) | 1; + uintptr_t short_channel_id_ref = ((uintptr_t)&obj->payment_path_failed.short_channel_id) | 1; return short_channel_id_ref; } uint32_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_retry"))) TS_LDKEvent_PaymentPathFailed_get_retry(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathFailed); LDKRouteParameters retry_var = obj->payment_path_failed.retry; - uint64_t retry_ref = 0; - if ((uint64_t)retry_var.inner > 4096) { - CHECK((((uint64_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t retry_ref = 0; + if ((uintptr_t)retry_var.inner > 4096) { + CHECK((((uintptr_t)retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var); - retry_ref = (uint64_t)retry_var.inner & ~1; + retry_ref = (uintptr_t)retry_var.inner & ~1; } return retry_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_id"))) TS_LDKEvent_PaymentFailed_get_payment_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentFailed); - int8_tArray payment_id_arr = init_int8_tArray(32); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, obj->payment_failed.payment_id.data, 32); return payment_id_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_hash"))) TS_LDKEvent_PaymentFailed_get_payment_hash(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentFailed); - int8_tArray payment_hash_arr = init_int8_tArray(32); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); memcpy(payment_hash_arr->elems, obj->payment_failed.payment_hash.data, 32); return payment_hash_arr; } @@ -1609,10 +1622,10 @@ uint32_tArray __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_outpu assert(obj->tag == LDKEvent_SpendableOutputs); LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; uint32_tArray outputs_arr = NULL; - outputs_arr = init_uint32_tArray(outputs_var.datalen); + outputs_arr = init_uint32_tArray(outputs_var.datalen, __LINE__); uint32_t *outputs_arr_ptr = (uint32_t*)(((uint8_t*)outputs_arr) + 4); for (size_t b = 0; b < outputs_var.datalen; b++) { - uint64_t outputs_conv_27_ref = ((uint64_t)&outputs_var.data[b]) | 1; + uintptr_t outputs_conv_27_ref = ((uintptr_t)&outputs_var.data[b]) | 1; outputs_arr_ptr[b] = outputs_conv_27_ref; } @@ -1621,7 +1634,7 @@ uint32_tArray __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_outpu uint32_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_fee_earned_msat"))) TS_LDKEvent_PaymentForwarded_get_fee_earned_msat(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentForwarded); - uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1; + uintptr_t fee_earned_msat_ref = ((uintptr_t)&obj->payment_forwarded.fee_earned_msat) | 1; return fee_earned_msat_ref; } jboolean __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx"))) TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(uint32_t ptr) { @@ -1632,7 +1645,7 @@ jboolean __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_claim_from int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_channel_id"))) TS_LDKEvent_ChannelClosed_get_channel_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_ChannelClosed); - int8_tArray channel_id_arr = init_int8_tArray(32); + int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); memcpy(channel_id_arr->elems, obj->channel_closed.channel_id.data, 32); return channel_id_arr; } @@ -1644,13 +1657,13 @@ int64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_user_channel_i uint32_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_reason"))) TS_LDKEvent_ChannelClosed_get_reason(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_ChannelClosed); - uint64_t reason_ref = ((uint64_t)&obj->channel_closed.reason) | 1; + uintptr_t reason_ref = ((uintptr_t)&obj->channel_closed.reason) | 1; return reason_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_channel_id"))) TS_LDKEvent_DiscardFunding_get_channel_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_DiscardFunding); - int8_tArray channel_id_arr = init_int8_tArray(32); + int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); memcpy(channel_id_arr->elems, obj->discard_funding.channel_id.data, 32); return channel_id_arr; } @@ -1658,21 +1671,21 @@ int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_transacti LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_DiscardFunding); LDKTransaction transaction_var = obj->discard_funding.transaction; - int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen); + int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen, __LINE__); memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen); return transaction_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_id"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_id(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathSuccessful); - int8_tArray payment_id_arr = init_int8_tArray(32); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, obj->payment_path_successful.payment_id.data, 32); return payment_id_arr; } int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_hash"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_hash(uint32_t ptr) { LDKEvent *obj = (LDKEvent*)(ptr & ~1); assert(obj->tag == LDKEvent_PaymentPathSuccessful); - int8_tArray payment_hash_arr = init_int8_tArray(32); + int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__); memcpy(payment_hash_arr->elems, obj->payment_path_successful.payment_hash.data, 32); return payment_hash_arr; } @@ -1681,15 +1694,15 @@ uint32_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_ assert(obj->tag == LDKEvent_PaymentPathSuccessful); LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path; uint32_tArray path_arr = NULL; - path_arr = init_uint32_tArray(path_var.datalen); + path_arr = init_uint32_tArray(path_var.datalen, __LINE__); uint32_t *path_arr_ptr = (uint32_t*)(((uint8_t*)path_arr) + 4); for (size_t k = 0; k < path_var.datalen; k++) { LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uint64_t)path_conv_10_var.inner & ~1; + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner & ~1; path_arr_ptr[k] = path_conv_10_ref; } @@ -1705,9 +1718,9 @@ static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ return owner->a; } -int64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_a"))) TS_C2Tuple_usizeTransactionZ_get_a(uint32_t owner) { +intptr_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_a"))) TS_C2Tuple_usizeTransactionZ_get_a(uint32_t owner) { LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); - int64_t ret_val = C2Tuple_usizeTransactionZ_get_a(owner_conv); + intptr_t ret_val = C2Tuple_usizeTransactionZ_get_a(owner_conv); return ret_val; } @@ -1717,7 +1730,7 @@ static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_u int8_tArray __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_b"))) TS_C2Tuple_usizeTransactionZ_get_b(uint32_t owner) { LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)(owner & ~1); LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -1745,7 +1758,7 @@ uint32_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_b"))) TS_C2Tuple_ LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)(owner & ~1); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); *ret_ref = C2Tuple_u32TxOutZ_get_b(owner_conv); - return (uint64_t)ret_ref; + return (uintptr_t)ret_ref; } static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) { @@ -1760,7 +1773,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_ } int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(uint32_t owner) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -1772,12 +1785,12 @@ uint32_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(owner & ~1); LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t u = 0; u < ret_var.datalen; u++) { LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); *ret_conv_20_conv = ret_var.data[u]; - ret_arr_ptr[u] = ((uint64_t)ret_conv_20_conv); + ret_arr_ptr[u] = ((uintptr_t)ret_conv_20_conv); } FREE(ret_var.data); @@ -1855,7 +1868,7 @@ static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2T } int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_a"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_a(uint32_t owner) { LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form, 64); return ret_arr; } @@ -1867,10 +1880,10 @@ ptrArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_b LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(owner & ~1); LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { - int8_tArray ret_conv_12_arr = init_int8_tArray(64); + int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__); memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64); ret_arr_ptr[m] = ret_conv_12_arr; } @@ -1886,7 +1899,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_Signature LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(owner & ~1); LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){ @@ -1904,7 +1917,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_SignatureNoneZ_get_ok"))) TS_CResult_SignatureNoneZ_get_ok(uint32_t owner) { LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form, 64); return ret_arr; } @@ -1933,7 +1946,7 @@ LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, ui int8_tArray ret = (int8_tArray)js_invoke_function_1(j_calls->instance_ptr, 3, (uint32_t)idx); LDKPublicKey ret_ref; CHECK(ret->arr_len == 33); - memcpy(ret_ref.compressed_form, ret->elems, 33); + memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret); return ret_ref; } LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) { @@ -1941,23 +1954,23 @@ LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_a int8_tArray ret = (int8_tArray)js_invoke_function_1(j_calls->instance_ptr, 4, (uint32_t)idx); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); - memcpy(ret_ref.data, ret->elems, 32); + memcpy(ret_ref.data, ret->elems, 32); FREE(ret); return ret_ref; } LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKHolderCommitmentTransaction holder_tx_var = *holder_tx; - uint64_t holder_tx_ref = 0; + uintptr_t holder_tx_ref = 0; holder_tx_var = HolderCommitmentTransaction_clone(holder_tx); - CHECK((((uint64_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)holder_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&holder_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var); - holder_tx_ref = (uint64_t)holder_tx_var.inner; + holder_tx_ref = (uintptr_t)holder_tx_var.inner; if (holder_tx_var.is_owned) { holder_tx_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 5, (uint32_t)holder_tx_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); FREE((void*)ret); @@ -1968,23 +1981,23 @@ LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) { int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 6); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); - memcpy(ret_ref.data, ret->elems, 32); + memcpy(ret_ref.data, ret->elems, 32); FREE(ret); return ret_ref; } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKCommitmentTransaction commitment_tx_var = *commitment_tx; - uint64_t commitment_tx_ref = 0; + uintptr_t commitment_tx_ref = 0; commitment_tx_var = CommitmentTransaction_clone(commitment_tx); - CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); - commitment_tx_ref = (uint64_t)commitment_tx_var.inner; + commitment_tx_ref = (uintptr_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 7, (uint32_t)commitment_tx_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); FREE((void*)ret); @@ -1992,10 +2005,10 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L } LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; - int8_tArray secret_arr = init_int8_tArray(32); + int8_tArray secret_arr = init_int8_tArray(32, __LINE__); memcpy(secret_arr->elems, *secret, 32); uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 8, (uint32_t)idx, (uint32_t)secret_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2004,17 +2017,17 @@ LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const vo LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx; - uint64_t commitment_tx_ref = 0; + uintptr_t commitment_tx_ref = 0; commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx); - CHECK((((uint64_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var); - commitment_tx_ref = (uint64_t)commitment_tx_var.inner; + commitment_tx_ref = (uintptr_t)commitment_tx_var.inner; if (commitment_tx_var.is_owned) { commitment_tx_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 9, (uint32_t)commitment_tx_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2023,13 +2036,13 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl 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]) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKTransaction justice_tx_var = justice_tx; - int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen); + int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__); memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen); Transaction_free(justice_tx_var); - int8_tArray per_commitment_key_arr = init_int8_tArray(32); + int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__); memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32); uint32_t ret = js_invoke_function_4(j_calls->instance_ptr, 10, (uint32_t)justice_tx_arr, (uint32_t)input, (uint32_t)amount, (uint32_t)per_commitment_key_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2038,23 +2051,23 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo 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) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKTransaction justice_tx_var = justice_tx; - int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen); + int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__); memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen); Transaction_free(justice_tx_var); - int8_tArray per_commitment_key_arr = init_int8_tArray(32); + int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__); memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32); LDKHTLCOutputInCommitment htlc_var = *htlc; - uint64_t htlc_ref = 0; + uintptr_t htlc_ref = 0; htlc_var = HTLCOutputInCommitment_clone(htlc); - CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); - htlc_ref = (uint64_t)htlc_var.inner; + htlc_ref = (uintptr_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; } uint32_t ret = js_invoke_function_5(j_calls->instance_ptr, 11, (uint32_t)justice_tx_arr, (uint32_t)input, (uint32_t)amount, (uint32_t)per_commitment_key_arr, (uint32_t)htlc_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2063,23 +2076,23 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void 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) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKTransaction htlc_tx_var = htlc_tx; - int8_tArray htlc_tx_arr = init_int8_tArray(htlc_tx_var.datalen); + int8_tArray htlc_tx_arr = init_int8_tArray(htlc_tx_var.datalen, __LINE__); memcpy(htlc_tx_arr->elems, htlc_tx_var.data, htlc_tx_var.datalen); Transaction_free(htlc_tx_var); - int8_tArray per_commitment_point_arr = init_int8_tArray(33); + int8_tArray per_commitment_point_arr = init_int8_tArray(33, __LINE__); memcpy(per_commitment_point_arr->elems, per_commitment_point.compressed_form, 33); LDKHTLCOutputInCommitment htlc_var = *htlc; - uint64_t htlc_ref = 0; + uintptr_t htlc_ref = 0; htlc_var = HTLCOutputInCommitment_clone(htlc); - CHECK((((uint64_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var); - htlc_ref = (uint64_t)htlc_var.inner; + htlc_ref = (uintptr_t)htlc_var.inner; if (htlc_var.is_owned) { htlc_ref |= 1; } uint32_t ret = js_invoke_function_5(j_calls->instance_ptr, 12, (uint32_t)htlc_tx_arr, (uint32_t)input, (uint32_t)amount, (uint32_t)per_commitment_point_arr, (uint32_t)htlc_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2088,17 +2101,17 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKClosingTransaction closing_tx_var = *closing_tx; - uint64_t closing_tx_ref = 0; + uintptr_t closing_tx_ref = 0; closing_tx_var = ClosingTransaction_clone(closing_tx); - CHECK((((uint64_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)closing_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&closing_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var); - closing_tx_ref = (uint64_t)closing_tx_var.inner; + closing_tx_ref = (uintptr_t)closing_tx_var.inner; if (closing_tx_var.is_owned) { closing_tx_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 13, (uint32_t)closing_tx_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2107,17 +2120,17 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKUnsignedChannelAnnouncement msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UnsignedChannelAnnouncement_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 14, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -2126,12 +2139,12 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; LDKChannelTransactionParameters channel_parameters_var = *channel_parameters; - uint64_t channel_parameters_ref = 0; + uintptr_t channel_parameters_ref = 0; channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters); - CHECK((((uint64_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var); - channel_parameters_ref = (uint64_t)channel_parameters_var.inner; + channel_parameters_ref = (uintptr_t)channel_parameters_var.inner; if (channel_parameters_var.is_owned) { channel_parameters_ref |= 1; } @@ -2178,25 +2191,25 @@ long __attribute__((export_name("TS_LDKBaseSign_new"))) TS_LDKBaseSign_new(JSVa return (long)res_ptr; } int8_tArray __attribute__((export_name("TS_BaseSign_get_per_commitment_point"))) TS_BaseSign_get_per_commitment_point(uint32_t this_arg, int64_t idx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33); return ret_arr; } int8_tArray __attribute__((export_name("TS_BaseSign_release_commitment_secret"))) TS_BaseSign_release_commitment_secret(uint32_t this_arg, int64_t idx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32); return ret_arr; } uint32_t __attribute__((export_name("TS_BaseSign_validate_holder_commitment"))) TS_BaseSign_validate_holder_commitment(uint32_t this_arg, uint32_t holder_tx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKHolderCommitmentTransaction holder_tx_conv; @@ -2205,20 +2218,20 @@ uint32_t __attribute__((export_name("TS_BaseSign_validate_holder_commitment"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_BaseSign_channel_keys_id"))) TS_BaseSign_channel_keys_id(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32); return ret_arr; } uint32_t __attribute__((export_name("TS_BaseSign_sign_counterparty_commitment"))) TS_BaseSign_sign_counterparty_commitment(uint32_t this_arg, uint32_t commitment_tx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKCommitmentTransaction commitment_tx_conv; @@ -2227,24 +2240,24 @@ uint32_t __attribute__((export_name("TS_BaseSign_sign_counterparty_commitment") CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_BaseSign_validate_counterparty_revocation"))) TS_BaseSign_validate_counterparty_revocation(uint32_t this_arg, int64_t idx, int8_tArray secret) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; unsigned char secret_arr[32]; CHECK(secret->arr_len == 32); - memcpy(secret_arr, secret->elems, 32); + memcpy(secret_arr, secret->elems, 32); FREE(secret); unsigned char (*secret_ref)[32] = &secret_arr; LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_BaseSign_sign_holder_commitment_and_htlcs"))) TS_BaseSign_sign_holder_commitment_and_htlcs(uint32_t this_arg, uint32_t commitment_tx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKHolderCommitmentTransaction commitment_tx_conv; @@ -2253,39 +2266,39 @@ uint32_t __attribute__((export_name("TS_BaseSign_sign_holder_commitment_and_htl CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -uint32_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_output"))) TS_BaseSign_sign_justice_revoked_output(uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); +uint32_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_output"))) TS_BaseSign_sign_justice_revoked_output(uint32_t this_arg, int8_tArray justice_tx, intptr_t input, int64_t amount, int8_tArray per_commitment_key) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKTransaction justice_tx_ref; justice_tx_ref.datalen = justice_tx->arr_len; justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); + memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx); justice_tx_ref.data_is_owned = true; unsigned char per_commitment_key_arr[32]; CHECK(per_commitment_key->arr_len == 32); - memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); + memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key); unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr; LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -uint32_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_htlc"))) TS_BaseSign_sign_justice_revoked_htlc(uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, uint32_t htlc) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); +uint32_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_htlc"))) TS_BaseSign_sign_justice_revoked_htlc(uint32_t this_arg, int8_tArray justice_tx, intptr_t input, int64_t amount, int8_tArray per_commitment_key, uint32_t htlc) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKTransaction justice_tx_ref; justice_tx_ref.datalen = justice_tx->arr_len; justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); + memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx); justice_tx_ref.data_is_owned = true; unsigned char per_commitment_key_arr[32]; CHECK(per_commitment_key->arr_len == 32); - memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); + memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key); unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr; LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); @@ -2293,32 +2306,32 @@ uint32_t __attribute__((export_name("TS_BaseSign_sign_justice_revoked_htlc"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *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); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -uint32_t __attribute__((export_name("TS_BaseSign_sign_counterparty_htlc_transaction"))) TS_BaseSign_sign_counterparty_htlc_transaction(uint32_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, uint32_t htlc) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); +uint32_t __attribute__((export_name("TS_BaseSign_sign_counterparty_htlc_transaction"))) TS_BaseSign_sign_counterparty_htlc_transaction(uint32_t this_arg, int8_tArray htlc_tx, intptr_t input, int64_t amount, int8_tArray per_commitment_point, uint32_t htlc) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKTransaction htlc_tx_ref; htlc_tx_ref.datalen = htlc_tx->arr_len; htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(htlc_tx_ref.data, htlc_tx->elems, htlc_tx_ref.datalen); + memcpy(htlc_tx_ref.data, htlc_tx->elems, htlc_tx_ref.datalen); FREE(htlc_tx); htlc_tx_ref.data_is_owned = true; LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); htlc_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *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); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_BaseSign_sign_closing_transaction"))) TS_BaseSign_sign_closing_transaction(uint32_t this_arg, uint32_t closing_tx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKClosingTransaction closing_tx_conv; @@ -2327,11 +2340,11 @@ uint32_t __attribute__((export_name("TS_BaseSign_sign_closing_transaction"))) T CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_BaseSign_sign_channel_announcement"))) TS_BaseSign_sign_channel_announcement(uint32_t this_arg, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKUnsignedChannelAnnouncement msg_conv; @@ -2340,11 +2353,11 @@ uint32_t __attribute__((export_name("TS_BaseSign_sign_channel_announcement"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_BaseSign_ready_channel"))) TS_BaseSign_ready_channel(uint32_t this_arg, uint32_t channel_parameters) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKChannelTransactionParameters channel_parameters_conv; @@ -2360,15 +2373,15 @@ LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) { return this_arg->pubkeys; } uint32_t __attribute__((export_name("TS_BaseSign_get_pubkeys"))) TS_BaseSign_get_pubkeys(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2392,7 +2405,7 @@ LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) { LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(ret_ref.data, ret->elems, ret_ref.datalen); + memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); return ret_ref; } static void LDKSign_JCalls_cloned(LDKSign* new_obj) { @@ -2426,11 +2439,11 @@ long __attribute__((export_name("TS_LDKSign_new"))) TS_LDKSign_new(JSValue o, J return (long)res_ptr; } int8_tArray __attribute__((export_name("TS_Sign_write"))) TS_Sign_write(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr; LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -2441,7 +2454,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LD } int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_a"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_a(uint32_t owner) { LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_BlockHashChannelMonitorZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -2452,11 +2465,11 @@ static inline struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LD uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_b"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_b(uint32_t owner) { LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(owner & ~1); LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2471,7 +2484,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitor LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(owner & ~1); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){ @@ -2481,11 +2494,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2499,11 +2512,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHopDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)(owner & ~1); LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2517,11 +2530,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_err"))) TS_CResult_RouteHopDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RouteHopDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2542,11 +2555,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_ok"))) TS_CResult_RouteDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)(owner & ~1); LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2560,11 +2573,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_err"))) TS_CResult_RouteDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RouteDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2578,11 +2591,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_ok"))) TS_CResult_RouteParametersDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(owner & ~1); LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2596,11 +2609,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_err"))) TS_CResult_RouteParametersDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2621,11 +2634,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_get_ok"))) TS_CResult_PayeeDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_PayeeDecodeErrorZ* owner_conv = (LDKCResult_PayeeDecodeErrorZ*)(owner & ~1); LDKPayee ret_var = CResult_PayeeDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2639,11 +2652,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_get_err"))) TS_CResult_PayeeDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_PayeeDecodeErrorZ* owner_conv = (LDKCResult_PayeeDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_PayeeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2664,11 +2677,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_ok"))) TS_CResult_RouteHintDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)(owner & ~1); LDKRouteHint ret_var = CResult_RouteHintDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2682,11 +2695,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_err"))) TS_CResult_RouteHintDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RouteHintDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2700,11 +2713,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(owner & ~1); LDKRouteHintHop ret_var = CResult_RouteHintHopDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2718,11 +2731,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_err"))) TS_CResult_RouteHintHopDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2743,11 +2756,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_ok"))) TS_CResult_RouteLightningErrorZ_get_ok(uint32_t owner) { LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)(owner & ~1); LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2761,11 +2774,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_err"))) TS_CResult_RouteLightningErrorZ_get_err(uint32_t owner) { LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)(owner & ~1); LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2788,11 +2801,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_err"))) TS_CResult_NoneLightningErrorZ_get_err(uint32_t owner) { LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)(owner & ~1); LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -2804,7 +2817,7 @@ static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_Public } int8_tArray __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_a"))) TS_C2Tuple_PublicKeyTypeZ_get_a(uint32_t owner) { LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, C2Tuple_PublicKeyTypeZ_get_a(owner_conv).compressed_form, 33); return ret_arr; } @@ -2816,7 +2829,7 @@ uint32_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_b"))) TS_C2T LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)(owner & ~1); LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); *ret_ret = C2Tuple_PublicKeyTypeZ_get_b(owner_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) { @@ -2841,12 +2854,12 @@ uint32_t __attribute__((export_name("TS_LDKErrorAction_DisconnectPeer_get_msg")) LDKErrorAction *obj = (LDKErrorAction*)(ptr & ~1); assert(obj->tag == LDKErrorAction_DisconnectPeer); LDKErrorMessage msg_var = obj->disconnect_peer.msg; - uint64_t msg_ref = 0; - if ((uint64_t)msg_var.inner > 4096) { - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + if ((uintptr_t)msg_var.inner > 4096) { + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; } return msg_ref; } @@ -2860,11 +2873,11 @@ uint32_t __attribute__((export_name("TS_LDKErrorAction_SendErrorMessage_get_msg" LDKErrorAction *obj = (LDKErrorAction*)(ptr & ~1); assert(obj->tag == LDKErrorAction_SendErrorMessage); LDKErrorMessage msg_var = obj->send_error_message.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_ty_from_ptr"))) TS_LDKMessageSendEvent_ty_from_ptr(uint32_t ptr) { @@ -2895,7 +2908,7 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_ty_from_ptr"))) TS_L int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_accept_channel.node_id.compressed_form, 33); return node_id_arr; } @@ -2903,17 +2916,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel); LDKAcceptChannel msg_var = obj->send_accept_channel.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_node_id"))) TS_LDKMessageSendEvent_SendOpenChannel_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendOpenChannel); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_open_channel.node_id.compressed_form, 33); return node_id_arr; } @@ -2921,17 +2934,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_ LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendOpenChannel); LDKOpenChannel msg_var = obj->send_open_channel.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_node_id"))) TS_LDKMessageSendEvent_SendFundingCreated_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingCreated); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_funding_created.node_id.compressed_form, 33); return node_id_arr; } @@ -2939,17 +2952,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_g LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingCreated); LDKFundingCreated msg_var = obj->send_funding_created.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendFundingSigned_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingSigned); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_funding_signed.node_id.compressed_form, 33); return node_id_arr; } @@ -2957,17 +2970,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingSigned); LDKFundingSigned msg_var = obj->send_funding_signed.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingLocked_get_node_id"))) TS_LDKMessageSendEvent_SendFundingLocked_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingLocked); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_funding_locked.node_id.compressed_form, 33); return node_id_arr; } @@ -2975,17 +2988,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingLocked_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendFundingLocked); LDKFundingLocked msg_var = obj->send_funding_locked.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_announcement_signatures.node_id.compressed_form, 33); return node_id_arr; } @@ -2993,17 +3006,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSign LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures); LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->update_htl_cs.node_id.compressed_form, 33); return node_id_arr; } @@ -3011,17 +3024,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_upda LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs); LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates; - uint64_t updates_ref = 0; - CHECK((((uint64_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t updates_ref = 0; + CHECK((((uintptr_t)updates_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&updates_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var); - updates_ref = (uint64_t)updates_var.inner & ~1; + updates_ref = (uintptr_t)updates_var.inner & ~1; return updates_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_revoke_and_ack.node_id.compressed_form, 33); return node_id_arr; } @@ -3029,17 +3042,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK); LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendClosingSigned_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendClosingSigned); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_closing_signed.node_id.compressed_form, 33); return node_id_arr; } @@ -3047,17 +3060,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendClosingSigned); LDKClosingSigned msg_var = obj->send_closing_signed.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_node_id"))) TS_LDKMessageSendEvent_SendShutdown_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendShutdown); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_shutdown.node_id.compressed_form, 33); return node_id_arr; } @@ -3065,17 +3078,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_msg LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendShutdown); LDKShutdown msg_var = obj->send_shutdown.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_channel_reestablish.node_id.compressed_form, 33); return node_id_arr; } @@ -3083,61 +3096,61 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestabli LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish); LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement); LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement); LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg; - uint64_t update_msg_ref = 0; - CHECK((((uint64_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t update_msg_ref = 0; + CHECK((((uintptr_t)update_msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var); - update_msg_ref = (uint64_t)update_msg_var.inner & ~1; + update_msg_ref = (uintptr_t)update_msg_var.inner & ~1; return update_msg_ref; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_BroadcastNodeAnnouncement); LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_BroadcastChannelUpdate); LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_channel_update.node_id.compressed_form, 33); return node_id_arr; } @@ -3145,30 +3158,30 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate); LDKChannelUpdate msg_var = obj->send_channel_update.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_node_id"))) TS_LDKMessageSendEvent_HandleError_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_HandleError); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->handle_error.node_id.compressed_form, 33); return node_id_arr; } uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_action"))) TS_LDKMessageSendEvent_HandleError_get_action(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_HandleError); - uint64_t action_ref = ((uint64_t)&obj->handle_error.action) | 1; + uintptr_t action_ref = ((uintptr_t)&obj->handle_error.action) | 1; return action_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_channel_range_query.node_id.compressed_form, 33); return node_id_arr; } @@ -3176,17 +3189,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuer LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery); LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_short_ids_query.node_id.compressed_form, 33); return node_id_arr; } @@ -3194,17 +3207,17 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_ge LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery); LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id(uint32_t ptr) { LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange); - int8_tArray node_id_arr = init_int8_tArray(33); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); memcpy(node_id_arr->elems, obj->send_reply_channel_range.node_id.compressed_form, 33); return node_id_arr; } @@ -3212,11 +3225,11 @@ uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRang LDKMessageSendEvent *obj = (LDKMessageSendEvent*)(ptr & ~1); assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange); LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner & ~1; + msg_ref = (uintptr_t)msg_var.inner & ~1; return msg_ref; } static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) { @@ -3243,11 +3256,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_err"))) TS_CResult_boolLightningErrorZ_get_err(uint32_t owner) { LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)(owner & ~1); LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3260,11 +3273,11 @@ static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUp uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(uint32_t owner) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3277,11 +3290,11 @@ static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateCh uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(uint32_t owner) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3294,11 +3307,11 @@ static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateCh uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(uint32_t owner) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(owner & ~1); LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3326,7 +3339,7 @@ CHECK(owner->result_ok); int8_tArray __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok(uint32_t owner) { LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(owner & ~1); LDKCVec_u8Z ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -3339,11 +3352,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err(uint32_t owner) { LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(owner & ~1); LDKPeerHandleError ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3366,11 +3379,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_err"))) TS_CResult_NonePeerHandleErrorZ_get_err(uint32_t owner) { LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)(owner & ~1); LDKPeerHandleError ret_var = CResult_NonePeerHandleErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3394,11 +3407,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_err"))) TS_CResult_boolPeerHandleErrorZ_get_err(uint32_t owner) { LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)(owner & ~1); LDKPeerHandleError ret_var = CResult_boolPeerHandleErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3413,7 +3426,7 @@ uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_ok"))) TS LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)(owner & ~1); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv); - return (uint64_t)ret_ref; + return (uintptr_t)ret_ref; } static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){ @@ -3459,7 +3472,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_usizeTransactionZZ_So LDKC2Tuple_usizeTransactionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *some_conv = obj->some; *some_conv = C2Tuple_usizeTransactionZ_clone(some_conv); - return ((uint64_t)some_conv); + return ((uintptr_t)some_conv); } uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_ty_from_ptr"))) TS_LDKCOption_ClosureReasonZ_ty_from_ptr(uint32_t ptr) { LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)(ptr & ~1); @@ -3472,7 +3485,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_ty_from_ptr")) uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_Some_get_some"))) TS_LDKCOption_ClosureReasonZ_Some_get_some(uint32_t ptr) { LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)(ptr & ~1); assert(obj->tag == LDKCOption_ClosureReasonZ_Some); - uint64_t some_ref = ((uint64_t)&obj->some) | 1; + uintptr_t some_ref = ((uintptr_t)&obj->some) | 1; return some_ref; } static inline struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){ @@ -3483,7 +3496,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErr LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(owner & ~1); LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -3494,11 +3507,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3516,7 +3529,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_EventZ_ty_from_ptr"))) TS_LDK uint32_t __attribute__((export_name("TS_LDKCOption_EventZ_Some_get_some"))) TS_LDKCOption_EventZ_Some_get_some(uint32_t ptr) { LDKCOption_EventZ *obj = (LDKCOption_EventZ*)(ptr & ~1); assert(obj->tag == LDKCOption_EventZ_Some); - uint64_t some_ref = ((uint64_t)&obj->some) | 1; + uintptr_t some_ref = ((uintptr_t)&obj->some) | 1; return some_ref; } static inline struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){ @@ -3527,7 +3540,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_ LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(owner & ~1); LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); *ret_copy = CResult_COption_EventZDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -3538,11 +3551,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_err"))) TS_CResult_COption_EventZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3556,11 +3569,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_ok"))) TS_CResult_NodeIdDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3574,11 +3587,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_err"))) TS_CResult_NodeIdDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3593,7 +3606,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErr LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -3604,11 +3617,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3627,10 +3640,10 @@ static void LDKAccess_JCalls_free(void* this_arg) { } LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) { LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg; - int8_tArray genesis_hash_arr = init_int8_tArray(32); + int8_tArray genesis_hash_arr = init_int8_tArray(32, __LINE__); memcpy(genesis_hash_arr->elems, *genesis_hash, 32); uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 17, (uint32_t)genesis_hash_arr, (uint32_t)short_channel_id); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr); FREE((void*)ret); @@ -3658,16 +3671,16 @@ long __attribute__((export_name("TS_LDKAccess_new"))) TS_LDKAccess_new(JSValue return (long)res_ptr; } uint32_t __attribute__((export_name("TS_Access_get_utxo"))) TS_Access_get_utxo(uint32_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr; unsigned char genesis_hash_arr[32]; CHECK(genesis_hash->arr_len == 32); - memcpy(genesis_hash_arr, genesis_hash->elems, 32); + memcpy(genesis_hash_arr, genesis_hash->elems, 32); FREE(genesis_hash); unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr; LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_LDKCOption_AccessZ_ty_from_ptr"))) TS_LDKCOption_AccessZ_ty_from_ptr(uint32_t ptr) { @@ -3684,7 +3697,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_AccessZ_Some_get_some"))) TS_ LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess"); *some_ret = obj->some; // Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances - return (uint64_t)some_ret; + return (uintptr_t)some_ret; } static inline struct LDKDirectionalChannelInfo CResult_DirectionalChannelInfoDecodeErrorZ_get_ok(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); @@ -3693,11 +3706,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_get_ok"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(owner & ~1); LDKDirectionalChannelInfo ret_var = CResult_DirectionalChannelInfoDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3711,11 +3724,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_get_err"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_DirectionalChannelInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3729,11 +3742,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3747,11 +3760,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelInfoDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3765,11 +3778,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3783,11 +3796,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_err"))) TS_CResult_RoutingFeesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3807,7 +3820,7 @@ uint32_t __attribute__((export_name("TS_LDKNetAddress_ty_from_ptr"))) TS_LDKNetA int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv4_get_addr"))) TS_LDKNetAddress_IPv4_get_addr(uint32_t ptr) { LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); assert(obj->tag == LDKNetAddress_IPv4); - int8_tArray addr_arr = init_int8_tArray(4); + int8_tArray addr_arr = init_int8_tArray(4, __LINE__); memcpy(addr_arr->elems, obj->i_pv4.addr.data, 4); return addr_arr; } @@ -3819,7 +3832,7 @@ int16_t __attribute__((export_name("TS_LDKNetAddress_IPv4_get_port"))) TS_LDKNet int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv6_get_addr"))) TS_LDKNetAddress_IPv6_get_addr(uint32_t ptr) { LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); assert(obj->tag == LDKNetAddress_IPv6); - int8_tArray addr_arr = init_int8_tArray(16); + int8_tArray addr_arr = init_int8_tArray(16, __LINE__); memcpy(addr_arr->elems, obj->i_pv6.addr.data, 16); return addr_arr; } @@ -3831,14 +3844,14 @@ int16_t __attribute__((export_name("TS_LDKNetAddress_IPv6_get_port"))) TS_LDKNet int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV2_get_onion_v2"))) TS_LDKNetAddress_OnionV2_get_onion_v2(uint32_t ptr) { LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); assert(obj->tag == LDKNetAddress_OnionV2); - int8_tArray onion_v2_arr = init_int8_tArray(12); + int8_tArray onion_v2_arr = init_int8_tArray(12, __LINE__); memcpy(onion_v2_arr->elems, obj->onion_v2.data, 12); return onion_v2_arr; } int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_ed25519_pubkey"))) TS_LDKNetAddress_OnionV3_get_ed25519_pubkey(uint32_t ptr) { LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1); assert(obj->tag == LDKNetAddress_OnionV3); - int8_tArray ed25519_pubkey_arr = init_int8_tArray(32); + int8_tArray ed25519_pubkey_arr = init_int8_tArray(32, __LINE__); memcpy(ed25519_pubkey_arr->elems, obj->onion_v3.ed25519_pubkey.data, 32); return ed25519_pubkey_arr; } @@ -3871,11 +3884,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3889,11 +3902,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3912,11 +3925,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeInfoDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3930,11 +3943,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_err"))) TS_CResult_NodeInfoDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3948,11 +3961,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); LDKNetworkGraph ret_var = CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3966,11 +3979,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_err"))) TS_CResult_NetworkGraphDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -3990,10 +4003,10 @@ uint32_tArray __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_Some_g assert(obj->tag == LDKCOption_CVec_NetAddressZZ_Some); LDKCVec_NetAddressZ some_var = obj->some; uint32_tArray some_arr = NULL; - some_arr = init_uint32_tArray(some_var.datalen); + some_arr = init_uint32_tArray(some_var.datalen, __LINE__); uint32_t *some_arr_ptr = (uint32_t*)(((uint8_t*)some_arr) + 4); for (size_t m = 0; m < some_var.datalen; m++) { - uint64_t some_conv_12_ref = ((uint64_t)&some_var.data[m]) | 1; + uintptr_t some_conv_12_ref = ((uintptr_t)&some_var.data[m]) | 1; some_arr_ptr[m] = some_conv_12_ref; } @@ -4006,11 +4019,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_get_ok"))) TS_CResult_ScoringParametersDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ScoringParametersDecodeErrorZ* owner_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(owner & ~1); LDKScoringParameters ret_var = *CResult_ScoringParametersDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner & ~1; + ret_ref = (uintptr_t)ret_var.inner & ~1; return ret_ref; } @@ -4021,11 +4034,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_get_err"))) TS_CResult_ScoringParametersDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ScoringParametersDecodeErrorZ* owner_conv = (LDKCResult_ScoringParametersDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ScoringParametersDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4039,11 +4052,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(owner & ~1); LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4057,11 +4070,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_err"))) TS_CResult_InitFeaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4075,11 +4088,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(owner & ~1); LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4093,11 +4106,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4111,11 +4124,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(owner & ~1); LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4129,11 +4142,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4147,11 +4160,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(owner & ~1); LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4165,11 +4178,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4183,11 +4196,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(owner & ~1); LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4201,11 +4214,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4220,7 +4233,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_ok") LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)(owner & ~1); LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -4231,11 +4244,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_err"))) TS_CResult_NetAddressDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NetAddressDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4277,11 +4290,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(owner & ~1); LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4295,11 +4308,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_err"))) TS_CResult_AcceptChannelDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4313,11 +4326,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(owner & ~1); LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4331,11 +4344,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4349,11 +4362,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(owner & ~1); LDKChannelReestablish ret_var = CResult_ChannelReestablishDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4367,11 +4380,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4385,11 +4398,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(owner & ~1); LDKClosingSigned ret_var = CResult_ClosingSignedDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4403,11 +4416,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4421,11 +4434,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(owner & ~1); LDKClosingSignedFeeRange ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4439,11 +4452,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4457,11 +4470,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(owner & ~1); LDKCommitmentSigned ret_var = CResult_CommitmentSignedDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4475,11 +4488,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4493,11 +4506,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(owner & ~1); LDKFundingCreated ret_var = CResult_FundingCreatedDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4511,11 +4524,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_err"))) TS_CResult_FundingCreatedDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4529,11 +4542,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_ok"))) TS_CResult_FundingSignedDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(owner & ~1); LDKFundingSigned ret_var = CResult_FundingSignedDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4547,11 +4560,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_err"))) TS_CResult_FundingSignedDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4565,11 +4578,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_get_ok"))) TS_CResult_FundingLockedDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_FundingLockedDecodeErrorZ* owner_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(owner & ~1); LDKFundingLocked ret_var = CResult_FundingLockedDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4583,11 +4596,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_get_err"))) TS_CResult_FundingLockedDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_FundingLockedDecodeErrorZ* owner_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_FundingLockedDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4601,11 +4614,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_ok"))) TS_CResult_InitDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)(owner & ~1); LDKInit ret_var = CResult_InitDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4619,11 +4632,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_err"))) TS_CResult_InitDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_InitDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4637,11 +4650,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_ok"))) TS_CResult_OpenChannelDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(owner & ~1); LDKOpenChannel ret_var = CResult_OpenChannelDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4655,11 +4668,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_err"))) TS_CResult_OpenChannelDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4673,11 +4686,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(owner & ~1); LDKRevokeAndACK ret_var = CResult_RevokeAndACKDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4691,11 +4704,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4709,11 +4722,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_ok"))) TS_CResult_ShutdownDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)(owner & ~1); LDKShutdown ret_var = CResult_ShutdownDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4727,11 +4740,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_err"))) TS_CResult_ShutdownDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ShutdownDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4745,11 +4758,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(owner & ~1); LDKUpdateFailHTLC ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4763,11 +4776,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4781,11 +4794,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(owner & ~1); LDKUpdateFailMalformedHTLC ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4799,11 +4812,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4817,11 +4830,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(owner & ~1); LDKUpdateFee ret_var = CResult_UpdateFeeDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4835,11 +4848,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_err"))) TS_CResult_UpdateFeeDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4853,11 +4866,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(owner & ~1); LDKUpdateFulfillHTLC ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4871,11 +4884,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4889,11 +4902,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(owner & ~1); LDKUpdateAddHTLC ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4907,11 +4920,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4925,11 +4938,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_ok"))) TS_CResult_PingDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)(owner & ~1); LDKPing ret_var = CResult_PingDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4943,11 +4956,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_err"))) TS_CResult_PingDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_PingDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4961,11 +4974,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_ok"))) TS_CResult_PongDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)(owner & ~1); LDKPong ret_var = CResult_PongDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4979,11 +4992,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_err"))) TS_CResult_PongDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_PongDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -4997,11 +5010,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(owner & ~1); LDKUnsignedChannelAnnouncement ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5015,11 +5028,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5033,11 +5046,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(owner & ~1); LDKChannelAnnouncement ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5051,11 +5064,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5069,11 +5082,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(owner & ~1); LDKUnsignedChannelUpdate ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5087,11 +5100,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5105,11 +5118,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(owner & ~1); LDKChannelUpdate ret_var = CResult_ChannelUpdateDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5123,11 +5136,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5141,11 +5154,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(owner & ~1); LDKErrorMessage ret_var = CResult_ErrorMessageDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5159,11 +5172,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_err"))) TS_CResult_ErrorMessageDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5177,11 +5190,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(owner & ~1); LDKUnsignedNodeAnnouncement ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5195,11 +5208,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5213,11 +5226,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(owner & ~1); LDKNodeAnnouncement ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5231,11 +5244,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5249,11 +5262,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(owner & ~1); LDKQueryShortChannelIds ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5267,11 +5280,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5285,11 +5298,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(owner & ~1); LDKReplyShortChannelIdsEnd ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5303,11 +5316,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5321,11 +5334,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(owner & ~1); LDKQueryChannelRange ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5339,11 +5352,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5357,11 +5370,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(owner & ~1); LDKReplyChannelRange ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5375,11 +5388,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5393,11 +5406,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(owner & ~1); LDKGossipTimestampFilter ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5411,11 +5424,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5429,11 +5442,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5447,11 +5460,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5465,11 +5478,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5483,11 +5496,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5502,7 +5515,7 @@ uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecode LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -5513,11 +5526,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5532,7 +5545,7 @@ uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_ok"))) TS_ LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)(owner & ~1); LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = CResult_SignDecodeErrorZ_get_ok(owner_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){ @@ -5542,11 +5555,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_err"))) TS_CResult_SignDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_SignDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5559,7 +5572,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_ok"))) TS_CResult_RecoverableSignatureNoneZ_get_ok(uint32_t owner) { LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(68); + int8_tArray ret_arr = init_int8_tArray(68, __LINE__); memcpy(ret_arr->elems, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form, 68); return ret_arr; } @@ -5588,11 +5601,11 @@ ptrArray __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok"))) LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(owner & ~1); LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { LDKCVec_u8Z ret_conv_12_var = ret_var.data[m]; - int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen); + int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__); memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen); CVec_u8Z_free(ret_conv_12_var); ret_arr_ptr[m] = ret_conv_12_arr; @@ -5618,11 +5631,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(owner & ~1); LDKInMemorySigner ret_var = CResult_InMemorySignerDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5636,11 +5649,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_err"))) TS_CResult_InMemorySignerDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -5661,7 +5674,7 @@ CHECK(owner->result_ok); int8_tArray __attribute__((export_name("TS_CResult_TransactionNoneZ_get_ok"))) TS_CResult_TransactionNoneZ_get_ok(uint32_t owner) { LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)(owner & ~1); LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -5687,26 +5700,26 @@ static void LDKFilter_JCalls_free(void* this_arg) { } void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; - int8_tArray txid_arr = init_int8_tArray(32); + int8_tArray txid_arr = init_int8_tArray(32, __LINE__); memcpy(txid_arr->elems, *txid, 32); LDKu8slice script_pubkey_var = script_pubkey; - int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen); + int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__); memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen); js_invoke_function_2(j_calls->instance_ptr, 18, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr); } LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) { LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; LDKWatchedOutput output_var = output; - uint64_t output_ref = 0; - CHECK((((uint64_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t output_ref = 0; + CHECK((((uintptr_t)output_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&output_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var); - output_ref = (uint64_t)output_var.inner; + output_ref = (uintptr_t)output_var.inner; if (output_var.is_owned) { output_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 19, (uint32_t)output_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr); FREE((void*)ret); @@ -5735,21 +5748,21 @@ long __attribute__((export_name("TS_LDKFilter_new"))) TS_LDKFilter_new(JSValue return (long)res_ptr; } void __attribute__((export_name("TS_Filter_register_tx"))) TS_Filter_register_tx(uint32_t this_arg, int8_tArray txid, int8_tArray script_pubkey) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr; unsigned char txid_arr[32]; CHECK(txid->arr_len == 32); - memcpy(txid_arr, txid->elems, 32); + memcpy(txid_arr, txid->elems, 32); FREE(txid); unsigned char (*txid_ref)[32] = &txid_arr; LDKu8slice script_pubkey_ref; script_pubkey_ref.datalen = script_pubkey->arr_len; - script_pubkey_ref.data = script_pubkey->elems; + script_pubkey_ref.data = script_pubkey->elems /* XXX script_pubkey leaks */; (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref); } uint32_t __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_register_output(uint32_t this_arg, uint32_t output) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr; LDKWatchedOutput output_conv; @@ -5759,7 +5772,7 @@ uint32_t __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_re output_conv = WatchedOutput_clone(&output_conv); LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -5777,7 +5790,7 @@ uint32_t __attribute__((export_name("TS_LDKCOption_FilterZ_Some_get_some"))) TS_ LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter"); *some_ret = obj->some; // Warning: We likely need to clone here, but no clone is available, so we just do it for Java instances - return (uint64_t)some_ret; + return (uintptr_t)some_ret; } static inline struct LDKLockedChannelMonitor *CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); @@ -5786,11 +5799,11 @@ CHECK(owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_ok"))) TS_CResult_LockedChannelMonitorNoneZ_get_ok(uint32_t owner) { LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)(owner & ~1); LDKLockedChannelMonitor ret_var = *CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner & ~1; + ret_ref = (uintptr_t)ret_var.inner & ~1; return ret_ref; } @@ -5859,11 +5872,11 @@ uint32_t __attribute__((export_name("TS_LDKAPIError_IncompatibleShutdownScript_g LDKAPIError *obj = (LDKAPIError*)(ptr & ~1); assert(obj->tag == LDKAPIError_IncompatibleShutdownScript); LDKShutdownScript script_var = obj->incompatible_shutdown_script.script; - uint64_t script_ref = 0; - CHECK((((uint64_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t script_ref = 0; + CHECK((((uintptr_t)script_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&script_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var); - script_ref = (uint64_t)script_var.inner & ~1; + script_ref = (uintptr_t)script_var.inner & ~1; return script_ref; } static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){ @@ -5883,7 +5896,7 @@ uint32_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_err"))) TS_CR LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)(owner & ~1); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -5920,7 +5933,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult__u832APIErrorZ_get_ok"))) TS_CResult__u832APIErrorZ_get_ok(uint32_t owner) { LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult__u832APIErrorZ_get_ok(owner_conv).data, 32); return ret_arr; } @@ -5933,7 +5946,7 @@ uint32_t __attribute__((export_name("TS_CResult__u832APIErrorZ_get_err"))) TS_C LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)(owner & ~1); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = CResult__u832APIErrorZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -5950,7 +5963,7 @@ uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_ty_from_ptr"))) TS uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_ParameterError_get_parameter_error"))) TS_LDKPaymentSendFailure_ParameterError_get_parameter_error(uint32_t ptr) { LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)(ptr & ~1); assert(obj->tag == LDKPaymentSendFailure_ParameterError); - uint64_t parameter_error_ref = ((uint64_t)&obj->parameter_error) | 1; + uintptr_t parameter_error_ref = ((uintptr_t)&obj->parameter_error) | 1; return parameter_error_ref; } uint32_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error"))) TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error(uint32_t ptr) { @@ -5958,13 +5971,13 @@ uint32_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PathParameter assert(obj->tag == LDKPaymentSendFailure_PathParameterError); LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error; uint32_tArray path_parameter_error_arr = NULL; - path_parameter_error_arr = init_uint32_tArray(path_parameter_error_var.datalen); + path_parameter_error_arr = init_uint32_tArray(path_parameter_error_var.datalen, __LINE__); uint32_t *path_parameter_error_arr_ptr = (uint32_t*)(((uint8_t*)path_parameter_error_arr) + 4); for (size_t w = 0; w < path_parameter_error_var.datalen; w++) { LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w]; *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv); - path_parameter_error_arr_ptr[w] = (uint64_t)path_parameter_error_conv_22_conv; + path_parameter_error_arr_ptr[w] = (uintptr_t)path_parameter_error_conv_22_conv; } return path_parameter_error_arr; @@ -5974,10 +5987,10 @@ uint32_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_AllFailedRetr assert(obj->tag == LDKPaymentSendFailure_AllFailedRetrySafe); LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe; uint32_tArray all_failed_retry_safe_arr = NULL; - all_failed_retry_safe_arr = init_uint32_tArray(all_failed_retry_safe_var.datalen); + all_failed_retry_safe_arr = init_uint32_tArray(all_failed_retry_safe_var.datalen, __LINE__); uint32_t *all_failed_retry_safe_arr_ptr = (uint32_t*)(((uint8_t*)all_failed_retry_safe_arr) + 4); for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) { - uint64_t all_failed_retry_safe_conv_10_ref = ((uint64_t)&all_failed_retry_safe_var.data[k]) | 1; + uintptr_t all_failed_retry_safe_conv_10_ref = ((uintptr_t)&all_failed_retry_safe_var.data[k]) | 1; all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref; } @@ -5988,13 +6001,13 @@ uint32_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailur assert(obj->tag == LDKPaymentSendFailure_PartialFailure); LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results; uint32_tArray results_arr = NULL; - results_arr = init_uint32_tArray(results_var.datalen); + results_arr = init_uint32_tArray(results_var.datalen, __LINE__); uint32_t *results_arr_ptr = (uint32_t*)(((uint8_t*)results_arr) + 4); for (size_t w = 0; w < results_var.datalen; w++) { LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *results_conv_22_conv = results_var.data[w]; *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv); - results_arr_ptr[w] = (uint64_t)results_conv_22_conv; + results_arr_ptr[w] = (uintptr_t)results_conv_22_conv; } return results_arr; @@ -6003,19 +6016,19 @@ uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)(ptr & ~1); assert(obj->tag == LDKPaymentSendFailure_PartialFailure); LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry; - uint64_t failed_paths_retry_ref = 0; - if ((uint64_t)failed_paths_retry_var.inner > 4096) { - CHECK((((uint64_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t failed_paths_retry_ref = 0; + if ((uintptr_t)failed_paths_retry_var.inner > 4096) { + CHECK((((uintptr_t)failed_paths_retry_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&failed_paths_retry_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var); - failed_paths_retry_ref = (uint64_t)failed_paths_retry_var.inner & ~1; + failed_paths_retry_ref = (uintptr_t)failed_paths_retry_var.inner & ~1; } return failed_paths_retry_ref; } int8_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_payment_id"))) TS_LDKPaymentSendFailure_PartialFailure_get_payment_id(uint32_t ptr) { LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)(ptr & ~1); assert(obj->tag == LDKPaymentSendFailure_PartialFailure); - int8_tArray payment_id_arr = init_int8_tArray(32); + int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__); memcpy(payment_id_arr->elems, obj->partial_failure.payment_id.data, 32); return payment_id_arr; } @@ -6025,7 +6038,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_ok(uint32_t owner) { LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data, 32); return ret_arr; } @@ -6038,7 +6051,7 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_ge LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(owner & ~1); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6059,7 +6072,7 @@ uint32_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_err LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)(owner & ~1); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6068,7 +6081,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2 } int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_a"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_a(uint32_t owner) { LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -6078,7 +6091,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2 } int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_b"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_b(uint32_t owner) { LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_b(owner_conv).data, 32); return ret_arr; } @@ -6091,7 +6104,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPa LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(owner & ~1); LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } static inline struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){ @@ -6102,7 +6115,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPa LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(owner & ~1); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6111,7 +6124,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(L } int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_a"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_a(uint32_t owner) { LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -6121,7 +6134,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(L } int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_b"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_b(uint32_t owner) { LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_b(owner_conv).data, 32); return ret_arr; } @@ -6134,7 +6147,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(owner & ~1); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } static inline void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){ @@ -6154,7 +6167,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(owner & ~1); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } static inline struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){ @@ -6165,7 +6178,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(owner & ~1); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6175,7 +6188,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_ok"))) TS_CResult_PaymentSecretNoneZ_get_ok(uint32_t owner) { LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult_PaymentSecretNoneZ_get_ok(owner_conv).data, 32); return ret_arr; } @@ -6195,7 +6208,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_ok"))) TS_CResult_PaymentSecretAPIErrorZ_get_ok(uint32_t owner) { LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult_PaymentSecretAPIErrorZ_get_ok(owner_conv).data, 32); return ret_arr; } @@ -6208,7 +6221,7 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_err" LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(owner & ~1); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = CResult_PaymentSecretAPIErrorZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6218,7 +6231,7 @@ CHECK(owner->result_ok); } int8_tArray __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_get_ok(uint32_t owner) { LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, CResult_PaymentPreimageAPIErrorZ_get_ok(owner_conv).data, 32); return ret_arr; } @@ -6231,7 +6244,7 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_er LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(owner & ~1); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = CResult_PaymentPreimageAPIErrorZ_get_err(owner_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -6255,25 +6268,25 @@ static void LDKWatch_JCalls_free(void* this_arg) { LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) { LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; LDKOutPoint funding_txo_var = funding_txo; - uint64_t funding_txo_ref = 0; - CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t funding_txo_ref = 0; + CHECK((((uintptr_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); - funding_txo_ref = (uint64_t)funding_txo_var.inner; + funding_txo_ref = (uintptr_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; } LDKChannelMonitor monitor_var = monitor; - uint64_t monitor_ref = 0; - CHECK((((uint64_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t monitor_ref = 0; + CHECK((((uintptr_t)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var); - monitor_ref = (uint64_t)monitor_var.inner; + monitor_ref = (uintptr_t)monitor_var.inner; if (monitor_var.is_owned) { monitor_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 20, (uint32_t)funding_txo_ref, (uint32_t)monitor_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); FREE((void*)ret); @@ -6282,25 +6295,25 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) { LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; LDKOutPoint funding_txo_var = funding_txo; - uint64_t funding_txo_ref = 0; - CHECK((((uint64_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t funding_txo_ref = 0; + CHECK((((uintptr_t)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var); - funding_txo_ref = (uint64_t)funding_txo_var.inner; + funding_txo_ref = (uintptr_t)funding_txo_var.inner; if (funding_txo_var.is_owned) { funding_txo_ref |= 1; } LDKChannelMonitorUpdate update_var = update; - uint64_t update_ref = 0; - CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t update_ref = 0; + CHECK((((uintptr_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); - update_ref = (uint64_t)update_var.inner; + update_ref = (uintptr_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 21, (uint32_t)funding_txo_ref, (uint32_t)update_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); FREE((void*)ret); @@ -6315,10 +6328,10 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); else ret_constr.data = NULL; - uint32_t* ret_vals = ret->elems; + uint32_t* ret_vals = ret->elems /* XXX ret leaks */; for (size_t o = 0; o < ret_constr.datalen; o++) { uint32_t ret_conv_14 = ret_vals[o]; - void* ret_conv_14_ptr = (void*)(((uint64_t)ret_conv_14) & ~1); + void* ret_conv_14_ptr = (void*)(((uintptr_t)ret_conv_14) & ~1); CHECK_ACCESS(ret_conv_14_ptr); LDKMonitorEvent ret_conv_14_conv = *(LDKMonitorEvent*)(ret_conv_14_ptr); FREE((void*)ret_conv_14); @@ -6350,7 +6363,7 @@ long __attribute__((export_name("TS_LDKWatch_new"))) TS_LDKWatch_new(JSValue o) return (long)res_ptr; } uint32_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t monitor) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; LDKOutPoint funding_txo_conv; @@ -6365,11 +6378,11 @@ uint32_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_ monitor_conv = ChannelMonitor_clone(&monitor_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_update_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t update) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; LDKOutPoint funding_txo_conv; @@ -6384,21 +6397,21 @@ uint32_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_updat update_conv = ChannelMonitorUpdate_clone(&update_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_tArray __attribute__((export_name("TS_Watch_release_pending_monitor_events"))) TS_Watch_release_pending_monitor_events(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t o = 0; o < ret_var.datalen; o++) { LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_conv_14_copy = ret_var.data[o]; - uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy; + uintptr_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; ret_arr_ptr[o] = ret_conv_14_ref; } @@ -6419,7 +6432,7 @@ static void LDKBroadcasterInterface_JCalls_free(void* this_arg) { void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) { LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg; LDKTransaction tx_var = tx; - int8_tArray tx_arr = init_int8_tArray(tx_var.datalen); + int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__); memcpy(tx_arr->elems, tx_var.data, tx_var.datalen); Transaction_free(tx_var); js_invoke_function_1(j_calls->instance_ptr, 23, (uint32_t)tx_arr); @@ -6446,13 +6459,13 @@ long __attribute__((export_name("TS_LDKBroadcasterInterface_new"))) TS_LDKBroad return (long)res_ptr; } void __attribute__((export_name("TS_BroadcasterInterface_broadcast_transaction"))) TS_BroadcasterInterface_broadcast_transaction(uint32_t this_arg, int8_tArray tx) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr; LDKTransaction tx_ref; tx_ref.datalen = tx->arr_len; tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(tx_ref.data, tx->elems, tx_ref.datalen); + memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); tx_ref.data_is_owned = true; (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref); } @@ -6472,7 +6485,7 @@ LDKSecretKey get_node_secret_LDKKeysInterface_jcall(const void* this_arg) { int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 24); LDKSecretKey ret_ref; CHECK(ret->arr_len == 32); - memcpy(ret_ref.bytes, ret->elems, 32); + memcpy(ret_ref.bytes, ret->elems, 32); FREE(ret); return ret_ref; } LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) { @@ -6481,7 +6494,7 @@ LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(ret_ref.data, ret->elems, ret_ref.datalen); + memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); return ret_ref; } LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) { @@ -6496,7 +6509,7 @@ LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* t LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 27, (uint32_t)inbound, (uint32_t)channel_value_satoshis); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKSign ret_conv = *(LDKSign*)(ret_ptr); FREE((void*)ret); @@ -6507,16 +6520,16 @@ LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* thi int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 28); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); - memcpy(ret_ref.data, ret->elems, 32); + memcpy(ret_ref.data, ret->elems, 32); FREE(ret); return ret_ref; } LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; LDKu8slice reader_var = reader; - int8_tArray reader_arr = init_int8_tArray(reader_var.datalen); + int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__); memcpy(reader_arr->elems, reader_var.data, reader_var.datalen); uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 29, (uint32_t)reader_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr); FREE((void*)ret); @@ -6525,11 +6538,11 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKCVec_u8Z invoice_preimage) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; LDKCVec_u8Z invoice_preimage_var = invoice_preimage; - int8_tArray invoice_preimage_arr = init_int8_tArray(invoice_preimage_var.datalen); + int8_tArray invoice_preimage_arr = init_int8_tArray(invoice_preimage_var.datalen, __LINE__); memcpy(invoice_preimage_arr->elems, invoice_preimage_var.data, invoice_preimage_var.datalen); CVec_u8Z_free(invoice_preimage_var); uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 30, (uint32_t)invoice_preimage_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr); FREE((void*)ret); @@ -6540,7 +6553,7 @@ LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const int8_tArray ret = (int8_tArray)js_invoke_function_0(j_calls->instance_ptr, 31); LDKThirtyTwoBytes ret_ref; CHECK(ret->arr_len == 32); - memcpy(ret_ref.data, ret->elems, 32); + memcpy(ret_ref.data, ret->elems, 32); FREE(ret); return ret_ref; } static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) { @@ -6572,35 +6585,35 @@ long __attribute__((export_name("TS_LDKKeysInterface_new"))) TS_LDKKeysInterfac return (long)res_ptr; } int8_tArray __attribute__((export_name("TS_KeysInterface_get_node_secret"))) TS_KeysInterface_get_node_secret(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->get_node_secret)(this_arg_conv->this_arg).bytes, 32); return ret_arr; } int8_tArray __attribute__((export_name("TS_KeysInterface_get_destination_script"))) TS_KeysInterface_get_destination_script(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } uint32_t __attribute__((export_name("TS_KeysInterface_get_shutdown_scriptpubkey"))) TS_KeysInterface_get_shutdown_scriptpubkey(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -6608,53 +6621,53 @@ uint32_t __attribute__((export_name("TS_KeysInterface_get_shutdown_scriptpubkey } uint32_t __attribute__((export_name("TS_KeysInterface_get_channel_signer"))) TS_KeysInterface_get_channel_signer(uint32_t this_arg, jboolean inbound, int64_t channel_value_satoshis) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } int8_tArray __attribute__((export_name("TS_KeysInterface_get_secure_random_bytes"))) TS_KeysInterface_get_secure_random_bytes(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32); return ret_arr; } uint32_t __attribute__((export_name("TS_KeysInterface_read_chan_signer"))) TS_KeysInterface_read_chan_signer(uint32_t this_arg, int8_tArray reader) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; LDKu8slice reader_ref; reader_ref.datalen = reader->arr_len; - reader_ref.data = reader->elems; + reader_ref.data = reader->elems /* XXX reader leaks */; LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_KeysInterface_sign_invoice"))) TS_KeysInterface_sign_invoice(uint32_t this_arg, int8_tArray invoice_preimage) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; LDKCVec_u8Z invoice_preimage_ref; invoice_preimage_ref.datalen = invoice_preimage->arr_len; invoice_preimage_ref.data = MALLOC(invoice_preimage_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(invoice_preimage_ref.data, invoice_preimage->elems, invoice_preimage_ref.datalen); + memcpy(invoice_preimage_ref.data, invoice_preimage->elems, invoice_preimage_ref.datalen); FREE(invoice_preimage); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, invoice_preimage_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_KeysInterface_get_inbound_payment_key_material"))) TS_KeysInterface_get_inbound_payment_key_material(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data, 32); return ret_arr; } @@ -6696,7 +6709,7 @@ long __attribute__((export_name("TS_LDKFeeEstimator_new"))) TS_LDKFeeEstimator_ return (long)res_ptr; } int32_t __attribute__((export_name("TS_FeeEstimator_get_est_sat_per_1000_weight"))) TS_FeeEstimator_get_est_sat_per_1000_weight(uint32_t this_arg, uint32_t confirmation_target) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr; LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_js(confirmation_target); @@ -6717,12 +6730,12 @@ static void LDKLogger_JCalls_free(void* this_arg) { void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) { LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; LDKRecord record_var = *record; - uint64_t record_ref = 0; + uintptr_t record_ref = 0; record_var = Record_clone(record); - CHECK((((uint64_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)record_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&record_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var); - record_ref = (uint64_t)record_var.inner; + record_ref = (uintptr_t)record_var.inner; if (record_var.is_owned) { record_ref |= 1; } @@ -6754,7 +6767,7 @@ static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LD } int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_a"))) TS_C2Tuple_BlockHashChannelManagerZ_get_a(uint32_t owner) { LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)(owner & ~1); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, C2Tuple_BlockHashChannelManagerZ_get_a(owner_conv).data, 32); return ret_arr; } @@ -6765,11 +6778,11 @@ static inline struct LDKChannelManager *C2Tuple_BlockHashChannelManagerZ_get_b(L uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_b"))) TS_C2Tuple_BlockHashChannelManagerZ_get_b(uint32_t owner) { LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)(owner & ~1); LDKChannelManager ret_var = *C2Tuple_BlockHashChannelManagerZ_get_b(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner & ~1; + ret_ref = (uintptr_t)ret_var.inner & ~1; return ret_ref; } @@ -6779,7 +6792,7 @@ CHECK(owner->result_ok); } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(uint32_t owner) { LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(owner & ~1); - uint64_t ret_ret = (uint64_t)CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv) | 1; + uintptr_t ret_ret = (uintptr_t)CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv) | 1; return ret_ret; } @@ -6790,11 +6803,11 @@ CHECK(!owner->result_ok); uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(uint32_t owner) { LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(owner & ~1); LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -6820,10 +6833,10 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements"); else ret_constr.data = NULL; - uint32_t* ret_vals = ret->elems; + uint32_t* ret_vals = ret->elems /* XXX ret leaks */; for (size_t s = 0; s < ret_constr.datalen; s++) { uint32_t ret_conv_18 = ret_vals[s]; - void* ret_conv_18_ptr = (void*)(((uint64_t)ret_conv_18) & ~1); + void* ret_conv_18_ptr = (void*)(((uintptr_t)ret_conv_18) & ~1); CHECK_ACCESS(ret_conv_18_ptr); LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr); FREE((void*)ret_conv_18); @@ -6853,17 +6866,17 @@ long __attribute__((export_name("TS_LDKMessageSendEventsProvider_new"))) TS_LDK return (long)res_ptr; } uint32_tArray __attribute__((export_name("TS_MessageSendEventsProvider_get_and_clear_pending_msg_events"))) TS_MessageSendEventsProvider_get_and_clear_pending_msg_events(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr; LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t s = 0; s < ret_var.datalen; s++) { LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_conv_18_copy = ret_var.data[s]; - uint64_t ret_conv_18_ref = (uint64_t)ret_conv_18_copy; + uintptr_t ret_conv_18_ref = (uintptr_t)ret_conv_18_copy; ret_arr_ptr[s] = ret_conv_18_ref; } @@ -6885,7 +6898,7 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * e LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion"); *ret_event = Event_clone(event); - js_invoke_function_1(j_calls->instance_ptr, 35, (uint32_t)(uint64_t)ret_event); + js_invoke_function_1(j_calls->instance_ptr, 35, (uint32_t)(uintptr_t)ret_event); } static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg; @@ -6909,7 +6922,7 @@ long __attribute__((export_name("TS_LDKEventHandler_new"))) TS_LDKEventHandler_ return (long)res_ptr; } void __attribute__((export_name("TS_EventHandler_handle_event"))) TS_EventHandler_handle_event(uint32_t this_arg, uint32_t event) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr; LDKEvent* event_conv = (LDKEvent*)event; @@ -6930,7 +6943,7 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *handler_ret = handler; - js_invoke_function_1(j_calls->instance_ptr, 36, (uint32_t)(uint64_t)handler_ret); + js_invoke_function_1(j_calls->instance_ptr, 36, (uint32_t)(uintptr_t)handler_ret); } static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) { LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg; @@ -6954,10 +6967,10 @@ long __attribute__((export_name("TS_LDKEventsProvider_new"))) TS_LDKEventsProvi return (long)res_ptr; } void __attribute__((export_name("TS_EventsProvider_process_pending_events"))) TS_EventsProvider_process_pending_events(uint32_t this_arg, uint32_t handler) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr; - void* handler_ptr = (void*)(((uint64_t)handler) & ~1); + void* handler_ptr = (void*)(((uintptr_t)handler) & ~1); CHECK_ACCESS(handler_ptr); LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr); (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv); @@ -6976,13 +6989,13 @@ static void LDKListen_JCalls_free(void* this_arg) { void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; LDKu8slice block_var = block; - int8_tArray block_arr = init_int8_tArray(block_var.datalen); + int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__); memcpy(block_arr->elems, block_var.data, block_var.datalen); js_invoke_function_2(j_calls->instance_ptr, 37, (uint32_t)block_arr, (uint32_t)height); } void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; - int8_tArray header_arr = init_int8_tArray(80); + int8_tArray header_arr = init_int8_tArray(80, __LINE__); memcpy(header_arr->elems, *header, 80); js_invoke_function_2(j_calls->instance_ptr, 38, (uint32_t)header_arr, (uint32_t)height); } @@ -7009,22 +7022,22 @@ long __attribute__((export_name("TS_LDKListen_new"))) TS_LDKListen_new(JSValue return (long)res_ptr; } void __attribute__((export_name("TS_Listen_block_connected"))) TS_Listen_block_connected(uint32_t this_arg, int8_tArray block, int32_t height) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; LDKu8slice block_ref; block_ref.datalen = block->arr_len; - block_ref.data = block->elems; + block_ref.data = block->elems /* XXX block leaks */; (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height); } void __attribute__((export_name("TS_Listen_block_disconnected"))) TS_Listen_block_disconnected(uint32_t this_arg, int8_tArray header, int32_t height) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr; unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height); } @@ -7041,16 +7054,16 @@ static void LDKConfirm_JCalls_free(void* this_arg) { } void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; - int8_tArray header_arr = init_int8_tArray(80); + int8_tArray header_arr = init_int8_tArray(80, __LINE__); memcpy(header_arr->elems, *header, 80); LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata; uint32_tArray txdata_arr = NULL; - txdata_arr = init_uint32_tArray(txdata_var.datalen); + txdata_arr = init_uint32_tArray(txdata_var.datalen, __LINE__); uint32_t *txdata_arr_ptr = (uint32_t*)(((uint8_t*)txdata_arr) + 4); for (size_t c = 0; c < txdata_var.datalen; c++) { LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *txdata_conv_28_conv = txdata_var.data[c]; - txdata_arr_ptr[c] = ((uint64_t)txdata_conv_28_conv); + txdata_arr_ptr[c] = ((uintptr_t)txdata_conv_28_conv); } FREE(txdata_var.data); @@ -7058,13 +7071,13 @@ void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t } void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; - int8_tArray txid_arr = init_int8_tArray(32); + int8_tArray txid_arr = init_int8_tArray(32, __LINE__); memcpy(txid_arr->elems, *txid, 32); js_invoke_function_1(j_calls->instance_ptr, 40, (uint32_t)txid_arr); } void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; - int8_tArray header_arr = init_int8_tArray(80); + int8_tArray header_arr = init_int8_tArray(80, __LINE__); memcpy(header_arr->elems, *header, 80); js_invoke_function_2(j_calls->instance_ptr, 41, (uint32_t)header_arr, (uint32_t)height); } @@ -7077,12 +7090,12 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements"); else ret_constr.data = NULL; - int8_tArray* ret_vals = (void*) ret->elems; + int8_tArray* ret_vals = (void*) ret->elems /* XXX ret leaks */; for (size_t m = 0; m < ret_constr.datalen; m++) { int8_tArray ret_conv_12 = ret_vals[m]; LDKThirtyTwoBytes ret_conv_12_ref; CHECK(ret_conv_12->arr_len == 32); - memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); + memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); FREE(ret_conv_12); ret_constr.data[m] = ret_conv_12_ref; } return ret_constr; @@ -7112,12 +7125,12 @@ long __attribute__((export_name("TS_LDKConfirm_new"))) TS_LDKConfirm_new(JSValu return (long)res_ptr; } void __attribute__((export_name("TS_Confirm_transactions_confirmed"))) TS_Confirm_transactions_confirmed(uint32_t this_arg, int8_tArray header, uint32_tArray txdata, int32_t height) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; txdata_constr.datalen = txdata->arr_len; @@ -7125,50 +7138,50 @@ void __attribute__((export_name("TS_Confirm_transactions_confirmed"))) TS_Confi txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); else txdata_constr.data = NULL; - uint32_t* txdata_vals = txdata->elems; + uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */; for (size_t c = 0; c < txdata_constr.datalen; c++) { uint32_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1); + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); CHECK_ACCESS(txdata_conv_28_ptr); LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1)); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); txdata_constr.data[c] = txdata_conv_28_conv; } (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height); } void __attribute__((export_name("TS_Confirm_transaction_unconfirmed"))) TS_Confirm_transaction_unconfirmed(uint32_t this_arg, int8_tArray txid) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; unsigned char txid_arr[32]; CHECK(txid->arr_len == 32); - memcpy(txid_arr, txid->elems, 32); + memcpy(txid_arr, txid->elems, 32); FREE(txid); unsigned char (*txid_ref)[32] = &txid_arr; (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref); } void __attribute__((export_name("TS_Confirm_best_block_updated"))) TS_Confirm_best_block_updated(uint32_t this_arg, int8_tArray header, int32_t height) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height); } ptrArray __attribute__((export_name("TS_Confirm_get_relevant_txids"))) TS_Confirm_get_relevant_txids(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr; LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { - int8_tArray ret_conv_12_arr = init_int8_tArray(32); + int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__); memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32); ret_arr_ptr[m] = ret_conv_12_arr; } @@ -7190,35 +7203,35 @@ static void LDKPersist_JCalls_free(void* this_arg) { LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; LDKOutPoint channel_id_var = channel_id; - uint64_t channel_id_ref = 0; - CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t channel_id_ref = 0; + CHECK((((uintptr_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = (uint64_t)channel_id_var.inner; + channel_id_ref = (uintptr_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; } LDKChannelMonitor data_var = *data; - uint64_t data_ref = 0; + uintptr_t data_ref = 0; data_var = ChannelMonitor_clone(data); - CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = (uint64_t)data_var.inner; + data_ref = (uintptr_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; } LDKMonitorUpdateId update_id_var = update_id; - uint64_t update_id_ref = 0; - CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t update_id_ref = 0; + CHECK((((uintptr_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); - update_id_ref = (uint64_t)update_id_var.inner; + update_id_ref = (uintptr_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; } uint32_t ret = js_invoke_function_3(j_calls->instance_ptr, 43, (uint32_t)channel_id_ref, (uint32_t)data_ref, (uint32_t)update_id_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); FREE((void*)ret); @@ -7227,47 +7240,47 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; LDKOutPoint channel_id_var = channel_id; - uint64_t channel_id_ref = 0; - CHECK((((uint64_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t channel_id_ref = 0; + CHECK((((uintptr_t)channel_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&channel_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = (uint64_t)channel_id_var.inner; + channel_id_ref = (uintptr_t)channel_id_var.inner; if (channel_id_var.is_owned) { channel_id_ref |= 1; } LDKChannelMonitorUpdate update_var = *update; - uint64_t update_ref = 0; - if ((uint64_t)update_var.inner > 4096) { + uintptr_t update_ref = 0; + if ((uintptr_t)update_var.inner > 4096) { update_var = ChannelMonitorUpdate_clone(update); - CHECK((((uint64_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); - update_ref = (uint64_t)update_var.inner; + update_ref = (uintptr_t)update_var.inner; if (update_var.is_owned) { update_ref |= 1; } } LDKChannelMonitor data_var = *data; - uint64_t data_ref = 0; + uintptr_t data_ref = 0; data_var = ChannelMonitor_clone(data); - CHECK((((uint64_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = (uint64_t)data_var.inner; + data_ref = (uintptr_t)data_var.inner; if (data_var.is_owned) { data_ref |= 1; } LDKMonitorUpdateId update_id_var = update_id; - uint64_t update_id_ref = 0; - CHECK((((uint64_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t update_id_ref = 0; + CHECK((((uintptr_t)update_id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&update_id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var); - update_id_ref = (uint64_t)update_id_var.inner; + update_id_ref = (uintptr_t)update_id_var.inner; if (update_id_var.is_owned) { update_id_ref |= 1; } uint32_t ret = js_invoke_function_4(j_calls->instance_ptr, 44, (uint32_t)channel_id_ref, (uint32_t)update_ref, (uint32_t)data_ref, (uint32_t)update_id_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr); FREE((void*)ret); @@ -7296,7 +7309,7 @@ long __attribute__((export_name("TS_LDKPersist_new"))) TS_LDKPersist_new(JSValu return (long)res_ptr; } uint32_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Persist_persist_new_channel(uint32_t this_arg, uint32_t channel_id, uint32_t data, uint32_t update_id) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; LDKOutPoint channel_id_conv; @@ -7315,11 +7328,11 @@ uint32_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Pers update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS_Persist_update_persisted_channel(uint32_t this_arg, uint32_t channel_id, uint32_t update, uint32_t data, uint32_t update_id) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; LDKOutPoint channel_id_conv; @@ -7342,7 +7355,7 @@ uint32_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS update_id_conv = MonitorUpdateId_clone(&update_id_conv); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } typedef struct LDKChannelMessageHandler_JCalls { @@ -7358,24 +7371,24 @@ static void LDKChannelMessageHandler_JCalls_free(void* this_arg) { } void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKInitFeatures their_features_var = their_features; - uint64_t their_features_ref = 0; - CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t their_features_ref = 0; + CHECK((((uintptr_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); - their_features_ref = (uint64_t)their_features_var.inner; + their_features_ref = (uintptr_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; } LDKOpenChannel msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = OpenChannel_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7383,24 +7396,24 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD } void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKInitFeatures their_features_var = their_features; - uint64_t their_features_ref = 0; - CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t their_features_ref = 0; + CHECK((((uintptr_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); - their_features_ref = (uint64_t)their_features_var.inner; + their_features_ref = (uintptr_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; } LDKAcceptChannel msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = AcceptChannel_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7408,15 +7421,15 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKFundingCreated msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = FundingCreated_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7424,15 +7437,15 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKFundingSigned msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = FundingSigned_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7440,15 +7453,15 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKFundingLocked msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = FundingLocked_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7456,25 +7469,25 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKInitFeatures their_features_var = *their_features; - uint64_t their_features_ref = 0; + uintptr_t their_features_ref = 0; their_features_var = InitFeatures_clone(their_features); - CHECK((((uint64_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var); - their_features_ref = (uint64_t)their_features_var.inner; + their_features_ref = (uintptr_t)their_features_var.inner; if (their_features_var.is_owned) { their_features_ref |= 1; } LDKShutdown msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = Shutdown_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7482,15 +7495,15 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub } void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKClosingSigned msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ClosingSigned_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7498,15 +7511,15 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKUpdateAddHTLC msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UpdateAddHTLC_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7514,15 +7527,15 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKUpdateFulfillHTLC msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UpdateFulfillHTLC_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7530,15 +7543,15 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ } void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKUpdateFailHTLC msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UpdateFailHTLC_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7546,15 +7559,15 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg } void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKUpdateFailMalformedHTLC msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UpdateFailMalformedHTLC_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7562,15 +7575,15 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void } void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKCommitmentSigned msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = CommitmentSigned_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7578,15 +7591,15 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar } void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKRevokeAndACK msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = RevokeAndACK_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7594,15 +7607,15 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKUpdateFee msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = UpdateFee_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7610,15 +7623,15 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP } void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKAnnouncementSignatures msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = AnnouncementSignatures_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7626,21 +7639,21 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t } void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); js_invoke_function_2(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, (uint32_t)no_connection_possible); } void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKInit msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = Init_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7648,15 +7661,15 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl } void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKChannelReestablish msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ChannelReestablish_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7664,15 +7677,15 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ } void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKChannelUpdate msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ChannelUpdate_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7680,15 +7693,15 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, } void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKErrorMessage msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ErrorMessage_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } @@ -7738,12 +7751,12 @@ long __attribute__((export_name("TS_LDKChannelMessageHandler_new"))) TS_LDKChan return (long)res_ptr; } void __attribute__((export_name("TS_ChannelMessageHandler_handle_open_channel"))) TS_ChannelMessageHandler_handle_open_channel(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); @@ -7757,12 +7770,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_open_channel") } void __attribute__((export_name("TS_ChannelMessageHandler_handle_accept_channel"))) TS_ChannelMessageHandler_handle_accept_channel(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = (their_features & 1) || (their_features == 0); @@ -7776,12 +7789,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_accept_channel } void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_created"))) TS_ChannelMessageHandler_handle_funding_created(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7790,12 +7803,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_create } void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_signed"))) TS_ChannelMessageHandler_handle_funding_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7804,12 +7817,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_signed } void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_locked"))) TS_ChannelMessageHandler_handle_funding_locked(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7818,12 +7831,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_funding_locked } void __attribute__((export_name("TS_ChannelMessageHandler_handle_shutdown"))) TS_ChannelMessageHandler_handle_shutdown(uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKInitFeatures their_features_conv; their_features_conv.inner = (void*)(their_features & (~1)); their_features_conv.is_owned = false; @@ -7836,12 +7849,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_shutdown"))) T } void __attribute__((export_name("TS_ChannelMessageHandler_handle_closing_signed"))) TS_ChannelMessageHandler_handle_closing_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7850,12 +7863,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_closing_signed } void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_add_htlc"))) TS_ChannelMessageHandler_handle_update_add_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKUpdateAddHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7864,12 +7877,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_add_htl } void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fulfill_htlc"))) TS_ChannelMessageHandler_handle_update_fulfill_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKUpdateFulfillHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7878,12 +7891,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fulfill } void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fail_htlc"))) TS_ChannelMessageHandler_handle_update_fail_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKUpdateFailHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7892,12 +7905,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fail_ht } void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fail_malformed_htlc"))) TS_ChannelMessageHandler_handle_update_fail_malformed_htlc(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKUpdateFailMalformedHTLC msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7906,12 +7919,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fail_ma } void __attribute__((export_name("TS_ChannelMessageHandler_handle_commitment_signed"))) TS_ChannelMessageHandler_handle_commitment_signed(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKCommitmentSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7920,12 +7933,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_commitment_sig } void __attribute__((export_name("TS_ChannelMessageHandler_handle_revoke_and_ack"))) TS_ChannelMessageHandler_handle_revoke_and_ack(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7934,12 +7947,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_revoke_and_ack } void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fee"))) TS_ChannelMessageHandler_handle_update_fee(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKUpdateFee msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7948,12 +7961,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_update_fee"))) } void __attribute__((export_name("TS_ChannelMessageHandler_handle_announcement_signatures"))) TS_ChannelMessageHandler_handle_announcement_signatures(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7962,22 +7975,22 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_announcement_s } void __attribute__((export_name("TS_ChannelMessageHandler_peer_disconnected"))) TS_ChannelMessageHandler_peer_disconnected(uint32_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible); } void __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS_ChannelMessageHandler_peer_connected(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKInit msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -7986,12 +7999,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS } void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_reestablish"))) TS_ChannelMessageHandler_handle_channel_reestablish(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -8000,12 +8013,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_reesta } void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_update"))) TS_ChannelMessageHandler_handle_channel_update(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -8014,12 +8027,12 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_channel_update } void __attribute__((export_name("TS_ChannelMessageHandler_handle_error"))) TS_ChannelMessageHandler_handle_error(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKErrorMessage msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; @@ -8041,17 +8054,17 @@ static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) { LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; LDKNodeAnnouncement msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = NodeAnnouncement_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 65, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8060,17 +8073,17 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; LDKChannelAnnouncement msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ChannelAnnouncement_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 66, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8079,17 +8092,17 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; LDKChannelUpdate msg_var = *msg; - uint64_t msg_ref = 0; + uintptr_t msg_ref = 0; msg_var = ChannelUpdate_clone(msg); - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_1(j_calls->instance_ptr, 67, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8104,10 +8117,10 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); else ret_constr.data = NULL; - uint32_t* ret_vals = ret->elems; + uint32_t* ret_vals = ret->elems /* XXX ret leaks */; for (size_t h = 0; h < ret_constr.datalen; h++) { uint32_t ret_conv_59 = ret_vals[h]; - void* ret_conv_59_ptr = (void*)(((uint64_t)ret_conv_59) & ~1); + void* ret_conv_59_ptr = (void*)(((uintptr_t)ret_conv_59) & ~1); CHECK_ACCESS(ret_conv_59_ptr); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr); FREE((void*)ret_conv_59); @@ -8117,7 +8130,7 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel } LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray starting_point_arr = init_int8_tArray(33); + int8_tArray starting_point_arr = init_int8_tArray(33, __LINE__); memcpy(starting_point_arr->elems, starting_point.compressed_form, 33); uint32_tArray ret = (uint32_tArray)js_invoke_function_2(j_calls->instance_ptr, 69, (uint32_t)starting_point_arr, (uint32_t)batch_amount); LDKCVec_NodeAnnouncementZ ret_constr; @@ -8126,7 +8139,7 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); else ret_constr.data = NULL; - uint32_t* ret_vals = ret->elems; + uint32_t* ret_vals = ret->elems /* XXX ret leaks */; for (size_t s = 0; s < ret_constr.datalen; s++) { uint32_t ret_conv_18 = ret_vals[s]; LDKNodeAnnouncement ret_conv_18_conv; @@ -8139,15 +8152,15 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j } void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKInit init_var = *init; - uint64_t init_ref = 0; + uintptr_t init_ref = 0; init_var = Init_clone(init); - CHECK((((uint64_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var); - init_ref = (uint64_t)init_var.inner; + init_ref = (uintptr_t)init_var.inner; if (init_var.is_owned) { init_ref |= 1; } @@ -8155,19 +8168,19 @@ void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDK } LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKReplyChannelRange msg_var = msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8175,19 +8188,19 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl } LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKReplyShortChannelIdsEnd msg_var = msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8195,19 +8208,19 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess } LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKQueryChannelRange msg_var = msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 73, (uint32_t)their_node_id_arr, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8215,19 +8228,19 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl } LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33); + int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); LDKQueryShortChannelIds msg_var = msg; - uint64_t msg_ref = 0; - CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t msg_ref = 0; + CHECK((((uintptr_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); - msg_ref = (uint64_t)msg_var.inner; + msg_ref = (uintptr_t)msg_var.inner; if (msg_var.is_owned) { msg_ref |= 1; } uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 74, (uint32_t)their_node_id_arr, (uint32_t)msg_ref); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8267,7 +8280,7 @@ long __attribute__((export_name("TS_LDKRoutingMessageHandler_new"))) TS_LDKRout return (long)res_ptr; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_node_announcement"))) TS_RoutingMessageHandler_handle_node_announcement(uint32_t this_arg, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKNodeAnnouncement msg_conv; @@ -8276,11 +8289,11 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_node_annou CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_announcement"))) TS_RoutingMessageHandler_handle_channel_announcement(uint32_t this_arg, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKChannelAnnouncement msg_conv; @@ -8289,11 +8302,11 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_an CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_update"))) TS_RoutingMessageHandler_handle_channel_update(uint32_t this_arg, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKChannelUpdate msg_conv; @@ -8302,21 +8315,21 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_up CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_channel_announcements"))) TS_RoutingMessageHandler_get_next_channel_announcements(uint32_t this_arg, int64_t starting_point, int8_t batch_amount) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t h = 0; h < ret_var.datalen; h++) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_59_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv_59_conv = ret_var.data[h]; - ret_arr_ptr[h] = ((uint64_t)ret_conv_59_conv); + ret_arr_ptr[h] = ((uintptr_t)ret_conv_59_conv); } FREE(ret_var.data); @@ -8324,23 +8337,23 @@ uint32_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_cha } uint32_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_node_announcements"))) TS_RoutingMessageHandler_get_next_node_announcements(uint32_t this_arg, int8_tArray starting_point, int8_t batch_amount) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey starting_point_ref; CHECK(starting_point->arr_len == 33); - memcpy(starting_point_ref.compressed_form, starting_point->elems, 33); + memcpy(starting_point_ref.compressed_form, starting_point->elems, 33); FREE(starting_point); LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t s = 0; s < ret_var.datalen; s++) { LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s]; - uint64_t ret_conv_18_ref = 0; - CHECK((((uint64_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_18_ref = 0; + CHECK((((uintptr_t)ret_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_18_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var); - ret_conv_18_ref = (uint64_t)ret_conv_18_var.inner; + ret_conv_18_ref = (uintptr_t)ret_conv_18_var.inner; if (ret_conv_18_var.is_owned) { ret_conv_18_ref |= 1; } @@ -8352,12 +8365,12 @@ uint32_tArray __attribute__((export_name("TS_RoutingMessageHandler_get_next_nod } void __attribute__((export_name("TS_RoutingMessageHandler_sync_routing_table"))) TS_RoutingMessageHandler_sync_routing_table(uint32_t this_arg, int8_tArray their_node_id, uint32_t init) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKInit init_conv; init_conv.inner = (void*)(init & (~1)); init_conv.is_owned = false; @@ -8366,12 +8379,12 @@ void __attribute__((export_name("TS_RoutingMessageHandler_sync_routing_table")) } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_channel_range"))) TS_RoutingMessageHandler_handle_reply_channel_range(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -8379,16 +8392,16 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_chan msg_conv = ReplyChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_short_channel_ids_end"))) TS_RoutingMessageHandler_handle_reply_short_channel_ids_end(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKReplyShortChannelIdsEnd msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -8396,16 +8409,16 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_reply_shor msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_query_channel_range"))) TS_RoutingMessageHandler_handle_query_channel_range(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -8413,16 +8426,16 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_query_chan msg_conv = QueryChannelRange_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_query_short_channel_ids"))) TS_RoutingMessageHandler_handle_query_short_channel_ids(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr; LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -8430,7 +8443,7 @@ uint32_t __attribute__((export_name("TS_RoutingMessageHandler_handle_query_shor msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } typedef struct LDKCustomMessageReader_JCalls { @@ -8446,10 +8459,10 @@ static void LDKCustomMessageReader_JCalls_free(void* this_arg) { LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const void* this_arg, uint16_t message_type, LDKu8slice buffer) { LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg; LDKu8slice buffer_var = buffer; - int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen); + int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__); memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen); uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 75, (uint32_t)message_type, (uint32_t)buffer_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8477,15 +8490,15 @@ long __attribute__((export_name("TS_LDKCustomMessageReader_new"))) TS_LDKCustom return (long)res_ptr; } uint32_t __attribute__((export_name("TS_CustomMessageReader_read"))) TS_CustomMessageReader_read(uint32_t this_arg, int16_t message_type, int8_tArray buffer) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr; LDKu8slice buffer_ref; buffer_ref.datalen = buffer->arr_len; - buffer_ref.data = buffer->elems; + buffer_ref.data = buffer->elems /* XXX buffer leaks */; LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } typedef struct LDKCustomMessageHandler_JCalls { @@ -8503,10 +8516,10 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType"); *msg_ret = msg; - int8_tArray sender_node_id_arr = init_int8_tArray(33); + int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33); - uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 76, (uint32_t)(uint64_t)msg_ret, (uint32_t)sender_node_id_arr); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + uint32_t ret = js_invoke_function_2(j_calls->instance_ptr, 76, (uint32_t)(uintptr_t)msg_ret, (uint32_t)sender_node_id_arr); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); FREE((void*)ret); @@ -8521,10 +8534,10 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements"); else ret_constr.data = NULL; - uint32_t* ret_vals = ret->elems; + uint32_t* ret_vals = ret->elems /* XXX ret leaks */; for (size_t z = 0; z < ret_constr.datalen; z++) { uint32_t ret_conv_25 = ret_vals[z]; - void* ret_conv_25_ptr = (void*)(((uint64_t)ret_conv_25) & ~1); + void* ret_conv_25_ptr = (void*)(((uintptr_t)ret_conv_25) & ~1); CHECK_ACCESS(ret_conv_25_ptr); LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr); FREE((void*)ret_conv_25); @@ -8558,32 +8571,32 @@ long __attribute__((export_name("TS_LDKCustomMessageHandler_new"))) TS_LDKCusto return (long)res_ptr; } uint32_t __attribute__((export_name("TS_CustomMessageHandler_handle_custom_message"))) TS_CustomMessageHandler_handle_custom_message(uint32_t this_arg, uint32_t msg, int8_tArray sender_node_id) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; - void* msg_ptr = (void*)(((uint64_t)msg) & ~1); + void* msg_ptr = (void*)(((uintptr_t)msg) & ~1); CHECK_ACCESS(msg_ptr); LDKType msg_conv = *(LDKType*)(msg_ptr); LDKPublicKey sender_node_id_ref; CHECK(sender_node_id->arr_len == 33); - memcpy(sender_node_id_ref.compressed_form, sender_node_id->elems, 33); + memcpy(sender_node_id_ref.compressed_form, sender_node_id->elems, 33); FREE(sender_node_id); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv, sender_node_id_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_tArray __attribute__((export_name("TS_CustomMessageHandler_get_and_clear_pending_msg"))) TS_CustomMessageHandler_get_and_clear_pending_msg(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr; LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t z = 0; z < ret_var.datalen; z++) { LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); *ret_conv_25_conv = ret_var.data[z]; - ret_arr_ptr[z] = ((uint64_t)ret_conv_25_conv); + ret_arr_ptr[z] = ((uintptr_t)ret_conv_25_conv); } FREE(ret_var.data); @@ -8603,7 +8616,7 @@ static void LDKSocketDescriptor_JCalls_free(void* this_arg) { uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; LDKu8slice data_var = data; - int8_tArray data_arr = init_int8_tArray(data_var.datalen); + int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__); memcpy(data_arr->elems, data_var.data, data_var.datalen); return js_invoke_function_2(j_calls->instance_ptr, 78, (uint32_t)data_arr, (uint32_t)resume_read); } @@ -8615,7 +8628,7 @@ bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescripto LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); *other_arg_clone = SocketDescriptor_clone(other_arg); - return js_invoke_function_1(j_calls->instance_ptr, 80, (uint32_t)(uint64_t)other_arg_clone); + return js_invoke_function_1(j_calls->instance_ptr, 80, (uint32_t)(uintptr_t)other_arg_clone); } uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; @@ -8646,26 +8659,26 @@ long __attribute__((export_name("TS_LDKSocketDescriptor_new"))) TS_LDKSocketDes *res_ptr = LDKSocketDescriptor_init(o); return (long)res_ptr; } -int64_t __attribute__((export_name("TS_SocketDescriptor_send_data"))) TS_SocketDescriptor_send_data(uint32_t this_arg, int8_tArray data, jboolean resume_read) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); +intptr_t __attribute__((export_name("TS_SocketDescriptor_send_data"))) TS_SocketDescriptor_send_data(uint32_t this_arg, int8_tArray data, jboolean resume_read) { + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr; LDKu8slice data_ref; data_ref.datalen = data->arr_len; - data_ref.data = data->elems; - int64_t ret_val = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read); + data_ref.data = data->elems /* XXX data leaks */; + intptr_t ret_val = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read); return ret_val; } void __attribute__((export_name("TS_SocketDescriptor_disconnect_socket"))) TS_SocketDescriptor_disconnect_socket(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr; (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg); } int64_t __attribute__((export_name("TS_SocketDescriptor_hash"))) TS_SocketDescriptor_hash(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr; int64_t ret_val = (this_arg_conv->hash)(this_arg_conv->this_arg); @@ -8686,24 +8699,24 @@ uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t shor LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; LDKCOption_u64Z *channel_capacity_msat_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *channel_capacity_msat_copy = channel_capacity_msat; - uint64_t channel_capacity_msat_ref = (uint64_t)channel_capacity_msat_copy; + uintptr_t channel_capacity_msat_ref = (uintptr_t)channel_capacity_msat_copy; LDKNodeId source_var = *source; - uint64_t source_ref = 0; + uintptr_t source_ref = 0; source_var = NodeId_clone(source); - CHECK((((uint64_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)source_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&source_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var); - source_ref = (uint64_t)source_var.inner; + source_ref = (uintptr_t)source_var.inner; if (source_var.is_owned) { source_ref |= 1; } LDKNodeId target_var = *target; - uint64_t target_ref = 0; + uintptr_t target_ref = 0; target_var = NodeId_clone(target); - CHECK((((uint64_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + CHECK((((uintptr_t)target_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&target_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var); - target_ref = (uint64_t)target_var.inner; + target_ref = (uintptr_t)target_var.inner; if (target_var.is_owned) { target_ref |= 1; } @@ -8713,15 +8726,15 @@ void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; LDKCVec_RouteHopZ path_var = path; uint32_tArray path_arr = NULL; - path_arr = init_uint32_tArray(path_var.datalen); + path_arr = init_uint32_tArray(path_var.datalen, __LINE__); uint32_t *path_arr_ptr = (uint32_t*)(((uint8_t*)path_arr) + 4); for (size_t k = 0; k < path_var.datalen; k++) { LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uint64_t)path_conv_10_var.inner; + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; if (path_conv_10_var.is_owned) { path_conv_10_ref |= 1; } @@ -8735,15 +8748,15 @@ void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ pa LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg; LDKCVec_RouteHopZ path_var = path; uint32_tArray path_arr = NULL; - path_arr = init_uint32_tArray(path_var.datalen); + path_arr = init_uint32_tArray(path_var.datalen, __LINE__); uint32_t *path_arr_ptr = (uint32_t*)(((uint8_t*)path_arr) + 4); for (size_t k = 0; k < path_var.datalen; k++) { LDKRouteHop path_conv_10_var = path_var.data[k]; - uint64_t path_conv_10_ref = 0; - CHECK((((uint64_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t path_conv_10_ref = 0; + CHECK((((uintptr_t)path_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&path_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var); - path_conv_10_ref = (uint64_t)path_conv_10_var.inner; + path_conv_10_ref = (uintptr_t)path_conv_10_var.inner; if (path_conv_10_var.is_owned) { path_conv_10_ref |= 1; } @@ -8759,7 +8772,7 @@ LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) { LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(ret_ref.data, ret->elems, ret_ref.datalen); + memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret); return ret_ref; } static void LDKScore_JCalls_cloned(LDKScore* new_obj) { @@ -8787,13 +8800,13 @@ long __attribute__((export_name("TS_LDKScore_new"))) TS_LDKScore_new(JSValue o) return (long)res_ptr; } int64_t __attribute__((export_name("TS_Score_channel_penalty_msat"))) TS_Score_channel_penalty_msat(uint32_t this_arg, int64_t short_channel_id, int64_t send_amt_msat, uint32_t channel_capacity_msat, uint32_t source, uint32_t target) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; - void* channel_capacity_msat_ptr = (void*)(((uint64_t)channel_capacity_msat) & ~1); + void* channel_capacity_msat_ptr = (void*)(((uintptr_t)channel_capacity_msat) & ~1); CHECK_ACCESS(channel_capacity_msat_ptr); LDKCOption_u64Z channel_capacity_msat_conv = *(LDKCOption_u64Z*)(channel_capacity_msat_ptr); - channel_capacity_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)channel_capacity_msat) & ~1)); + channel_capacity_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)channel_capacity_msat) & ~1)); LDKNodeId source_conv; source_conv.inner = (void*)(source & (~1)); source_conv.is_owned = false; @@ -8807,7 +8820,7 @@ int64_t __attribute__((export_name("TS_Score_channel_penalty_msat"))) TS_Score_ } void __attribute__((export_name("TS_Score_payment_path_failed"))) TS_Score_payment_path_failed(uint32_t this_arg, uint32_tArray path, int64_t short_channel_id) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; LDKCVec_RouteHopZ path_constr; @@ -8816,7 +8829,7 @@ void __attribute__((export_name("TS_Score_payment_path_failed"))) TS_Score_paym path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else path_constr.data = NULL; - uint32_t* path_vals = path->elems; + uint32_t* path_vals = path->elems /* XXX path leaks */; for (size_t k = 0; k < path_constr.datalen; k++) { uint32_t path_conv_10 = path_vals[k]; LDKRouteHop path_conv_10_conv; @@ -8830,7 +8843,7 @@ void __attribute__((export_name("TS_Score_payment_path_failed"))) TS_Score_paym } void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_payment_path_successful(uint32_t this_arg, uint32_tArray path) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; LDKCVec_RouteHopZ path_constr; @@ -8839,7 +8852,7 @@ void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_ path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else path_constr.data = NULL; - uint32_t* path_vals = path->elems; + uint32_t* path_vals = path->elems /* XXX path leaks */; for (size_t k = 0; k < path_constr.datalen; k++) { uint32_t path_conv_10 = path_vals[k]; LDKRouteHop path_conv_10_conv; @@ -8853,11 +8866,11 @@ void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_ } int8_tArray __attribute__((export_name("TS_Score_write"))) TS_Score_write(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr; LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -8876,7 +8889,7 @@ static void LDKLockableScore_JCalls_free(void* this_arg) { LDKScore lock_LDKLockableScore_jcall(const void* this_arg) { LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg; uint32_t ret = js_invoke_function_0(j_calls->instance_ptr, 86); - void* ret_ptr = (void*)(((uint64_t)ret) & ~1); + void* ret_ptr = (void*)(((uintptr_t)ret) & ~1); CHECK_ACCESS(ret_ptr); LDKScore ret_conv = *(LDKScore*)(ret_ptr);// Warning: we may need a move here but no clone is available for LDKScore @@ -8904,12 +8917,12 @@ long __attribute__((export_name("TS_LDKLockableScore_new"))) TS_LDKLockableScor return (long)res_ptr; } uint32_t __attribute__((export_name("TS_LockableScore_lock"))) TS_LockableScore_lock(uint32_t this_arg) { - void* this_arg_ptr = (void*)(((uint64_t)this_arg) & ~1); + void* this_arg_ptr = (void*)(((uintptr_t)this_arg) & ~1); if (!(this_arg & 1)) { CHECK_ACCESS(this_arg_ptr); } LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr; LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } jstring __attribute__((export_name("TS__ldk_get_compiled_version"))) TS__ldk_get_compiled_version() { @@ -8930,7 +8943,7 @@ void __attribute__((export_name("TS_Transaction_free"))) TS_Transaction_free(in LDKTransaction _res_ref; _res_ref.datalen = _res->arr_len; _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes"); - memcpy(_res_ref.data, _res->elems, _res_ref.datalen); + memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res); _res_ref.data_is_owned = true; Transaction_free(_res_ref); } @@ -8939,15 +8952,15 @@ uint32_t __attribute__((export_name("TS_TxOut_new"))) TS_TxOut_new(int8_tArray LDKCVec_u8Z script_pubkey_ref; script_pubkey_ref.datalen = script_pubkey->arr_len; script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_pubkey_ref.data, script_pubkey->elems, script_pubkey_ref.datalen); + memcpy(script_pubkey_ref.data, script_pubkey->elems, script_pubkey_ref.datalen); FREE(script_pubkey); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); *ret_ref = TxOut_new(script_pubkey_ref, value); - return (uint64_t)ret_ref; + return (uintptr_t)ret_ref; } void __attribute__((export_name("TS_TxOut_free"))) TS_TxOut_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr); FREE((void*)_res); @@ -8957,11 +8970,11 @@ void __attribute__((export_name("TS_TxOut_free"))) TS_TxOut_free(uint32_t _res) static inline uintptr_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) { LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); *ret_ref = TxOut_clone(arg); - return (uint64_t)ret_ref; + return (uintptr_t)ret_ref; } -int64_t __attribute__((export_name("TS_TxOut_clone_ptr"))) TS_TxOut_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_TxOut_clone_ptr"))) TS_TxOut_clone_ptr(uint32_t arg) { LDKTxOut* arg_conv = (LDKTxOut*)(arg & ~1); - int64_t ret_val = TxOut_clone_ptr(arg_conv); + intptr_t ret_val = TxOut_clone_ptr(arg_conv); return ret_val; } @@ -8969,7 +8982,7 @@ uint32_t __attribute__((export_name("TS_TxOut_clone"))) TS_TxOut_clone(uint32_t LDKTxOut* orig_conv = (LDKTxOut*)(orig & ~1); LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); *ret_ref = TxOut_clone(orig_conv); - return (uint64_t)ret_ref; + return (uintptr_t)ret_ref; } void __attribute__((export_name("TS_Str_free"))) TS_Str_free(jstring _res) { @@ -8985,7 +8998,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_ok")) o_conv = ChannelConfig_clone(&o_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_err"))) TS_CResult_ChannelConfigDecodeErrorZ_err(uint32_t e) { @@ -8996,7 +9009,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_is_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_is_ok(uint32_t o) { @@ -9007,7 +9020,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_free"))) TS_CResult_ChannelConfigDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9017,11 +9030,11 @@ void __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_free"))) static inline uintptr_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9029,7 +9042,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_CResult_OutPointDecodeErrorZ_ok(uint32_t o) { @@ -9040,7 +9053,7 @@ uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_ o_conv = OutPoint_clone(&o_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS_CResult_OutPointDecodeErrorZ_err(uint32_t e) { @@ -9051,7 +9064,7 @@ uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS e_conv = DecodeError_clone(&e_conv); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_is_ok"))) TS_CResult_OutPointDecodeErrorZ_is_ok(uint32_t o) { @@ -9062,7 +9075,7 @@ jboolean __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_free"))) TS_CResult_OutPointDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9072,11 +9085,11 @@ void __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_free"))) TS_CR static inline uintptr_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone_ptr"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone_ptr"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9084,23 +9097,23 @@ uint32_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone"))) LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)(orig & ~1); LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_ok"))) TS_CResult_SecretKeyErrorZ_ok(int8_tArray o) { LDKSecretKey o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.bytes, o->elems, 32); + memcpy(o_ref.bytes, o->elems, 32); FREE(o); LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_err"))) TS_CResult_SecretKeyErrorZ_err(uint32_t e) { LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); *ret_conv = CResult_SecretKeyErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_SecretKeyErrorZ_is_ok"))) TS_CResult_SecretKeyErrorZ_is_ok(uint32_t o) { @@ -9111,7 +9124,7 @@ jboolean __attribute__((export_name("TS_CResult_SecretKeyErrorZ_is_ok"))) TS_CR void __attribute__((export_name("TS_CResult_SecretKeyErrorZ_free"))) TS_CResult_SecretKeyErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9121,17 +9134,17 @@ void __attribute__((export_name("TS_CResult_SecretKeyErrorZ_free"))) TS_CResult uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_ok"))) TS_CResult_PublicKeyErrorZ_ok(int8_tArray o) { LDKPublicKey o_ref; CHECK(o->arr_len == 33); - memcpy(o_ref.compressed_form, o->elems, 33); + memcpy(o_ref.compressed_form, o->elems, 33); FREE(o); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_err"))) TS_CResult_PublicKeyErrorZ_err(uint32_t e) { LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = CResult_PublicKeyErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PublicKeyErrorZ_is_ok"))) TS_CResult_PublicKeyErrorZ_is_ok(uint32_t o) { @@ -9142,7 +9155,7 @@ jboolean __attribute__((export_name("TS_CResult_PublicKeyErrorZ_is_ok"))) TS_CR void __attribute__((export_name("TS_CResult_PublicKeyErrorZ_free"))) TS_CResult_PublicKeyErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9152,11 +9165,11 @@ void __attribute__((export_name("TS_CResult_PublicKeyErrorZ_free"))) TS_CResult static inline uintptr_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) { LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = CResult_PublicKeyErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone_ptr"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone_ptr"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9164,7 +9177,7 @@ uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone"))) TS_CR LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)(orig & ~1); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_ok(uint32_t o) { @@ -9175,7 +9188,7 @@ uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok") o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint32_t e) { @@ -9186,7 +9199,7 @@ uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint32_t o) { @@ -9197,7 +9210,7 @@ jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9207,11 +9220,11 @@ void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) static inline uintptr_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9219,7 +9232,7 @@ uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clon LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_ok(uint32_t o) { @@ -9230,7 +9243,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_o o_conv = ChannelPublicKeys_clone(&o_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint32_t e) { @@ -9241,7 +9254,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_e e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(uint32_t o) { @@ -9252,7 +9265,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_i void __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_free"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9262,11 +9275,11 @@ void __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_free" static inline uintptr_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9274,7 +9287,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_c LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_ok"))) TS_CResult_TxCreationKeysErrorZ_ok(uint32_t o) { @@ -9285,14 +9298,14 @@ uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_ok"))) TS_ o_conv = TxCreationKeys_clone(&o_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_err"))) TS_CResult_TxCreationKeysErrorZ_err(uint32_t e) { LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_is_ok"))) TS_CResult_TxCreationKeysErrorZ_is_ok(uint32_t o) { @@ -9303,7 +9316,7 @@ jboolean __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_free"))) TS_CResult_TxCreationKeysErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9313,11 +9326,11 @@ void __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_free"))) TS_CR static inline uintptr_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) { LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint32_t arg) { LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)(arg & ~1); - int64_t ret_val = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9325,26 +9338,26 @@ uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone"))) LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)(orig & ~1); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_u32Z_some"))) TS_COption_u32Z_some(int32_t o) { LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = COption_u32Z_some(o); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_u32Z_none"))) TS_COption_u32Z_none() { LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = COption_u32Z_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_u32Z_free"))) TS_COption_u32Z_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr); FREE((void*)_res); @@ -9354,12 +9367,12 @@ void __attribute__((export_name("TS_COption_u32Z_free"))) TS_COption_u32Z_free( static inline uintptr_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) { LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = COption_u32Z_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_u32Z_clone_ptr"))) TS_COption_u32Z_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_u32Z_clone_ptr"))) TS_COption_u32Z_clone_ptr(uint32_t arg) { LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)arg; - int64_t ret_val = COption_u32Z_clone_ptr(arg_conv); + intptr_t ret_val = COption_u32Z_clone_ptr(arg_conv); return ret_val; } @@ -9367,7 +9380,7 @@ uint32_t __attribute__((export_name("TS_COption_u32Z_clone"))) TS_COption_u32Z_ LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)orig; LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = COption_u32Z_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -9379,7 +9392,7 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErr o_conv = HTLCOutputInCommitment_clone(&o_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(uint32_t e) { @@ -9390,7 +9403,7 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErr e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(uint32_t o) { @@ -9401,7 +9414,7 @@ jboolean __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErr void __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9411,11 +9424,11 @@ void __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ static inline uintptr_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9423,7 +9436,7 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErr LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_NoneZ_some"))) TS_COption_NoneZ_some() { @@ -9449,7 +9462,7 @@ uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionP o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(uint32_t e) { @@ -9460,7 +9473,7 @@ uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionP e_conv = DecodeError_clone(&e_conv); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(uint32_t o) { @@ -9471,7 +9484,7 @@ jboolean __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionP void __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9481,11 +9494,11 @@ void __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParam static inline uintptr_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9493,7 +9506,7 @@ uint32_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionP LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok(uint32_t o) { @@ -9504,7 +9517,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDec o_conv = ChannelTransactionParameters_clone(&o_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_err(uint32_t e) { @@ -9515,7 +9528,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDec e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(uint32_t o) { @@ -9526,7 +9539,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelTransactionParametersDec void __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9536,11 +9549,11 @@ void __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeE static inline uintptr_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9548,7 +9561,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDec LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_SignatureZ_free"))) TS_CVec_SignatureZ_free(ptrArray _res) { @@ -9558,12 +9571,12 @@ void __attribute__((export_name("TS_CVec_SignatureZ_free"))) TS_CVec_SignatureZ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; + int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { int8_tArray _res_conv_12 = _res_vals[m]; LDKSignature _res_conv_12_ref; CHECK(_res_conv_12->arr_len == 64); - memcpy(_res_conv_12_ref.compact_form, _res_conv_12->elems, 64); + memcpy(_res_conv_12_ref.compact_form, _res_conv_12->elems, 64); FREE(_res_conv_12); _res_constr.data[m] = _res_conv_12_ref; } CVec_SignatureZ_free(_res_constr); @@ -9577,7 +9590,7 @@ uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDeco o_conv = HolderCommitmentTransaction_clone(&o_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err(uint32_t e) { @@ -9588,7 +9601,7 @@ uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDeco e_conv = DecodeError_clone(&e_conv); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { @@ -9599,7 +9612,7 @@ jboolean __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDeco void __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9609,11 +9622,11 @@ void __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeEr static inline uintptr_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9621,7 +9634,7 @@ uint32_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDeco LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(uint32_t o) { @@ -9632,7 +9645,7 @@ uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecod o_conv = BuiltCommitmentTransaction_clone(&o_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err(uint32_t e) { @@ -9643,7 +9656,7 @@ uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecod e_conv = DecodeError_clone(&e_conv); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { @@ -9654,7 +9667,7 @@ jboolean __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecod void __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9664,11 +9677,11 @@ void __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErr static inline uintptr_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9676,7 +9689,7 @@ uint32_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecod LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_ok(uint32_t o) { @@ -9687,13 +9700,13 @@ uint32_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ // Warning: we need a move here but no clone is available for LDKTrustedClosingTransaction LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_err"))) TS_CResult_TrustedClosingTransactionNoneZ_err() { LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = CResult_TrustedClosingTransactionNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_is_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_is_ok(uint32_t o) { @@ -9704,7 +9717,7 @@ jboolean __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_free"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr); FREE((void*)_res); @@ -9719,7 +9732,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErro o_conv = CommitmentTransaction_clone(&o_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_err(uint32_t e) { @@ -9730,7 +9743,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErro e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok(uint32_t o) { @@ -9741,7 +9754,7 @@ jboolean __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErro void __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_free"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9751,11 +9764,11 @@ void __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_f static inline uintptr_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9763,7 +9776,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErro LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_ok(uint32_t o) { @@ -9774,13 +9787,13 @@ uint32_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNon // Warning: we need a move here but no clone is available for LDKTrustedCommitmentTransaction LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_err() { LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok(uint32_t o) { @@ -9791,7 +9804,7 @@ jboolean __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNon void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_free"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr); FREE((void*)_res); @@ -9805,23 +9818,23 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_ok"))) TS_ o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else o_constr.data = NULL; - int8_tArray* o_vals = (void*) o->elems; + int8_tArray* o_vals = (void*) o->elems /* XXX o leaks */; for (size_t m = 0; m < o_constr.datalen; m++) { int8_tArray o_conv_12 = o_vals[m]; LDKSignature o_conv_12_ref; CHECK(o_conv_12->arr_len == 64); - memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); + memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); FREE(o_conv_12); o_constr.data[m] = o_conv_12_ref; } LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_err"))) TS_CResult_CVec_SignatureZNoneZ_err() { LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = CResult_CVec_SignatureZNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_is_ok"))) TS_CResult_CVec_SignatureZNoneZ_is_ok(uint32_t o) { @@ -9832,7 +9845,7 @@ jboolean __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_is_ok"))) void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_free"))) TS_CResult_CVec_SignatureZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr); FREE((void*)_res); @@ -9842,11 +9855,11 @@ void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_free"))) TS_CR static inline uintptr_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) { LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone_ptr"))) TS_CResult_CVec_SignatureZNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone_ptr"))) TS_CResult_CVec_SignatureZNoneZ_clone_ptr(uint32_t arg) { LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)(arg & ~1); - int64_t ret_val = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -9854,7 +9867,7 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone"))) LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)(orig & ~1); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = CResult_CVec_SignatureZNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_ok(uint32_t o) { @@ -9865,7 +9878,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok") o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_err(uint32_t e) { @@ -9876,7 +9889,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_is_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_is_ok(uint32_t o) { @@ -9887,7 +9900,7 @@ jboolean __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_free"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -9897,11 +9910,11 @@ void __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_free"))) static inline uintptr_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -9909,7 +9922,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clon LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(uint32_t o) { @@ -9920,7 +9933,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownSc o_conv = ShutdownScript_clone(&o_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err(uint32_t e) { @@ -9931,7 +9944,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownSc e_conv = InvalidShutdownScript_clone(&e_conv); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(uint32_t o) { @@ -9942,7 +9955,7 @@ jboolean __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownSc void __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr); FREE((void*)_res); @@ -9952,11 +9965,11 @@ void __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScript static inline uintptr_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint32_t arg) { LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1); - int64_t ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); return ret_val; } @@ -9964,29 +9977,29 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownSc LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(orig & ~1); LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_TypeZ_some"))) TS_COption_TypeZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKType o_conv = *(LDKType*)(o_ptr); LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); *ret_copy = COption_TypeZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_TypeZ_none"))) TS_COption_TypeZ_none() { LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); *ret_copy = COption_TypeZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_TypeZ_free"))) TS_COption_TypeZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr); FREE((void*)_res); @@ -9996,12 +10009,12 @@ void __attribute__((export_name("TS_COption_TypeZ_free"))) TS_COption_TypeZ_fre static inline uintptr_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) { LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); *ret_copy = COption_TypeZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_TypeZ_clone_ptr"))) TS_COption_TypeZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_TypeZ_clone_ptr"))) TS_COption_TypeZ_clone_ptr(uint32_t arg) { LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)arg; - int64_t ret_val = COption_TypeZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_TypeZ_clone_ptr(arg_conv); return ret_val; } @@ -10009,18 +10022,18 @@ uint32_t __attribute__((export_name("TS_COption_TypeZ_clone"))) TS_COption_Type LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)orig; LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ"); *ret_copy = COption_TypeZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr); - o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uint64_t)o) & ~1)); + o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)(((uintptr_t)o) & ~1)); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_err"))) TS_CResult_COption_TypeZDecodeErrorZ_err(uint32_t e) { @@ -10031,7 +10044,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_is_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_is_ok(uint32_t o) { @@ -10042,7 +10055,7 @@ jboolean __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_free"))) TS_CResult_COption_TypeZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10052,11 +10065,11 @@ void __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_free"))) static inline uintptr_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10064,21 +10077,21 @@ uint32_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ"); *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_ok"))) TS_CResult_StringErrorZ_ok(jstring o) { LDKStr o_conv = str_ref_to_owned_c(o); LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); *ret_conv = CResult_StringErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_err"))) TS_CResult_StringErrorZ_err(uint32_t e) { LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); *ret_conv = CResult_StringErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_StringErrorZ_is_ok"))) TS_CResult_StringErrorZ_is_ok(uint32_t o) { @@ -10089,7 +10102,7 @@ jboolean __attribute__((export_name("TS_CResult_StringErrorZ_is_ok"))) TS_CResu void __attribute__((export_name("TS_CResult_StringErrorZ_free"))) TS_CResult_StringErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10104,7 +10117,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeError o_conv = ChannelMonitorUpdate_clone(&o_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err(uint32_t e) { @@ -10115,7 +10128,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeError e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(uint32_t o) { @@ -10126,7 +10139,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeError void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10136,11 +10149,11 @@ void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_fr static inline uintptr_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10148,30 +10161,30 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeError LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_MonitorEventZ_some"))) TS_COption_MonitorEventZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr); - o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uint64_t)o) & ~1)); + o_conv = MonitorEvent_clone((LDKMonitorEvent*)(((uintptr_t)o) & ~1)); LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); *ret_copy = COption_MonitorEventZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_MonitorEventZ_none"))) TS_COption_MonitorEventZ_none() { LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); *ret_copy = COption_MonitorEventZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_MonitorEventZ_free"))) TS_COption_MonitorEventZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr); FREE((void*)_res); @@ -10181,12 +10194,12 @@ void __attribute__((export_name("TS_COption_MonitorEventZ_free"))) TS_COption_M static inline uintptr_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) { LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); *ret_copy = COption_MonitorEventZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone_ptr"))) TS_COption_MonitorEventZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_MonitorEventZ_clone_ptr"))) TS_COption_MonitorEventZ_clone_ptr(uint32_t arg) { LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)arg; - int64_t ret_val = COption_MonitorEventZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_MonitorEventZ_clone_ptr(arg_conv); return ret_val; } @@ -10194,18 +10207,18 @@ uint32_t __attribute__((export_name("TS_COption_MonitorEventZ_clone"))) TS_COpt LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)orig; LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); *ret_copy = COption_MonitorEventZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr); - o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uint64_t)o) & ~1)); + o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)(((uintptr_t)o) & ~1)); LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint32_t e) { @@ -10216,7 +10229,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErro e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok(uint32_t o) { @@ -10227,7 +10240,7 @@ jboolean __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErro void __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_free"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10237,11 +10250,11 @@ void __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_f static inline uintptr_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10249,7 +10262,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErro LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_ok(uint32_t o) { @@ -10260,7 +10273,7 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) T o_conv = HTLCUpdate_clone(&o_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_err(uint32_t e) { @@ -10271,7 +10284,7 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) e_conv = DecodeError_clone(&e_conv); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_is_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_is_ok(uint32_t o) { @@ -10282,7 +10295,7 @@ jboolean __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_is_ok")) void __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_free"))) TS_CResult_HTLCUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10292,11 +10305,11 @@ void __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_free"))) TS_ static inline uintptr_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10304,19 +10317,19 @@ uint32_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone")) LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneNoneZ_ok"))) TS_CResult_NoneNoneZ_ok() { LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = CResult_NoneNoneZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneNoneZ_err"))) TS_CResult_NoneNoneZ_err() { LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = CResult_NoneNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NoneNoneZ_is_ok"))) TS_CResult_NoneNoneZ_is_ok(uint32_t o) { @@ -10327,7 +10340,7 @@ jboolean __attribute__((export_name("TS_CResult_NoneNoneZ_is_ok"))) TS_CResult_ void __attribute__((export_name("TS_CResult_NoneNoneZ_free"))) TS_CResult_NoneNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr); FREE((void*)_res); @@ -10337,11 +10350,11 @@ void __attribute__((export_name("TS_CResult_NoneNoneZ_free"))) TS_CResult_NoneN static inline uintptr_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) { LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = CResult_NoneNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone_ptr"))) TS_CResult_NoneNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone_ptr"))) TS_CResult_NoneNoneZ_clone_ptr(uint32_t arg) { LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)(arg & ~1); - int64_t ret_val = CResult_NoneNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NoneNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -10349,7 +10362,7 @@ uint32_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone"))) TS_CResult_ LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)(orig & ~1); LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = CResult_NoneNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_new"))) TS_C2Tuple_OutPointScriptZ_new(uint32_t a, int8_tArray b) { @@ -10361,15 +10374,15 @@ uint32_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_new"))) TS_C2Tu LDKCVec_u8Z b_ref; b_ref.datalen = b->arr_len; b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(b_ref.data, b->elems, b_ref.datalen); + memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_free"))) TS_C2Tuple_OutPointScriptZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr); FREE((void*)_res); @@ -10380,15 +10393,15 @@ uint32_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_new"))) TS_C2Tuple_u LDKCVec_u8Z b_ref; b_ref.datalen = b->arr_len; b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(b_ref.data, b->elems, b_ref.datalen); + memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b); LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_u32ScriptZ_free"))) TS_C2Tuple_u32ScriptZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr); FREE((void*)_res); @@ -10402,10 +10415,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_u32ScriptZZ_free"))) TS_CVec_C _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t v = 0; v < _res_constr.datalen; v++) { uint32_t _res_conv_21 = _res_vals[v]; - void* _res_conv_21_ptr = (void*)(((uint64_t)_res_conv_21) & ~1); + void* _res_conv_21_ptr = (void*)(((uintptr_t)_res_conv_21) & ~1); CHECK_ACCESS(_res_conv_21_ptr); LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr); FREE((void*)_res_conv_21); @@ -10417,17 +10430,17 @@ void __attribute__((export_name("TS_CVec_C2Tuple_u32ScriptZZ_free"))) TS_CVec_C uint32_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(int8_tArray a, uint32_tArray b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKCVec_C2Tuple_u32ScriptZZ b_constr; b_constr.datalen = b->arr_len; if (b_constr.datalen > 0) b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements"); else b_constr.data = NULL; - uint32_t* b_vals = b->elems; + uint32_t* b_vals = b->elems /* XXX b leaks */; for (size_t v = 0; v < b_constr.datalen; v++) { uint32_t b_conv_21 = b_vals[v]; - void* b_conv_21_ptr = (void*)(((uint64_t)b_conv_21) & ~1); + void* b_conv_21_ptr = (void*)(((uintptr_t)b_conv_21) & ~1); CHECK_ACCESS(b_conv_21_ptr); LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr); // Warning: we may need a move here but no clone is available for LDKC2Tuple_u32ScriptZ @@ -10435,12 +10448,12 @@ uint32_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_n } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr); FREE((void*)_res); @@ -10454,10 +10467,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t o = 0; o < _res_constr.datalen; o++) { uint32_t _res_conv_40 = _res_vals[o]; - void* _res_conv_40_ptr = (void*)(((uint64_t)_res_conv_40) & ~1); + void* _res_conv_40_ptr = (void*)(((uintptr_t)_res_conv_40) & ~1); CHECK_ACCESS(_res_conv_40_ptr); LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr); FREE((void*)_res_conv_40); @@ -10473,10 +10486,10 @@ void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_Monitor _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t o = 0; o < _res_constr.datalen; o++) { uint32_t _res_conv_14 = _res_vals[o]; - void* _res_conv_14_ptr = (void*)(((uint64_t)_res_conv_14) & ~1); + void* _res_conv_14_ptr = (void*)(((uintptr_t)_res_conv_14) & ~1); CHECK_ACCESS(_res_conv_14_ptr); LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr); FREE((void*)_res_conv_14); @@ -10492,10 +10505,10 @@ void __attribute__((export_name("TS_CVec_EventZ_free"))) TS_CVec_EventZ_free(ui _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t h = 0; h < _res_constr.datalen; h++) { uint32_t _res_conv_7 = _res_vals[h]; - void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1); + void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); CHECK_ACCESS(_res_conv_7_ptr); LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr); FREE((void*)_res_conv_7); @@ -10511,13 +10524,13 @@ void __attribute__((export_name("TS_CVec_TransactionZ_free"))) TS_CVec_Transact _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements"); else _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; + int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { int8_tArray _res_conv_12 = _res_vals[m]; LDKTransaction _res_conv_12_ref; _res_conv_12_ref.datalen = _res_conv_12->arr_len; _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKTransaction Bytes"); - memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); + memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12); _res_conv_12_ref.data_is_owned = true; _res_constr.data[m] = _res_conv_12_ref; } @@ -10527,11 +10540,11 @@ void __attribute__((export_name("TS_CVec_TransactionZ_free"))) TS_CVec_Transact static inline uintptr_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone_ptr"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone_ptr"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint32_t arg) { LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)(arg & ~1); - int64_t ret_val = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv); return ret_val; } @@ -10539,23 +10552,23 @@ uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone"))) TS_ LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)(orig & ~1); LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_new"))) TS_C2Tuple_usizeTransactionZ_new(int64_t a, int8_tArray b) { +uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_new"))) TS_C2Tuple_usizeTransactionZ_new(intptr_t a, int8_tArray b) { LDKTransaction b_ref; b_ref.datalen = b->arr_len; b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); - memcpy(b_ref.data, b->elems, b_ref.datalen); + memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b); b_ref.data_is_owned = true; LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_free"))) TS_C2Tuple_usizeTransactionZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr); FREE((void*)_res); @@ -10569,10 +10582,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_usizeTransactionZZ_free"))) TS _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t c = 0; c < _res_constr.datalen; c++) { uint32_t _res_conv_28 = _res_vals[c]; - void* _res_conv_28_ptr = (void*)(((uint64_t)_res_conv_28) & ~1); + void* _res_conv_28_ptr = (void*)(((uintptr_t)_res_conv_28) & ~1); CHECK_ACCESS(_res_conv_28_ptr); LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr); FREE((void*)_res_conv_28); @@ -10584,11 +10597,11 @@ void __attribute__((export_name("TS_CVec_C2Tuple_usizeTransactionZZ_free"))) TS static inline uintptr_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); *ret_conv = C2Tuple_u32TxOutZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone_ptr"))) TS_C2Tuple_u32TxOutZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone_ptr"))) TS_C2Tuple_u32TxOutZ_clone_ptr(uint32_t arg) { LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)(arg & ~1); - int64_t ret_val = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_u32TxOutZ_clone_ptr(arg_conv); return ret_val; } @@ -10596,22 +10609,22 @@ uint32_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone"))) TS_C2Tuple_ LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)(orig & ~1); LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_new"))) TS_C2Tuple_u32TxOutZ_new(int32_t a, uint32_t b) { - void* b_ptr = (void*)(((uint64_t)b) & ~1); + void* b_ptr = (void*)(((uintptr_t)b) & ~1); CHECK_ACCESS(b_ptr); LDKTxOut b_conv = *(LDKTxOut*)(b_ptr); - b_conv = TxOut_clone((LDKTxOut*)(((uint64_t)b) & ~1)); + b_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)b) & ~1)); LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_u32TxOutZ_free"))) TS_C2Tuple_u32TxOutZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr); FREE((void*)_res); @@ -10625,10 +10638,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_u32TxOutZZ_free"))) TS_CVec_C2 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t u = 0; u < _res_constr.datalen; u++) { uint32_t _res_conv_20 = _res_vals[u]; - void* _res_conv_20_ptr = (void*)(((uint64_t)_res_conv_20) & ~1); + void* _res_conv_20_ptr = (void*)(((uintptr_t)_res_conv_20) & ~1); CHECK_ACCESS(_res_conv_20_ptr); LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr); FREE((void*)_res_conv_20); @@ -10640,11 +10653,11 @@ void __attribute__((export_name("TS_CVec_C2Tuple_u32TxOutZZ_free"))) TS_CVec_C2 static inline uintptr_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(uint32_t arg) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(arg & ~1); - int64_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv); return ret_val; } @@ -10652,36 +10665,36 @@ uint32_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_cl LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(orig & ~1); LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(int8_tArray a, uint32_tArray b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKCVec_C2Tuple_u32TxOutZZ b_constr; b_constr.datalen = b->arr_len; if (b_constr.datalen > 0) b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements"); else b_constr.data = NULL; - uint32_t* b_vals = b->elems; + uint32_t* b_vals = b->elems /* XXX b leaks */; for (size_t u = 0; u < b_constr.datalen; u++) { uint32_t b_conv_20 = b_vals[u]; - void* b_conv_20_ptr = (void*)(((uint64_t)b_conv_20) & ~1); + void* b_conv_20_ptr = (void*)(((uintptr_t)b_conv_20) & ~1); CHECK_ACCESS(b_conv_20_ptr); LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr); - b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uint64_t)b_conv_20) & ~1)); + b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)(((uintptr_t)b_conv_20) & ~1)); b_constr.data[u] = b_conv_20_conv; } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr); FREE((void*)_res); @@ -10695,10 +10708,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t n = 0; n < _res_constr.datalen; n++) { uint32_t _res_conv_39 = _res_vals[n]; - void* _res_conv_39_ptr = (void*)(((uint64_t)_res_conv_39) & ~1); + void* _res_conv_39_ptr = (void*)(((uintptr_t)_res_conv_39) & ~1); CHECK_ACCESS(_res_conv_39_ptr); LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr); FREE((void*)_res_conv_39); @@ -10714,12 +10727,12 @@ void __attribute__((export_name("TS_CVec_TxidZ_free"))) TS_CVec_TxidZ_free(ptrA _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements"); else _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; + int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { int8_tArray _res_conv_12 = _res_vals[m]; LDKThirtyTwoBytes _res_conv_12_ref; CHECK(_res_conv_12->arr_len == 32); - memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); + memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12); _res_constr.data[m] = _res_conv_12_ref; } CVec_TxidZ_free(_res_constr); @@ -10732,10 +10745,10 @@ void __attribute__((export_name("TS_CVec_BalanceZ_free"))) TS_CVec_BalanceZ_fre _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t j = 0; j < _res_constr.datalen; j++) { uint32_t _res_conv_9 = _res_vals[j]; - void* _res_conv_9_ptr = (void*)(((uint64_t)_res_conv_9) & ~1); + void* _res_conv_9_ptr = (void*)(((uintptr_t)_res_conv_9) & ~1); CHECK_ACCESS(_res_conv_9_ptr); LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr); FREE((void*)_res_conv_9); @@ -10747,11 +10760,11 @@ void __attribute__((export_name("TS_CVec_BalanceZ_free"))) TS_CVec_BalanceZ_fre static inline uintptr_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) { LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr(uint32_t arg) { LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(arg & ~1); - int64_t ret_val = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv); return ret_val; } @@ -10759,13 +10772,13 @@ uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone" LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)(orig & ~1); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_new"))) TS_C2Tuple_BlockHashChannelMonitorZ_new(int8_tArray a, uint32_t b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKChannelMonitor b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); @@ -10773,12 +10786,12 @@ uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_new")) b_conv = ChannelMonitor_clone(&b_conv); LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_free"))) TS_C2Tuple_BlockHashChannelMonitorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr); FREE((void*)_res); @@ -10786,13 +10799,13 @@ void __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_free"))) T } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr); - o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)(((uintptr_t)o) & ~1)); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(uint32_t e) { @@ -10803,7 +10816,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitor e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(uint32_t o) { @@ -10814,7 +10827,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitor void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10824,11 +10837,11 @@ void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDec static inline uintptr_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10836,7 +10849,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitor LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(orig & ~1); LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_CResult_RouteHopDecodeErrorZ_ok(uint32_t o) { @@ -10847,7 +10860,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_ o_conv = RouteHop_clone(&o_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS_CResult_RouteHopDecodeErrorZ_err(uint32_t e) { @@ -10858,7 +10871,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHopDecodeErrorZ_is_ok(uint32_t o) { @@ -10869,7 +10882,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_free"))) TS_CResult_RouteHopDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10879,11 +10892,11 @@ void __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_free"))) TS_CR static inline uintptr_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10891,7 +10904,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone"))) LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_RouteHopZ_free"))) TS_CVec_RouteHopZ_free(uint32_tArray _res) { @@ -10901,7 +10914,7 @@ void __attribute__((export_name("TS_CVec_RouteHopZ_free"))) TS_CVec_RouteHopZ_f _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t k = 0; k < _res_constr.datalen; k++) { uint32_t _res_conv_10 = _res_vals[k]; LDKRouteHop _res_conv_10_conv; @@ -10920,7 +10933,7 @@ void __attribute__((export_name("TS_CVec_CVec_RouteHopZZ_free"))) TS_CVec_CVec_ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements"); else _res_constr.data = NULL; - uint32_tArray* _res_vals = (void*) _res->elems; + uint32_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { uint32_tArray _res_conv_12 = _res_vals[m]; LDKCVec_RouteHopZ _res_conv_12_constr; @@ -10929,7 +10942,7 @@ void __attribute__((export_name("TS_CVec_CVec_RouteHopZZ_free"))) TS_CVec_CVec_ _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else _res_conv_12_constr.data = NULL; - uint32_t* _res_conv_12_vals = _res_conv_12->elems; + uint32_t* _res_conv_12_vals = _res_conv_12->elems /* XXX _res_conv_12 leaks */; for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) { uint32_t _res_conv_12_conv_10 = _res_conv_12_vals[k]; LDKRouteHop _res_conv_12_conv_10_conv; @@ -10951,7 +10964,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_ok"))) TS_CRe o_conv = Route_clone(&o_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_err"))) TS_CResult_RouteDecodeErrorZ_err(uint32_t e) { @@ -10962,7 +10975,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_err"))) TS_CR e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_is_ok"))) TS_CResult_RouteDecodeErrorZ_is_ok(uint32_t o) { @@ -10973,7 +10986,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_is_ok"))) TS_ void __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_free"))) TS_CResult_RouteDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -10983,11 +10996,11 @@ void __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_free"))) TS_CResu static inline uintptr_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone_ptr"))) TS_CResult_RouteDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone_ptr"))) TS_CResult_RouteDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -10995,7 +11008,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone"))) TS_ LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)(orig & ~1); LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = CResult_RouteDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_ok"))) TS_CResult_RouteParametersDecodeErrorZ_ok(uint32_t o) { @@ -11006,7 +11019,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_ok" o_conv = RouteParameters_clone(&o_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_err"))) TS_CResult_RouteParametersDecodeErrorZ_err(uint32_t e) { @@ -11017,7 +11030,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_err e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_is_ok"))) TS_CResult_RouteParametersDecodeErrorZ_is_ok(uint32_t o) { @@ -11028,7 +11041,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_is_ void __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_free"))) TS_CResult_RouteParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11038,11 +11051,11 @@ void __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_free")) static inline uintptr_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone_ptr"))) TS_CResult_RouteParametersDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone_ptr"))) TS_CResult_RouteParametersDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11050,7 +11063,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clo LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)(orig & ~1); LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ_free(uint32_tArray _res) { @@ -11060,7 +11073,7 @@ void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t l = 0; l < _res_constr.datalen; l++) { uint32_t _res_conv_11 = _res_vals[l]; LDKRouteHint _res_conv_11_conv; @@ -11075,20 +11088,20 @@ void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ uint32_t __attribute__((export_name("TS_COption_u64Z_some"))) TS_COption_u64Z_some(int64_t o) { LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = COption_u64Z_some(o); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_u64Z_none"))) TS_COption_u64Z_none() { LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = COption_u64Z_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_u64Z_free"))) TS_COption_u64Z_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr); FREE((void*)_res); @@ -11098,12 +11111,12 @@ void __attribute__((export_name("TS_COption_u64Z_free"))) TS_COption_u64Z_free( static inline uintptr_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) { LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = COption_u64Z_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_u64Z_clone_ptr"))) TS_COption_u64Z_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_u64Z_clone_ptr"))) TS_COption_u64Z_clone_ptr(uint32_t arg) { LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)arg; - int64_t ret_val = COption_u64Z_clone_ptr(arg_conv); + intptr_t ret_val = COption_u64Z_clone_ptr(arg_conv); return ret_val; } @@ -11111,7 +11124,7 @@ uint32_t __attribute__((export_name("TS_COption_u64Z_clone"))) TS_COption_u64Z_ LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)orig; LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = COption_u64Z_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -11123,7 +11136,7 @@ uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_ok"))) TS_CRe o_conv = Payee_clone(&o_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_err"))) TS_CResult_PayeeDecodeErrorZ_err(uint32_t e) { @@ -11134,7 +11147,7 @@ uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_err"))) TS_CR e_conv = DecodeError_clone(&e_conv); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_is_ok"))) TS_CResult_PayeeDecodeErrorZ_is_ok(uint32_t o) { @@ -11145,7 +11158,7 @@ jboolean __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_is_ok"))) TS_ void __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_free"))) TS_CResult_PayeeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PayeeDecodeErrorZ _res_conv = *(LDKCResult_PayeeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11155,11 +11168,11 @@ void __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_free"))) TS_CResu static inline uintptr_t CResult_PayeeDecodeErrorZ_clone_ptr(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_clone_ptr"))) TS_CResult_PayeeDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_clone_ptr"))) TS_CResult_PayeeDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PayeeDecodeErrorZ* arg_conv = (LDKCResult_PayeeDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PayeeDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PayeeDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11167,7 +11180,7 @@ uint32_t __attribute__((export_name("TS_CResult_PayeeDecodeErrorZ_clone"))) TS_ LDKCResult_PayeeDecodeErrorZ* orig_conv = (LDKCResult_PayeeDecodeErrorZ*)(orig & ~1); LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = CResult_PayeeDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_RouteHintHopZ_free"))) TS_CVec_RouteHintHopZ_free(uint32_tArray _res) { @@ -11177,7 +11190,7 @@ void __attribute__((export_name("TS_CVec_RouteHintHopZ_free"))) TS_CVec_RouteHi _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t o = 0; o < _res_constr.datalen; o++) { uint32_t _res_conv_14 = _res_vals[o]; LDKRouteHintHop _res_conv_14_conv; @@ -11197,7 +11210,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_ok"))) TS o_conv = RouteHint_clone(&o_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_err"))) TS_CResult_RouteHintDecodeErrorZ_err(uint32_t e) { @@ -11208,7 +11221,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_err"))) T e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_is_ok"))) TS_CResult_RouteHintDecodeErrorZ_is_ok(uint32_t o) { @@ -11219,7 +11232,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_free"))) TS_CResult_RouteHintDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11229,11 +11242,11 @@ void __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_free"))) TS_C static inline uintptr_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11241,7 +11254,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone"))) LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_ok(uint32_t o) { @@ -11252,7 +11265,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_ok"))) o_conv = RouteHintHop_clone(&o_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_err"))) TS_CResult_RouteHintHopDecodeErrorZ_err(uint32_t e) { @@ -11263,7 +11276,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_is_ok(uint32_t o) { @@ -11274,7 +11287,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_free"))) TS_CResult_RouteHintHopDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11284,11 +11297,11 @@ void __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_free"))) T static inline uintptr_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11296,7 +11309,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone" LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)(orig & ~1); LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_ChannelDetailsZ_free(uint32_tArray _res) { @@ -11306,7 +11319,7 @@ void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_Chann _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t q = 0; q < _res_constr.datalen; q++) { uint32_t _res_conv_16 = _res_vals[q]; LDKChannelDetails _res_conv_16_conv; @@ -11326,7 +11339,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_ok"))) TS_ o_conv = Route_clone(&o_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_err"))) TS_CResult_RouteLightningErrorZ_err(uint32_t e) { @@ -11337,7 +11350,7 @@ uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_err"))) TS e_conv = LightningError_clone(&e_conv); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RouteLightningErrorZ_is_ok"))) TS_CResult_RouteLightningErrorZ_is_ok(uint32_t o) { @@ -11348,7 +11361,7 @@ jboolean __attribute__((export_name("TS_CResult_RouteLightningErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_RouteLightningErrorZ_free"))) TS_CResult_RouteLightningErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11358,11 +11371,11 @@ void __attribute__((export_name("TS_CResult_RouteLightningErrorZ_free"))) TS_CR static inline uintptr_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) { LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone_ptr"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone_ptr"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11370,13 +11383,13 @@ uint32_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone"))) LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)(orig & ~1); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_ok"))) TS_CResult_NoneLightningErrorZ_ok() { LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_err"))) TS_CResult_NoneLightningErrorZ_err(uint32_t e) { @@ -11387,7 +11400,7 @@ uint32_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_err"))) TS_ e_conv = LightningError_clone(&e_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NoneLightningErrorZ_is_ok"))) TS_CResult_NoneLightningErrorZ_is_ok(uint32_t o) { @@ -11398,7 +11411,7 @@ jboolean __attribute__((export_name("TS_CResult_NoneLightningErrorZ_is_ok"))) T void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_free"))) TS_CResult_NoneLightningErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11408,11 +11421,11 @@ void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_free"))) TS_CRe static inline uintptr_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) { LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone_ptr"))) TS_CResult_NoneLightningErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone_ptr"))) TS_CResult_NoneLightningErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NoneLightningErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11420,17 +11433,17 @@ uint32_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone"))) T LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)(orig & ~1); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } static inline uintptr_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) { LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone_ptr"))) TS_C2Tuple_PublicKeyTypeZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone_ptr"))) TS_C2Tuple_PublicKeyTypeZ_clone_ptr(uint32_t arg) { LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)(arg & ~1); - int64_t ret_val = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv); return ret_val; } @@ -11438,24 +11451,24 @@ uint32_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone"))) TS_C2T LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)(orig & ~1); LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_new"))) TS_C2Tuple_PublicKeyTypeZ_new(int8_tArray a, uint32_t b) { LDKPublicKey a_ref; CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); - void* b_ptr = (void*)(((uint64_t)b) & ~1); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + void* b_ptr = (void*)(((uintptr_t)b) & ~1); CHECK_ACCESS(b_ptr); LDKType b_conv = *(LDKType*)(b_ptr); LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ"); *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_free"))) TS_C2Tuple_PublicKeyTypeZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr); FREE((void*)_res); @@ -11469,10 +11482,10 @@ void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyTypeZZ_free"))) TS_CV _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t z = 0; z < _res_constr.datalen; z++) { uint32_t _res_conv_25 = _res_vals[z]; - void* _res_conv_25_ptr = (void*)(((uint64_t)_res_conv_25) & ~1); + void* _res_conv_25_ptr = (void*)(((uintptr_t)_res_conv_25) & ~1); CHECK_ACCESS(_res_conv_25_ptr); LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr); FREE((void*)_res_conv_25); @@ -11488,10 +11501,10 @@ void __attribute__((export_name("TS_CVec_MessageSendEventZ_free"))) TS_CVec_Mes _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t s = 0; s < _res_constr.datalen; s++) { uint32_t _res_conv_18 = _res_vals[s]; - void* _res_conv_18_ptr = (void*)(((uint64_t)_res_conv_18) & ~1); + void* _res_conv_18_ptr = (void*)(((uintptr_t)_res_conv_18) & ~1); CHECK_ACCESS(_res_conv_18_ptr); LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr); FREE((void*)_res_conv_18); @@ -11503,7 +11516,7 @@ void __attribute__((export_name("TS_CVec_MessageSendEventZ_free"))) TS_CVec_Mes uint32_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_ok"))) TS_CResult_boolLightningErrorZ_ok(jboolean o) { LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_ok(o); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_err"))) TS_CResult_boolLightningErrorZ_err(uint32_t e) { @@ -11514,7 +11527,7 @@ uint32_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_err"))) TS_ e_conv = LightningError_clone(&e_conv); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_is_ok"))) TS_CResult_boolLightningErrorZ_is_ok(uint32_t o) { @@ -11525,7 +11538,7 @@ jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_is_ok"))) T void __attribute__((export_name("TS_CResult_boolLightningErrorZ_free"))) TS_CResult_boolLightningErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11535,11 +11548,11 @@ void __attribute__((export_name("TS_CResult_boolLightningErrorZ_free"))) TS_CRe static inline uintptr_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) { LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone_ptr"))) TS_CResult_boolLightningErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone_ptr"))) TS_CResult_boolLightningErrorZ_clone_ptr(uint32_t arg) { LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)(arg & ~1); - int64_t ret_val = CResult_boolLightningErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_boolLightningErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11547,17 +11560,17 @@ uint32_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone"))) T LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)(orig & ~1); LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ"); *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } static inline uintptr_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(uint32_t arg) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(arg & ~1); - int64_t ret_val = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); + intptr_t ret_val = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv); return ret_val; } @@ -11565,7 +11578,7 @@ uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdat LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(orig & ~1); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(uint32_t a, uint32_t b, uint32_t c) { @@ -11586,12 +11599,12 @@ uint32_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdat c_conv = ChannelUpdate_clone(&c_conv); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr); FREE((void*)_res); @@ -11605,10 +11618,10 @@ void __attribute__((export_name("TS_CVec_C3Tuple_ChannelAnnouncementChannelUpda _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t h = 0; h < _res_constr.datalen; h++) { uint32_t _res_conv_59 = _res_vals[h]; - void* _res_conv_59_ptr = (void*)(((uint64_t)_res_conv_59) & ~1); + void* _res_conv_59_ptr = (void*)(((uintptr_t)_res_conv_59) & ~1); CHECK_ACCESS(_res_conv_59_ptr); LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr); FREE((void*)_res_conv_59); @@ -11624,7 +11637,7 @@ void __attribute__((export_name("TS_CVec_NodeAnnouncementZ_free"))) TS_CVec_Nod _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t s = 0; s < _res_constr.datalen; s++) { uint32_t _res_conv_18 = _res_vals[s]; LDKNodeAnnouncement _res_conv_18_conv; @@ -11643,12 +11656,12 @@ void __attribute__((export_name("TS_CVec_PublicKeyZ_free"))) TS_CVec_PublicKeyZ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); else _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; + int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { int8_tArray _res_conv_12 = _res_vals[m]; LDKPublicKey _res_conv_12_ref; CHECK(_res_conv_12->arr_len == 33); - memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); + memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); FREE(_res_conv_12); _res_constr.data[m] = _res_conv_12_ref; } CVec_PublicKeyZ_free(_res_constr); @@ -11658,7 +11671,7 @@ void __attribute__((export_name("TS_CVec_u8Z_free"))) TS_CVec_u8Z_free(int8_tAr LDKCVec_u8Z _res_ref; _res_ref.datalen = _res->arr_len; _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(_res_ref.data, _res->elems, _res_ref.datalen); + memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res); CVec_u8Z_free(_res_ref); } @@ -11666,10 +11679,10 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_ok"))) LDKCVec_u8Z o_ref; o_ref.datalen = o->arr_len; o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(o_ref.data, o->elems, o_ref.datalen); + memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_err(uint32_t e) { @@ -11680,7 +11693,7 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_err")) e_conv = PeerHandleError_clone(&e_conv); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok(uint32_t o) { @@ -11691,7 +11704,7 @@ jboolean __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok" void __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_free"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11701,11 +11714,11 @@ void __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_free"))) T static inline uintptr_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) { LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint32_t arg) { LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(arg & ~1); - int64_t ret_val = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11713,13 +11726,13 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone" LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)(orig & ~1); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_ok"))) TS_CResult_NonePeerHandleErrorZ_ok() { LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_err"))) TS_CResult_NonePeerHandleErrorZ_err(uint32_t e) { @@ -11730,7 +11743,7 @@ uint32_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_err"))) TS e_conv = PeerHandleError_clone(&e_conv); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_is_ok"))) TS_CResult_NonePeerHandleErrorZ_is_ok(uint32_t o) { @@ -11741,7 +11754,7 @@ jboolean __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_free"))) TS_CResult_NonePeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11751,11 +11764,11 @@ void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_free"))) TS_CR static inline uintptr_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) { LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone_ptr"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone_ptr"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11763,13 +11776,13 @@ uint32_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone"))) LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)(orig & ~1); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_ok"))) TS_CResult_boolPeerHandleErrorZ_ok(jboolean o) { LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_ok(o); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_err"))) TS_CResult_boolPeerHandleErrorZ_err(uint32_t e) { @@ -11780,7 +11793,7 @@ uint32_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_err"))) TS e_conv = PeerHandleError_clone(&e_conv); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_is_ok"))) TS_CResult_boolPeerHandleErrorZ_is_ok(uint32_t o) { @@ -11791,7 +11804,7 @@ jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_free"))) TS_CResult_boolPeerHandleErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11801,11 +11814,11 @@ void __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_free"))) TS_CR static inline uintptr_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) { LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone_ptr"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone_ptr"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint32_t arg) { LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)(arg & ~1); - int64_t ret_val = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11813,24 +11826,24 @@ uint32_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone"))) LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)(orig & ~1); LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_ok"))) TS_CResult_TxOutAccessErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); - o_conv = TxOut_clone((LDKTxOut*)(((uint64_t)o) & ~1)); + o_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)o) & ~1)); LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_err"))) TS_CResult_TxOutAccessErrorZ_err(uint32_t e) { LDKAccessError e_conv = LDKAccessError_from_js(e); LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_is_ok"))) TS_CResult_TxOutAccessErrorZ_is_ok(uint32_t o) { @@ -11841,7 +11854,7 @@ jboolean __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_is_ok"))) TS_ void __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_free"))) TS_CResult_TxOutAccessErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr); FREE((void*)_res); @@ -11851,11 +11864,11 @@ void __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_free"))) TS_CResu static inline uintptr_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) { LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); *ret_conv = CResult_TxOutAccessErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone_ptr"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone_ptr"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint32_t arg) { LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)(arg & ~1); - int64_t ret_val = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -11863,20 +11876,20 @@ uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone"))) TS_ LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)(orig & ~1); LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ"); *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_ok() { LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_err(uint32_t e) { LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_js(e); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok(uint32_t o) { @@ -11887,7 +11900,7 @@ jboolean __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_is void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_free"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr); FREE((void*)_res); @@ -11897,11 +11910,11 @@ void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_free") static inline uintptr_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) { LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint32_t arg) { LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(arg & ~1); - int64_t ret_val = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv); return ret_val; } @@ -11909,30 +11922,30 @@ uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_cl LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(orig & ~1); LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ"); *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_some"))) TS_COption_C2Tuple_usizeTransactionZZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr); - o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)o) & ~1)); LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_none"))) TS_COption_C2Tuple_usizeTransactionZZ_none() { LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = COption_C2Tuple_usizeTransactionZZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_free"))) TS_COption_C2Tuple_usizeTransactionZZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr); FREE((void*)_res); @@ -11942,12 +11955,12 @@ void __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_free"))) static inline uintptr_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) { LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr"))) TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr"))) TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr(uint32_t arg) { LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)arg; - int64_t ret_val = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv); return ret_val; } @@ -11955,31 +11968,31 @@ uint32_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clon LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)orig; LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ"); *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_ClosureReasonZ_some"))) TS_COption_ClosureReasonZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr); - o_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)o) & ~1)); + o_conv = ClosureReason_clone((LDKClosureReason*)(((uintptr_t)o) & ~1)); LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); *ret_copy = COption_ClosureReasonZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_ClosureReasonZ_none"))) TS_COption_ClosureReasonZ_none() { LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); *ret_copy = COption_ClosureReasonZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ClosureReasonZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); FREE((void*)_res); @@ -11989,12 +12002,12 @@ void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ static inline uintptr_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) { LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); *ret_copy = COption_ClosureReasonZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone_ptr"))) TS_COption_ClosureReasonZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone_ptr"))) TS_COption_ClosureReasonZ_clone_ptr(uint32_t arg) { LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)arg; - int64_t ret_val = COption_ClosureReasonZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_ClosureReasonZ_clone_ptr(arg_conv); return ret_val; } @@ -12002,18 +12015,18 @@ uint32_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone"))) TS_COp LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)orig; LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ"); *ret_copy = COption_ClosureReasonZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr); - o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)(((uint64_t)o) & ~1)); + o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)(((uintptr_t)o) & ~1)); LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint32_t e) { @@ -12024,7 +12037,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErr e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(uint32_t o) { @@ -12035,7 +12048,7 @@ jboolean __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErr void __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_free"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12045,11 +12058,11 @@ void __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_ static inline uintptr_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12057,30 +12070,30 @@ uint32_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErr LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_NetworkUpdateZ_some"))) TS_COption_NetworkUpdateZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr); - o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)(((uint64_t)o) & ~1)); + o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)(((uintptr_t)o) & ~1)); LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); *ret_copy = COption_NetworkUpdateZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_NetworkUpdateZ_none"))) TS_COption_NetworkUpdateZ_none() { LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); *ret_copy = COption_NetworkUpdateZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_NetworkUpdateZ_free"))) TS_COption_NetworkUpdateZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr); FREE((void*)_res); @@ -12090,12 +12103,12 @@ void __attribute__((export_name("TS_COption_NetworkUpdateZ_free"))) TS_COption_ static inline uintptr_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) { LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); *ret_copy = COption_NetworkUpdateZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone_ptr"))) TS_COption_NetworkUpdateZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone_ptr"))) TS_COption_NetworkUpdateZ_clone_ptr(uint32_t arg) { LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)arg; - int64_t ret_val = COption_NetworkUpdateZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_NetworkUpdateZ_clone_ptr(arg_conv); return ret_val; } @@ -12103,7 +12116,7 @@ uint32_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone"))) TS_COp LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)orig; LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ"); *ret_copy = COption_NetworkUpdateZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -12114,10 +12127,10 @@ void __attribute__((export_name("TS_CVec_SpendableOutputDescriptorZ_free"))) TS _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t b = 0; b < _res_constr.datalen; b++) { uint32_t _res_conv_27 = _res_vals[b]; - void* _res_conv_27_ptr = (void*)(((uint64_t)_res_conv_27) & ~1); + void* _res_conv_27_ptr = (void*)(((uintptr_t)_res_conv_27) & ~1); CHECK_ACCESS(_res_conv_27_ptr); LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr); FREE((void*)_res_conv_27); @@ -12127,26 +12140,26 @@ void __attribute__((export_name("TS_CVec_SpendableOutputDescriptorZ_free"))) TS } uint32_t __attribute__((export_name("TS_COption_EventZ_some"))) TS_COption_EventZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKEvent o_conv = *(LDKEvent*)(o_ptr); - o_conv = Event_clone((LDKEvent*)(((uint64_t)o) & ~1)); + o_conv = Event_clone((LDKEvent*)(((uintptr_t)o) & ~1)); LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); *ret_copy = COption_EventZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_EventZ_none"))) TS_COption_EventZ_none() { LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); *ret_copy = COption_EventZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); FREE((void*)_res); @@ -12156,12 +12169,12 @@ void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_f static inline uintptr_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) { LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); *ret_copy = COption_EventZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_EventZ_clone_ptr"))) TS_COption_EventZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_EventZ_clone_ptr"))) TS_COption_EventZ_clone_ptr(uint32_t arg) { LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)arg; - int64_t ret_val = COption_EventZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_EventZ_clone_ptr(arg_conv); return ret_val; } @@ -12169,18 +12182,18 @@ uint32_t __attribute__((export_name("TS_COption_EventZ_clone"))) TS_COption_Eve LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)orig; LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ"); *ret_copy = COption_EventZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_ok"))) TS_CResult_COption_EventZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr); - o_conv = COption_EventZ_clone((LDKCOption_EventZ*)(((uint64_t)o) & ~1)); + o_conv = COption_EventZ_clone((LDKCOption_EventZ*)(((uintptr_t)o) & ~1)); LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint32_t e) { @@ -12191,7 +12204,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_is_ok"))) TS_CResult_COption_EventZDecodeErrorZ_is_ok(uint32_t o) { @@ -12202,7 +12215,7 @@ jboolean __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_free"))) TS_CResult_COption_EventZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12212,11 +12225,11 @@ void __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_free"))) static inline uintptr_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12224,7 +12237,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clon LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_ok"))) TS_CResult_NodeIdDecodeErrorZ_ok(uint32_t o) { @@ -12235,7 +12248,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_ok"))) TS_CR o_conv = NodeId_clone(&o_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_CResult_NodeIdDecodeErrorZ_err(uint32_t e) { @@ -12246,7 +12259,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_C e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_is_ok"))) TS_CResult_NodeIdDecodeErrorZ_is_ok(uint32_t o) { @@ -12257,7 +12270,7 @@ jboolean __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_is_ok"))) TS void __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_free"))) TS_CResult_NodeIdDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12267,11 +12280,11 @@ void __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_free"))) TS_CRes static inline uintptr_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone_ptr"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone_ptr"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12279,17 +12292,17 @@ uint32_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone"))) TS LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)(orig & ~1); LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr); - o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)o) & ~1)); + o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uintptr_t)o) & ~1)); LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err(uint32_t e) { @@ -12300,7 +12313,7 @@ uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErr e_conv = DecodeError_clone(&e_conv); LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(uint32_t o) { @@ -12311,7 +12324,7 @@ jboolean __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErr void __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12321,11 +12334,11 @@ void __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ static inline uintptr_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12333,29 +12346,29 @@ uint32_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErr LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(orig & ~1); LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_AccessZ_some"))) TS_COption_AccessZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKAccess o_conv = *(LDKAccess*)(o_ptr); LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); *ret_copy = COption_AccessZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_AccessZ_none"))) TS_COption_AccessZ_none() { LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ"); *ret_copy = COption_AccessZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_AccessZ_free"))) TS_COption_AccessZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr); FREE((void*)_res); @@ -12370,7 +12383,7 @@ uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErr o_conv = DirectionalChannelInfo_clone(&o_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_err"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_err(uint32_t e) { @@ -12381,7 +12394,7 @@ uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErr e_conv = DecodeError_clone(&e_conv); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_is_ok"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(uint32_t o) { @@ -12392,7 +12405,7 @@ jboolean __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErr void __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_free"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_DirectionalChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12402,11 +12415,11 @@ void __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_ static inline uintptr_t CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_DirectionalChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12414,7 +12427,7 @@ uint32_t __attribute__((export_name("TS_CResult_DirectionalChannelInfoDecodeErr LDKCResult_DirectionalChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_DirectionalChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = CResult_DirectionalChannelInfoDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_ok(uint32_t o) { @@ -12425,7 +12438,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_ok"))) o_conv = ChannelInfo_clone(&o_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_err"))) TS_CResult_ChannelInfoDecodeErrorZ_err(uint32_t e) { @@ -12436,7 +12449,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_err"))) e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_is_ok(uint32_t o) { @@ -12447,7 +12460,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_is_ok") void __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_free"))) TS_CResult_ChannelInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12457,11 +12470,11 @@ void __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_free"))) TS static inline uintptr_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12469,7 +12482,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone") LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_ok(uint32_t o) { @@ -12480,7 +12493,7 @@ uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_ok"))) o_conv = RoutingFees_clone(&o_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_err"))) TS_CResult_RoutingFeesDecodeErrorZ_err(uint32_t e) { @@ -12491,7 +12504,7 @@ uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_err"))) e_conv = DecodeError_clone(&e_conv); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_is_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_is_ok(uint32_t o) { @@ -12502,7 +12515,7 @@ jboolean __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_is_ok") void __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_free"))) TS_CResult_RoutingFeesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12512,11 +12525,11 @@ void __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_free"))) TS static inline uintptr_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr"))) TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr"))) TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12524,7 +12537,7 @@ uint32_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone") LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)(orig & ~1); LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_NetAddressZ_free"))) TS_CVec_NetAddressZ_free(uint32_tArray _res) { @@ -12534,10 +12547,10 @@ void __attribute__((export_name("TS_CVec_NetAddressZ_free"))) TS_CVec_NetAddres _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { uint32_t _res_conv_12 = _res_vals[m]; - void* _res_conv_12_ptr = (void*)(((uint64_t)_res_conv_12) & ~1); + void* _res_conv_12_ptr = (void*)(((uintptr_t)_res_conv_12) & ~1); CHECK_ACCESS(_res_conv_12_ptr); LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr); FREE((void*)_res_conv_12); @@ -12554,7 +12567,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeError o_conv = NodeAnnouncementInfo_clone(&o_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err(uint32_t e) { @@ -12565,7 +12578,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeError e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(uint32_t o) { @@ -12576,7 +12589,7 @@ jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeError void __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12586,11 +12599,11 @@ void __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_fr static inline uintptr_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12598,7 +12611,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeError LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_u64Z_free"))) TS_CVec_u64Z_free(int64_tArray _res) { @@ -12608,7 +12621,7 @@ void __attribute__((export_name("TS_CVec_u64Z_free"))) TS_CVec_u64Z_free(int64_ _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else _res_constr.data = NULL; - int64_t* _res_vals = _res->elems; + int64_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t i = 0; i < _res_constr.datalen; i++) { int64_t _res_conv_8 = _res_vals[i]; _res_constr.data[i] = _res_conv_8; @@ -12624,7 +12637,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_ok"))) TS_ o_conv = NodeInfo_clone(&o_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_err"))) TS_CResult_NodeInfoDecodeErrorZ_err(uint32_t e) { @@ -12635,7 +12648,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_err"))) TS e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeInfoDecodeErrorZ_is_ok(uint32_t o) { @@ -12646,7 +12659,7 @@ jboolean __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_free"))) TS_CResult_NodeInfoDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12656,11 +12669,11 @@ void __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_free"))) TS_CR static inline uintptr_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeInfoDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeInfoDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12668,7 +12681,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone"))) LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)(orig & ~1); LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_ok(uint32_t o) { @@ -12679,7 +12692,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_ok"))) o_conv = NetworkGraph_clone(&o_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_err"))) TS_CResult_NetworkGraphDecodeErrorZ_err(uint32_t e) { @@ -12690,7 +12703,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_is_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_is_ok(uint32_t o) { @@ -12701,7 +12714,7 @@ jboolean __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_free"))) TS_CResult_NetworkGraphDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12711,11 +12724,11 @@ void __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_free"))) T static inline uintptr_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_clone_ptr"))) TS_CResult_NetworkGraphDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_clone_ptr"))) TS_CResult_NetworkGraphDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NetworkGraphDecodeErrorZ* arg_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -12723,7 +12736,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_clone" LDKCResult_NetworkGraphDecodeErrorZ* orig_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)(orig & ~1); LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = CResult_NetworkGraphDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_some"))) TS_COption_CVec_NetAddressZZ_some(uint32_tArray o) { @@ -12733,31 +12746,31 @@ uint32_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_some"))) TS_C o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else o_constr.data = NULL; - uint32_t* o_vals = o->elems; + uint32_t* o_vals = o->elems /* XXX o leaks */; for (size_t m = 0; m < o_constr.datalen; m++) { uint32_t o_conv_12 = o_vals[m]; - void* o_conv_12_ptr = (void*)(((uint64_t)o_conv_12) & ~1); + void* o_conv_12_ptr = (void*)(((uintptr_t)o_conv_12) & ~1); CHECK_ACCESS(o_conv_12_ptr); LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr); - o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o_conv_12) & ~1)); + o_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o_conv_12) & ~1)); o_constr.data[m] = o_conv_12_conv; } LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); *ret_copy = COption_CVec_NetAddressZZ_some(o_constr); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_none"))) TS_COption_CVec_NetAddressZZ_none() { LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); *ret_copy = COption_CVec_NetAddressZZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_CVec_NetAddressZZ_free"))) TS_COption_CVec_NetAddressZZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr); FREE((void*)_res); @@ -12767,12 +12780,12 @@ void __attribute__((export_name("TS_COption_CVec_NetAddressZZ_free"))) TS_COpti static inline uintptr_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) { LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); *ret_copy = COption_CVec_NetAddressZZ_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone_ptr"))) TS_COption_CVec_NetAddressZZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone_ptr"))) TS_COption_CVec_NetAddressZZ_clone_ptr(uint32_t arg) { LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)arg; - int64_t ret_val = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); + intptr_t ret_val = COption_CVec_NetAddressZZ_clone_ptr(arg_conv); return ret_val; } @@ -12780,7 +12793,7 @@ uint32_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone"))) TS_ LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)orig; LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -12792,7 +12805,7 @@ uint32_t __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_o // Warning: we need a move here but no clone is available for LDKScoringParameters LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_err"))) TS_CResult_ScoringParametersDecodeErrorZ_err(uint32_t e) { @@ -12803,7 +12816,7 @@ uint32_t __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_e e_conv = DecodeError_clone(&e_conv); LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = CResult_ScoringParametersDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_is_ok"))) TS_CResult_ScoringParametersDecodeErrorZ_is_ok(uint32_t o) { @@ -12814,7 +12827,7 @@ jboolean __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_i void __attribute__((export_name("TS_CResult_ScoringParametersDecodeErrorZ_free"))) TS_CResult_ScoringParametersDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ScoringParametersDecodeErrorZ _res_conv = *(LDKCResult_ScoringParametersDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12829,7 +12842,7 @@ uint32_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_ok"))) o_conv = InitFeatures_clone(&o_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint32_t e) { @@ -12840,7 +12853,7 @@ uint32_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -12851,7 +12864,7 @@ jboolean __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_free"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12866,7 +12879,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_ok" o_conv = ChannelFeatures_clone(&o_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_err(uint32_t e) { @@ -12877,7 +12890,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -12888,7 +12901,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_is_ void __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12903,7 +12916,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_ok"))) o_conv = NodeFeatures_clone(&o_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint32_t e) { @@ -12914,7 +12927,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -12925,7 +12938,7 @@ jboolean __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_free"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12940,7 +12953,7 @@ uint32_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_ok" o_conv = InvoiceFeatures_clone(&o_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint32_t e) { @@ -12951,7 +12964,7 @@ uint32_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err e_conv = DecodeError_clone(&e_conv); LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -12962,7 +12975,7 @@ jboolean __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ void __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_free"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -12977,7 +12990,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ o_conv = ChannelTypeFeatures_clone(&o_conv); LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err(uint32_t e) { @@ -12988,7 +13001,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -12999,7 +13012,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ void __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13007,13 +13020,13 @@ void __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_fre } uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_ok"))) TS_CResult_NetAddressDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr); - o_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)o) & ~1)); + o_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)o) & ~1)); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) TS_CResult_NetAddressDecodeErrorZ_err(uint32_t e) { @@ -13024,7 +13037,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) e_conv = DecodeError_clone(&e_conv); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_is_ok"))) TS_CResult_NetAddressDecodeErrorZ_is_ok(uint32_t o) { @@ -13035,7 +13048,7 @@ jboolean __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_is_ok")) void __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_free"))) TS_CResult_NetAddressDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13045,11 +13058,11 @@ void __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_free"))) TS_ static inline uintptr_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone_ptr"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone_ptr"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13057,7 +13070,7 @@ uint32_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone")) LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)(orig & ~1); LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_UpdateAddHTLCZ_free"))) TS_CVec_UpdateAddHTLCZ_free(uint32_tArray _res) { @@ -13067,7 +13080,7 @@ void __attribute__((export_name("TS_CVec_UpdateAddHTLCZ_free"))) TS_CVec_Update _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t p = 0; p < _res_constr.datalen; p++) { uint32_t _res_conv_15 = _res_vals[p]; LDKUpdateAddHTLC _res_conv_15_conv; @@ -13086,7 +13099,7 @@ void __attribute__((export_name("TS_CVec_UpdateFulfillHTLCZ_free"))) TS_CVec_Up _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t t = 0; t < _res_constr.datalen; t++) { uint32_t _res_conv_19 = _res_vals[t]; LDKUpdateFulfillHTLC _res_conv_19_conv; @@ -13105,7 +13118,7 @@ void __attribute__((export_name("TS_CVec_UpdateFailHTLCZ_free"))) TS_CVec_Updat _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t q = 0; q < _res_constr.datalen; q++) { uint32_t _res_conv_16 = _res_vals[q]; LDKUpdateFailHTLC _res_conv_16_conv; @@ -13124,7 +13137,7 @@ void __attribute__((export_name("TS_CVec_UpdateFailMalformedHTLCZ_free"))) TS_C _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t z = 0; z < _res_constr.datalen; z++) { uint32_t _res_conv_25 = _res_vals[z]; LDKUpdateFailMalformedHTLC _res_conv_25_conv; @@ -13144,7 +13157,7 @@ uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_ok")) o_conv = AcceptChannel_clone(&o_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err"))) TS_CResult_AcceptChannelDecodeErrorZ_err(uint32_t e) { @@ -13155,7 +13168,7 @@ uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_is_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_is_ok(uint32_t o) { @@ -13166,7 +13179,7 @@ jboolean __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_free"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13176,11 +13189,11 @@ void __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_free"))) static inline uintptr_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13188,7 +13201,7 @@ uint32_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)(orig & ~1); LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok(uint32_t o) { @@ -13199,7 +13212,7 @@ uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErr o_conv = AnnouncementSignatures_clone(&o_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_err(uint32_t e) { @@ -13210,7 +13223,7 @@ uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErr e_conv = DecodeError_clone(&e_conv); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(uint32_t o) { @@ -13221,7 +13234,7 @@ jboolean __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErr void __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_free"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13231,11 +13244,11 @@ void __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_ static inline uintptr_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13243,7 +13256,7 @@ uint32_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErr LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(orig & ~1); LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_ok(uint32_t o) { @@ -13254,7 +13267,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ o_conv = ChannelReestablish_clone(&o_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_err(uint32_t e) { @@ -13265,7 +13278,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_is_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_is_ok(uint32_t o) { @@ -13276,7 +13289,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ void __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_free"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13286,11 +13299,11 @@ void __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_free static inline uintptr_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13298,7 +13311,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_ok(uint32_t o) { @@ -13309,7 +13322,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_ok")) o_conv = ClosingSigned_clone(&o_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err"))) TS_CResult_ClosingSignedDecodeErrorZ_err(uint32_t e) { @@ -13320,7 +13333,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_is_ok(uint32_t o) { @@ -13331,7 +13344,7 @@ jboolean __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_free"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13341,11 +13354,11 @@ void __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_free"))) static inline uintptr_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13353,7 +13366,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(uint32_t o) { @@ -13364,7 +13377,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErro o_conv = ClosingSignedFeeRange_clone(&o_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err(uint32_t e) { @@ -13375,7 +13388,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErro e_conv = DecodeError_clone(&e_conv); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(uint32_t o) { @@ -13386,7 +13399,7 @@ jboolean __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErro void __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13396,11 +13409,11 @@ void __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_f static inline uintptr_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13408,7 +13421,7 @@ uint32_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErro LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_ok(uint32_t o) { @@ -13419,7 +13432,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok o_conv = CommitmentSigned_clone(&o_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_err(uint32_t e) { @@ -13430,7 +13443,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_er e_conv = DecodeError_clone(&e_conv); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_is_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_is_ok(uint32_t o) { @@ -13441,7 +13454,7 @@ jboolean __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_is void __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_free"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13451,11 +13464,11 @@ void __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_free") static inline uintptr_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13463,7 +13476,7 @@ uint32_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_cl LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)(orig & ~1); LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_ok(uint32_t o) { @@ -13474,7 +13487,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok") o_conv = FundingCreated_clone(&o_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err"))) TS_CResult_FundingCreatedDecodeErrorZ_err(uint32_t e) { @@ -13485,7 +13498,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_is_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_is_ok(uint32_t o) { @@ -13496,7 +13509,7 @@ jboolean __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_free"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13506,11 +13519,11 @@ void __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_free"))) static inline uintptr_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13518,7 +13531,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clon LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok"))) TS_CResult_FundingSignedDecodeErrorZ_ok(uint32_t o) { @@ -13529,7 +13542,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok")) o_conv = FundingSigned_clone(&o_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err"))) TS_CResult_FundingSignedDecodeErrorZ_err(uint32_t e) { @@ -13540,7 +13553,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_is_ok"))) TS_CResult_FundingSignedDecodeErrorZ_is_ok(uint32_t o) { @@ -13551,7 +13564,7 @@ jboolean __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_free"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13561,11 +13574,11 @@ void __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_free"))) static inline uintptr_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13573,7 +13586,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_ok"))) TS_CResult_FundingLockedDecodeErrorZ_ok(uint32_t o) { @@ -13584,7 +13597,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_ok")) o_conv = FundingLocked_clone(&o_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_err"))) TS_CResult_FundingLockedDecodeErrorZ_err(uint32_t e) { @@ -13595,7 +13608,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_is_ok"))) TS_CResult_FundingLockedDecodeErrorZ_is_ok(uint32_t o) { @@ -13606,7 +13619,7 @@ jboolean __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_free"))) TS_CResult_FundingLockedDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_FundingLockedDecodeErrorZ _res_conv = *(LDKCResult_FundingLockedDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13616,11 +13629,11 @@ void __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_free"))) static inline uintptr_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingLockedDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingLockedDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_FundingLockedDecodeErrorZ* arg_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_FundingLockedDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13628,7 +13641,7 @@ uint32_t __attribute__((export_name("TS_CResult_FundingLockedDecodeErrorZ_clone LDKCResult_FundingLockedDecodeErrorZ* orig_conv = (LDKCResult_FundingLockedDecodeErrorZ*)(orig & ~1); LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = CResult_FundingLockedDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CResult_InitDecodeErrorZ_ok(uint32_t o) { @@ -13639,7 +13652,7 @@ uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CRes o_conv = Init_clone(&o_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CResult_InitDecodeErrorZ_err(uint32_t e) { @@ -13650,7 +13663,7 @@ uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CRe e_conv = DecodeError_clone(&e_conv); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_InitDecodeErrorZ_is_ok"))) TS_CResult_InitDecodeErrorZ_is_ok(uint32_t o) { @@ -13661,7 +13674,7 @@ jboolean __attribute__((export_name("TS_CResult_InitDecodeErrorZ_is_ok"))) TS_C void __attribute__((export_name("TS_CResult_InitDecodeErrorZ_free"))) TS_CResult_InitDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13671,11 +13684,11 @@ void __attribute__((export_name("TS_CResult_InitDecodeErrorZ_free"))) TS_CResul static inline uintptr_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone_ptr"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone_ptr"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_InitDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_InitDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13683,7 +13696,7 @@ uint32_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone"))) TS_C LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)(orig & ~1); LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) TS_CResult_OpenChannelDecodeErrorZ_ok(uint32_t o) { @@ -13694,7 +13707,7 @@ uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) o_conv = OpenChannel_clone(&o_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) TS_CResult_OpenChannelDecodeErrorZ_err(uint32_t e) { @@ -13705,7 +13718,7 @@ uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) e_conv = DecodeError_clone(&e_conv); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_is_ok"))) TS_CResult_OpenChannelDecodeErrorZ_is_ok(uint32_t o) { @@ -13716,7 +13729,7 @@ jboolean __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_is_ok") void __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_free"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13726,11 +13739,11 @@ void __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_free"))) TS static inline uintptr_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone_ptr"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone_ptr"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13738,7 +13751,7 @@ uint32_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone") LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)(orig & ~1); LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_ok(uint32_t o) { @@ -13749,7 +13762,7 @@ uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) o_conv = RevokeAndACK_clone(&o_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_err(uint32_t e) { @@ -13760,7 +13773,7 @@ uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_is_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_is_ok(uint32_t o) { @@ -13771,7 +13784,7 @@ jboolean __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_free"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13781,11 +13794,11 @@ void __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_free"))) T static inline uintptr_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13793,7 +13806,7 @@ uint32_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone" LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)(orig & ~1); LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_CResult_ShutdownDecodeErrorZ_ok(uint32_t o) { @@ -13804,7 +13817,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_ o_conv = Shutdown_clone(&o_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS_CResult_ShutdownDecodeErrorZ_err(uint32_t e) { @@ -13815,7 +13828,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS e_conv = DecodeError_clone(&e_conv); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_is_ok"))) TS_CResult_ShutdownDecodeErrorZ_is_ok(uint32_t o) { @@ -13826,7 +13839,7 @@ jboolean __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_free"))) TS_CResult_ShutdownDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13836,11 +13849,11 @@ void __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_free"))) TS_CR static inline uintptr_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13848,7 +13861,7 @@ uint32_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone"))) LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)(orig & ~1); LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_ok(uint32_t o) { @@ -13859,7 +13872,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok") o_conv = UpdateFailHTLC_clone(&o_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_err(uint32_t e) { @@ -13870,7 +13883,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok(uint32_t o) { @@ -13881,7 +13894,7 @@ jboolean __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13891,11 +13904,11 @@ void __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_free"))) static inline uintptr_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13903,7 +13916,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clon LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(uint32_t o) { @@ -13914,7 +13927,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeEr o_conv = UpdateFailMalformedHTLC_clone(&o_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(uint32_t e) { @@ -13925,7 +13938,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeEr e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(uint32_t o) { @@ -13936,7 +13949,7 @@ jboolean __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeEr void __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -13946,11 +13959,11 @@ void __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ static inline uintptr_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -13958,7 +13971,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeEr LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_ok(uint32_t o) { @@ -13969,7 +13982,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_ok"))) TS o_conv = UpdateFee_clone(&o_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_err"))) TS_CResult_UpdateFeeDecodeErrorZ_err(uint32_t e) { @@ -13980,7 +13993,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_err"))) T e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_is_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_is_ok(uint32_t o) { @@ -13991,7 +14004,7 @@ jboolean __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_is_ok"))) void __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_free"))) TS_CResult_UpdateFeeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14001,11 +14014,11 @@ void __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_free"))) TS_C static inline uintptr_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14013,7 +14026,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone"))) LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok(uint32_t o) { @@ -14024,7 +14037,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_o o_conv = UpdateFulfillHTLC_clone(&o_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err(uint32_t e) { @@ -14035,7 +14048,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_e e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(uint32_t o) { @@ -14046,7 +14059,7 @@ jboolean __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_i void __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14056,11 +14069,11 @@ void __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free" static inline uintptr_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14068,7 +14081,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_c LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_ok(uint32_t o) { @@ -14079,7 +14092,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_ok")) o_conv = UpdateAddHTLC_clone(&o_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_err(uint32_t e) { @@ -14090,7 +14103,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok(uint32_t o) { @@ -14101,7 +14114,7 @@ jboolean __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_free"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14111,11 +14124,11 @@ void __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_free"))) static inline uintptr_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14123,7 +14136,7 @@ uint32_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)(orig & ~1); LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_ok"))) TS_CResult_PingDecodeErrorZ_ok(uint32_t o) { @@ -14134,7 +14147,7 @@ uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_ok"))) TS_CRes o_conv = Ping_clone(&o_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_err"))) TS_CResult_PingDecodeErrorZ_err(uint32_t e) { @@ -14145,7 +14158,7 @@ uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_err"))) TS_CRe e_conv = DecodeError_clone(&e_conv); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PingDecodeErrorZ_is_ok"))) TS_CResult_PingDecodeErrorZ_is_ok(uint32_t o) { @@ -14156,7 +14169,7 @@ jboolean __attribute__((export_name("TS_CResult_PingDecodeErrorZ_is_ok"))) TS_C void __attribute__((export_name("TS_CResult_PingDecodeErrorZ_free"))) TS_CResult_PingDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14166,11 +14179,11 @@ void __attribute__((export_name("TS_CResult_PingDecodeErrorZ_free"))) TS_CResul static inline uintptr_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone_ptr"))) TS_CResult_PingDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone_ptr"))) TS_CResult_PingDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PingDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PingDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14178,7 +14191,7 @@ uint32_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone"))) TS_C LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)(orig & ~1); LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = CResult_PingDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_ok"))) TS_CResult_PongDecodeErrorZ_ok(uint32_t o) { @@ -14189,7 +14202,7 @@ uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_ok"))) TS_CRes o_conv = Pong_clone(&o_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_err"))) TS_CResult_PongDecodeErrorZ_err(uint32_t e) { @@ -14200,7 +14213,7 @@ uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_err"))) TS_CRe e_conv = DecodeError_clone(&e_conv); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PongDecodeErrorZ_is_ok"))) TS_CResult_PongDecodeErrorZ_is_ok(uint32_t o) { @@ -14211,7 +14224,7 @@ jboolean __attribute__((export_name("TS_CResult_PongDecodeErrorZ_is_ok"))) TS_C void __attribute__((export_name("TS_CResult_PongDecodeErrorZ_free"))) TS_CResult_PongDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14221,11 +14234,11 @@ void __attribute__((export_name("TS_CResult_PongDecodeErrorZ_free"))) TS_CResul static inline uintptr_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone_ptr"))) TS_CResult_PongDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone_ptr"))) TS_CResult_PongDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PongDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PongDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14233,7 +14246,7 @@ uint32_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone"))) TS_C LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)(orig & ~1); LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = CResult_PongDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(uint32_t o) { @@ -14244,7 +14257,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDeco o_conv = UnsignedChannelAnnouncement_clone(&o_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(uint32_t e) { @@ -14255,7 +14268,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDeco e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(uint32_t o) { @@ -14266,7 +14279,7 @@ jboolean __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDeco void __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14276,11 +14289,11 @@ void __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeEr static inline uintptr_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14288,7 +14301,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDeco LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_ok(uint32_t o) { @@ -14299,7 +14312,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ o_conv = ChannelAnnouncement_clone(&o_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_err(uint32_t e) { @@ -14310,7 +14323,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok(uint32_t o) { @@ -14321,7 +14334,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ void __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14331,11 +14344,11 @@ void __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_fre static inline uintptr_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14343,7 +14356,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok(uint32_t o) { @@ -14354,7 +14367,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErro o_conv = UnsignedChannelUpdate_clone(&o_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err(uint32_t e) { @@ -14365,7 +14378,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErro e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(uint32_t o) { @@ -14376,7 +14389,7 @@ jboolean __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErro void __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14386,11 +14399,11 @@ void __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_f static inline uintptr_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14398,7 +14411,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErro LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_ok(uint32_t o) { @@ -14409,7 +14422,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_ok")) o_conv = ChannelUpdate_clone(&o_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_err(uint32_t e) { @@ -14420,7 +14433,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_err") e_conv = DecodeError_clone(&e_conv); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_is_ok(uint32_t o) { @@ -14431,7 +14444,7 @@ jboolean __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_is_ok void __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_free"))) TS_CResult_ChannelUpdateDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14441,11 +14454,11 @@ void __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_free"))) static inline uintptr_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14453,7 +14466,7 @@ uint32_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)(orig & ~1); LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_ok(uint32_t o) { @@ -14464,7 +14477,7 @@ uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_ok"))) o_conv = ErrorMessage_clone(&o_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_err"))) TS_CResult_ErrorMessageDecodeErrorZ_err(uint32_t e) { @@ -14475,7 +14488,7 @@ uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_err")) e_conv = DecodeError_clone(&e_conv); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_is_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_is_ok(uint32_t o) { @@ -14486,7 +14499,7 @@ jboolean __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_is_ok" void __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_free"))) TS_CResult_ErrorMessageDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14496,11 +14509,11 @@ void __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_free"))) T static inline uintptr_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr"))) TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr"))) TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14508,7 +14521,7 @@ uint32_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone" LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)(orig & ~1); LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(uint32_t o) { @@ -14519,7 +14532,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeE o_conv = UnsignedNodeAnnouncement_clone(&o_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(uint32_t e) { @@ -14530,7 +14543,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeE e_conv = DecodeError_clone(&e_conv); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(uint32_t o) { @@ -14541,7 +14554,7 @@ jboolean __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeE void __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14551,11 +14564,11 @@ void __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeError static inline uintptr_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14563,7 +14576,7 @@ uint32_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeE LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_ok(uint32_t o) { @@ -14574,7 +14587,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_ok o_conv = NodeAnnouncement_clone(&o_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_err(uint32_t e) { @@ -14585,7 +14598,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_er e_conv = DecodeError_clone(&e_conv); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok(uint32_t o) { @@ -14596,7 +14609,7 @@ jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_is void __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14606,11 +14619,11 @@ void __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_free") static inline uintptr_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14618,7 +14631,7 @@ uint32_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_cl LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)(orig & ~1); LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok(uint32_t o) { @@ -14629,7 +14642,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeError o_conv = QueryShortChannelIds_clone(&o_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_err(uint32_t e) { @@ -14640,7 +14653,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeError e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(uint32_t o) { @@ -14651,7 +14664,7 @@ jboolean __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeError void __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_free"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14661,11 +14674,11 @@ void __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_fr static inline uintptr_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14673,7 +14686,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeError LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(orig & ~1); LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(uint32_t o) { @@ -14684,7 +14697,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeEr o_conv = ReplyShortChannelIdsEnd_clone(&o_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(uint32_t e) { @@ -14695,7 +14708,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeEr e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(uint32_t o) { @@ -14706,7 +14719,7 @@ jboolean __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeEr void __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14716,11 +14729,11 @@ void __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ static inline uintptr_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14728,7 +14741,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeEr LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_ok(uint32_t o) { @@ -14739,7 +14752,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_o o_conv = QueryChannelRange_clone(&o_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_err(uint32_t e) { @@ -14750,7 +14763,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_e e_conv = DecodeError_clone(&e_conv); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok(uint32_t o) { @@ -14761,7 +14774,7 @@ jboolean __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_i void __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_free"))) TS_CResult_QueryChannelRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14771,11 +14784,11 @@ void __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_free" static inline uintptr_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14783,7 +14796,7 @@ uint32_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_c LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_ok(uint32_t o) { @@ -14794,7 +14807,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_o o_conv = ReplyChannelRange_clone(&o_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_err(uint32_t e) { @@ -14805,7 +14818,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_e e_conv = DecodeError_clone(&e_conv); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok(uint32_t o) { @@ -14816,7 +14829,7 @@ jboolean __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_i void __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_free"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14826,11 +14839,11 @@ void __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_free" static inline uintptr_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14838,7 +14851,7 @@ uint32_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_c LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)(orig & ~1); LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_ok(uint32_t o) { @@ -14849,7 +14862,7 @@ uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro o_conv = GossipTimestampFilter_clone(&o_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_err(uint32_t e) { @@ -14860,7 +14873,7 @@ uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro e_conv = DecodeError_clone(&e_conv); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok(uint32_t o) { @@ -14871,7 +14884,7 @@ jboolean __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro void __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_free"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14881,11 +14894,11 @@ void __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_f static inline uintptr_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14893,7 +14906,7 @@ uint32_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErro LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)(orig & ~1); LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(uint32_t o) { @@ -14904,7 +14917,7 @@ uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorD o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(uint32_t e) { @@ -14915,7 +14928,7 @@ uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorD e_conv = DecodeError_clone(&e_conv); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { @@ -14926,7 +14939,7 @@ jboolean __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorD void __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14936,11 +14949,11 @@ void __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecod static inline uintptr_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -14948,7 +14961,7 @@ uint32_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorD LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(uint32_t o) { @@ -14959,7 +14972,7 @@ uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDe o_conv = StaticPaymentOutputDescriptor_clone(&o_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(uint32_t e) { @@ -14970,7 +14983,7 @@ uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDe e_conv = DecodeError_clone(&e_conv); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { @@ -14981,7 +14994,7 @@ jboolean __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDe void __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -14991,11 +15004,11 @@ void __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecode static inline uintptr_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15003,17 +15016,17 @@ uint32_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDe LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr); - o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)o) & ~1)); + o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)o) & ~1)); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err(uint32_t e) { @@ -15024,7 +15037,7 @@ uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecode e_conv = DecodeError_clone(&e_conv); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(uint32_t o) { @@ -15035,7 +15048,7 @@ jboolean __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecode void __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -15045,11 +15058,11 @@ void __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErro static inline uintptr_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15057,17 +15070,17 @@ uint32_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecode LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(orig & ~1); LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } static inline uintptr_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) { LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(uint32_t arg) { LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(arg & ~1); - int64_t ret_val = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv); return ret_val; } @@ -15075,35 +15088,35 @@ uint32_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)(orig & ~1); LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_new"))) TS_C2Tuple_SignatureCVec_SignatureZZ_new(int8_tArray a, ptrArray b) { LDKSignature a_ref; CHECK(a->arr_len == 64); - memcpy(a_ref.compact_form, a->elems, 64); + memcpy(a_ref.compact_form, a->elems, 64); FREE(a); LDKCVec_SignatureZ b_constr; b_constr.datalen = b->arr_len; if (b_constr.datalen > 0) b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else b_constr.data = NULL; - int8_tArray* b_vals = (void*) b->elems; + int8_tArray* b_vals = (void*) b->elems /* XXX b leaks */; for (size_t m = 0; m < b_constr.datalen; m++) { int8_tArray b_conv_12 = b_vals[m]; LDKSignature b_conv_12_ref; CHECK(b_conv_12->arr_len == 64); - memcpy(b_conv_12_ref.compact_form, b_conv_12->elems, 64); + memcpy(b_conv_12_ref.compact_form, b_conv_12->elems, 64); FREE(b_conv_12); b_constr.data[m] = b_conv_12_ref; } LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_free"))) TS_C2Tuple_SignatureCVec_SignatureZZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr); FREE((void*)_res); @@ -15111,19 +15124,19 @@ void __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_free"))) } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr); - o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)(((uintptr_t)o) & ~1)); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err() { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(uint32_t o) { @@ -15134,7 +15147,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_Signature void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15144,11 +15157,11 @@ void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNo static inline uintptr_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(uint32_t arg) { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(arg & ~1); - int64_t ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -15156,22 +15169,22 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_Signature LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(orig & ~1); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ"); *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SignatureNoneZ_ok"))) TS_CResult_SignatureNoneZ_ok(int8_tArray o) { LDKSignature o_ref; CHECK(o->arr_len == 64); - memcpy(o_ref.compact_form, o->elems, 64); + memcpy(o_ref.compact_form, o->elems, 64); FREE(o); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = CResult_SignatureNoneZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SignatureNoneZ_err"))) TS_CResult_SignatureNoneZ_err() { LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = CResult_SignatureNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_SignatureNoneZ_is_ok"))) TS_CResult_SignatureNoneZ_is_ok(uint32_t o) { @@ -15182,7 +15195,7 @@ jboolean __attribute__((export_name("TS_CResult_SignatureNoneZ_is_ok"))) TS_CRe void __attribute__((export_name("TS_CResult_SignatureNoneZ_free"))) TS_CResult_SignatureNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15192,11 +15205,11 @@ void __attribute__((export_name("TS_CResult_SignatureNoneZ_free"))) TS_CResult_ static inline uintptr_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) { LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = CResult_SignatureNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone_ptr"))) TS_CResult_SignatureNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone_ptr"))) TS_CResult_SignatureNoneZ_clone_ptr(uint32_t arg) { LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)(arg & ~1); - int64_t ret_val = CResult_SignatureNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_SignatureNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -15204,16 +15217,16 @@ uint32_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone"))) TS_CRe LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)(orig & ~1); LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ"); *ret_conv = CResult_SignatureNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_ok"))) TS_CResult_SignDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKSign o_conv = *(LDKSign*)(o_ptr); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_err"))) TS_CResult_SignDecodeErrorZ_err(uint32_t e) { @@ -15224,7 +15237,7 @@ uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_err"))) TS_CRe e_conv = DecodeError_clone(&e_conv); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_SignDecodeErrorZ_is_ok"))) TS_CResult_SignDecodeErrorZ_is_ok(uint32_t o) { @@ -15235,7 +15248,7 @@ jboolean __attribute__((export_name("TS_CResult_SignDecodeErrorZ_is_ok"))) TS_C void __attribute__((export_name("TS_CResult_SignDecodeErrorZ_free"))) TS_CResult_SignDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -15245,11 +15258,11 @@ void __attribute__((export_name("TS_CResult_SignDecodeErrorZ_free"))) TS_CResul static inline uintptr_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone_ptr"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone_ptr"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_SignDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15257,22 +15270,22 @@ uint32_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone"))) TS_C LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)(orig & ~1); LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ"); *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_ok"))) TS_CResult_RecoverableSignatureNoneZ_ok(int8_tArray o) { LDKRecoverableSignature o_ref; CHECK(o->arr_len == 68); - memcpy(o_ref.serialized_form, o->elems, 68); + memcpy(o_ref.serialized_form, o->elems, 68); FREE(o); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_err"))) TS_CResult_RecoverableSignatureNoneZ_err() { LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); *ret_conv = CResult_RecoverableSignatureNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_is_ok"))) TS_CResult_RecoverableSignatureNoneZ_is_ok(uint32_t o) { @@ -15283,7 +15296,7 @@ jboolean __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_is_ok void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_free"))) TS_CResult_RecoverableSignatureNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15293,11 +15306,11 @@ void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_free"))) static inline uintptr_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) { LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone_ptr"))) TS_CResult_RecoverableSignatureNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone_ptr"))) TS_CResult_RecoverableSignatureNoneZ_clone_ptr(uint32_t arg) { LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)(arg & ~1); - int64_t ret_val = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -15305,7 +15318,7 @@ uint32_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)(orig & ~1); LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ"); *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_CVec_u8ZZ_free"))) TS_CVec_CVec_u8ZZ_free(ptrArray _res) { @@ -15315,13 +15328,13 @@ void __attribute__((export_name("TS_CVec_CVec_u8ZZ_free"))) TS_CVec_CVec_u8ZZ_f _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); else _res_constr.data = NULL; - int8_tArray* _res_vals = (void*) _res->elems; + int8_tArray* _res_vals = (void*) _res->elems /* XXX _res leaks */; for (size_t m = 0; m < _res_constr.datalen; m++) { int8_tArray _res_conv_12 = _res_vals[m]; LDKCVec_u8Z _res_conv_12_ref; _res_conv_12_ref.datalen = _res_conv_12->arr_len; _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); + memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12); _res_constr.data[m] = _res_conv_12_ref; } CVec_CVec_u8ZZ_free(_res_constr); @@ -15334,24 +15347,24 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_ok"))) TS_C o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements"); else o_constr.data = NULL; - int8_tArray* o_vals = (void*) o->elems; + int8_tArray* o_vals = (void*) o->elems /* XXX o leaks */; for (size_t m = 0; m < o_constr.datalen; m++) { int8_tArray o_conv_12 = o_vals[m]; LDKCVec_u8Z o_conv_12_ref; o_conv_12_ref.datalen = o_conv_12->arr_len; o_conv_12_ref.data = MALLOC(o_conv_12_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(o_conv_12_ref.data, o_conv_12->elems, o_conv_12_ref.datalen); + memcpy(o_conv_12_ref.data, o_conv_12->elems, o_conv_12_ref.datalen); FREE(o_conv_12); o_constr.data[m] = o_conv_12_ref; } LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_err() { LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok(uint32_t o) { @@ -15362,7 +15375,7 @@ jboolean __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok"))) T void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_free"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15372,11 +15385,11 @@ void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_free"))) TS_CRe static inline uintptr_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) { LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(uint32_t arg) { LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(arg & ~1); - int64_t ret_val = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -15384,7 +15397,7 @@ uint32_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone"))) T LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)(orig & ~1); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_ok(uint32_t o) { @@ -15395,7 +15408,7 @@ uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_ok") o_conv = InMemorySigner_clone(&o_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_err"))) TS_CResult_InMemorySignerDecodeErrorZ_err(uint32_t e) { @@ -15406,7 +15419,7 @@ uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_err" e_conv = DecodeError_clone(&e_conv); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_is_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_is_ok(uint32_t o) { @@ -15417,7 +15430,7 @@ jboolean __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_is_o void __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_free"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -15427,11 +15440,11 @@ void __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_free"))) static inline uintptr_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) { LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr"))) TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr"))) TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr(uint32_t arg) { LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(arg & ~1); - int64_t ret_val = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15439,7 +15452,7 @@ uint32_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clon LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)(orig & ~1); LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_TxOutZ_free"))) TS_CVec_TxOutZ_free(uint32_tArray _res) { @@ -15449,10 +15462,10 @@ void __attribute__((export_name("TS_CVec_TxOutZ_free"))) TS_CVec_TxOutZ_free(ui _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t h = 0; h < _res_constr.datalen; h++) { uint32_t _res_conv_7 = _res_vals[h]; - void* _res_conv_7_ptr = (void*)(((uint64_t)_res_conv_7) & ~1); + void* _res_conv_7_ptr = (void*)(((uintptr_t)_res_conv_7) & ~1); CHECK_ACCESS(_res_conv_7_ptr); LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr); FREE((void*)_res_conv_7); @@ -15465,17 +15478,17 @@ uint32_t __attribute__((export_name("TS_CResult_TransactionNoneZ_ok"))) TS_CRes LDKTransaction o_ref; o_ref.datalen = o->arr_len; o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes"); - memcpy(o_ref.data, o->elems, o_ref.datalen); + memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o); o_ref.data_is_owned = true; LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); *ret_conv = CResult_TransactionNoneZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_TransactionNoneZ_err"))) TS_CResult_TransactionNoneZ_err() { LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); *ret_conv = CResult_TransactionNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_TransactionNoneZ_is_ok"))) TS_CResult_TransactionNoneZ_is_ok(uint32_t o) { @@ -15486,7 +15499,7 @@ jboolean __attribute__((export_name("TS_CResult_TransactionNoneZ_is_ok"))) TS_C void __attribute__((export_name("TS_CResult_TransactionNoneZ_free"))) TS_CResult_TransactionNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15496,11 +15509,11 @@ void __attribute__((export_name("TS_CResult_TransactionNoneZ_free"))) TS_CResul static inline uintptr_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); *ret_conv = CResult_TransactionNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone_ptr"))) TS_CResult_TransactionNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone_ptr"))) TS_CResult_TransactionNoneZ_clone_ptr(uint32_t arg) { LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)(arg & ~1); - int64_t ret_val = CResult_TransactionNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_TransactionNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -15508,29 +15521,29 @@ uint32_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone"))) TS_C LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)(orig & ~1); LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); *ret_conv = CResult_TransactionNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_FilterZ_some"))) TS_COption_FilterZ_some(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKFilter o_conv = *(LDKFilter*)(o_ptr); LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); *ret_copy = COption_FilterZ_some(o_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_FilterZ_none"))) TS_COption_FilterZ_none() { LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); *ret_copy = COption_FilterZ_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_FilterZ_free"))) TS_COption_FilterZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr); FREE((void*)_res); @@ -15545,13 +15558,13 @@ uint32_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_ok")) // Warning: we need a move here but no clone is available for LDKLockedChannelMonitor LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_err"))) TS_CResult_LockedChannelMonitorNoneZ_err() { LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = CResult_LockedChannelMonitorNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_is_ok"))) TS_CResult_LockedChannelMonitorNoneZ_is_ok(uint32_t o) { @@ -15562,7 +15575,7 @@ jboolean __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_is_ok void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_free"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr); FREE((void*)_res); @@ -15576,7 +15589,7 @@ void __attribute__((export_name("TS_CVec_OutPointZ_free"))) TS_CVec_OutPointZ_f _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t k = 0; k < _res_constr.datalen; k++) { uint32_t _res_conv_10 = _res_vals[k]; LDKOutPoint _res_conv_10_conv; @@ -15591,17 +15604,17 @@ void __attribute__((export_name("TS_CVec_OutPointZ_free"))) TS_CVec_OutPointZ_f uint32_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_ok"))) TS_CResult_NoneAPIErrorZ_ok() { LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_err"))) TS_CResult_NoneAPIErrorZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1)); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NoneAPIErrorZ_is_ok"))) TS_CResult_NoneAPIErrorZ_is_ok(uint32_t o) { @@ -15612,7 +15625,7 @@ jboolean __attribute__((export_name("TS_CResult_NoneAPIErrorZ_is_ok"))) TS_CRes void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_free"))) TS_CResult_NoneAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr); FREE((void*)_res); @@ -15622,11 +15635,11 @@ void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_free"))) TS_CResult_N static inline uintptr_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) { LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone_ptr"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone_ptr"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint32_t arg) { LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)(arg & ~1); - int64_t ret_val = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NoneAPIErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15634,26 +15647,26 @@ uint32_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone"))) TS_CRes LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)(orig & ~1); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_COption_u16Z_some"))) TS_COption_u16Z_some(int16_t o) { LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = COption_u16Z_some(o); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_COption_u16Z_none"))) TS_COption_u16Z_none() { LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = COption_u16Z_none(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_COption_u16Z_free"))) TS_COption_u16Z_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr); FREE((void*)_res); @@ -15663,12 +15676,12 @@ void __attribute__((export_name("TS_COption_u16Z_free"))) TS_COption_u16Z_free( static inline uintptr_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) { LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = COption_u16Z_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_COption_u16Z_clone_ptr"))) TS_COption_u16Z_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_COption_u16Z_clone_ptr"))) TS_COption_u16Z_clone_ptr(uint32_t arg) { LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)arg; - int64_t ret_val = COption_u16Z_clone_ptr(arg_conv); + intptr_t ret_val = COption_u16Z_clone_ptr(arg_conv); return ret_val; } @@ -15676,7 +15689,7 @@ uint32_t __attribute__((export_name("TS_COption_u16Z_clone"))) TS_COption_u16Z_ LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)orig; LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = COption_u16Z_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -15687,10 +15700,10 @@ void __attribute__((export_name("TS_CVec_CResult_NoneAPIErrorZZ_free"))) TS_CVe _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t w = 0; w < _res_constr.datalen; w++) { uint32_t _res_conv_22 = _res_vals[w]; - void* _res_conv_22_ptr = (void*)(((uint64_t)_res_conv_22) & ~1); + void* _res_conv_22_ptr = (void*)(((uintptr_t)_res_conv_22) & ~1); CHECK_ACCESS(_res_conv_22_ptr); LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr); FREE((void*)_res_conv_22); @@ -15706,10 +15719,10 @@ void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_f _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t k = 0; k < _res_constr.datalen; k++) { uint32_t _res_conv_10 = _res_vals[k]; - void* _res_conv_10_ptr = (void*)(((uint64_t)_res_conv_10) & ~1); + void* _res_conv_10_ptr = (void*)(((uintptr_t)_res_conv_10) & ~1); CHECK_ACCESS(_res_conv_10_ptr); LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr); FREE((void*)_res_conv_10); @@ -15721,20 +15734,20 @@ void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_f uint32_t __attribute__((export_name("TS_CResult__u832APIErrorZ_ok"))) TS_CResult__u832APIErrorZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = CResult__u832APIErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult__u832APIErrorZ_err"))) TS_CResult__u832APIErrorZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1)); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = CResult__u832APIErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult__u832APIErrorZ_is_ok"))) TS_CResult__u832APIErrorZ_is_ok(uint32_t o) { @@ -15745,7 +15758,7 @@ jboolean __attribute__((export_name("TS_CResult__u832APIErrorZ_is_ok"))) TS_CRe void __attribute__((export_name("TS_CResult__u832APIErrorZ_free"))) TS_CResult__u832APIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr); FREE((void*)_res); @@ -15755,11 +15768,11 @@ void __attribute__((export_name("TS_CResult__u832APIErrorZ_free"))) TS_CResult_ static inline uintptr_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) { LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = CResult__u832APIErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone_ptr"))) TS_CResult__u832APIErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone_ptr"))) TS_CResult__u832APIErrorZ_clone_ptr(uint32_t arg) { LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)(arg & ~1); - int64_t ret_val = CResult__u832APIErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult__u832APIErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -15767,26 +15780,26 @@ uint32_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone"))) TS_CRe LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)(orig & ~1); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = CResult__u832APIErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1)); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_is_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_is_ok(uint32_t o) { @@ -15797,7 +15810,7 @@ jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_is void __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_free"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); @@ -15807,11 +15820,11 @@ void __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_free") static inline uintptr_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) { LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint32_t arg) { LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(arg & ~1); - int64_t ret_val = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv); return ret_val; } @@ -15819,23 +15832,23 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_cl LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)(orig & ~1); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_ok"))) TS_CResult_NonePaymentSendFailureZ_ok() { LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); *ret_conv = CResult_NonePaymentSendFailureZ_ok(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_err"))) TS_CResult_NonePaymentSendFailureZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1)); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_is_ok"))) TS_CResult_NonePaymentSendFailureZ_is_ok(uint32_t o) { @@ -15846,7 +15859,7 @@ jboolean __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_is_ok") void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_free"))) TS_CResult_NonePaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); @@ -15856,11 +15869,11 @@ void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_free"))) TS static inline uintptr_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone_ptr"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone_ptr"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint32_t arg) { LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)(arg & ~1); - int64_t ret_val = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); return ret_val; } @@ -15868,17 +15881,17 @@ uint32_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone") LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)(orig & ~1); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } static inline uintptr_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) { LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr(uint32_t arg) { LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(arg & ~1); - int64_t ret_val = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv); return ret_val; } @@ -15886,24 +15899,24 @@ uint32_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone"))) LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_new"))) TS_C2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, int8_tArray b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKThirtyTwoBytes b_ref; CHECK(b->arr_len == 32); - memcpy(b_ref.data, b->elems, 32); + memcpy(b_ref.data, b->elems, 32); FREE(b); LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ"); *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_free"))) TS_C2Tuple_PaymentHashPaymentIdZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr); FREE((void*)_res); @@ -15911,23 +15924,23 @@ void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_free"))) TS_C } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)(((uintptr_t)o) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); - e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uint64_t)e) & ~1)); + e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)(((uintptr_t)e) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(uint32_t o) { @@ -15938,7 +15951,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPa void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr); FREE((void*)_res); @@ -15948,11 +15961,11 @@ void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymen static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(uint32_t arg) { LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(arg & ~1); - int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv); return ret_val; } @@ -15960,17 +15973,17 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPa LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(orig & ~1); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } static inline uintptr_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) { LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } -int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(uint32_t arg) { LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(arg & ~1); - int64_t ret_val = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); + intptr_t ret_val = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv); return ret_val; } @@ -15978,24 +15991,24 @@ uint32_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)(orig & ~1); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_new"))) TS_C2Tuple_PaymentHashPaymentSecretZ_new(int8_tArray a, int8_tArray b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKThirtyTwoBytes b_ref; CHECK(b->arr_len == 32); - memcpy(b_ref.data, b->elems, 32); + memcpy(b_ref.data, b->elems, 32); FREE(b); LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ"); *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_free"))) TS_C2Tuple_PaymentHashPaymentSecretZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr); FREE((void*)_res); @@ -16003,19 +16016,19 @@ void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_free"))) } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err() { LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(uint32_t o) { @@ -16026,7 +16039,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr); FREE((void*)_res); @@ -16036,11 +16049,11 @@ void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNo static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) { LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(uint32_t arg) { LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(arg & ~1); - int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -16048,27 +16061,27 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(orig & ~1); LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr); - o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uint64_t)o) & ~1)); + o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)(((uintptr_t)o) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1)); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(uint32_t o) { @@ -16079,7 +16092,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr); FREE((void*)_res); @@ -16089,11 +16102,11 @@ void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAP static inline uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) { LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(uint32_t arg) { LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(arg & ~1); - int64_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -16101,22 +16114,22 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecre LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(orig & ~1); LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_ok"))) TS_CResult_PaymentSecretNoneZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_err"))) TS_CResult_PaymentSecretNoneZ_err() { LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); *ret_conv = CResult_PaymentSecretNoneZ_err(); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_is_ok"))) TS_CResult_PaymentSecretNoneZ_is_ok(uint32_t o) { @@ -16127,7 +16140,7 @@ jboolean __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_is_ok"))) TS void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_free"))) TS_CResult_PaymentSecretNoneZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr); FREE((void*)_res); @@ -16137,11 +16150,11 @@ void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_free"))) TS_CRes static inline uintptr_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) { LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); *ret_conv = CResult_PaymentSecretNoneZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone_ptr"))) TS_CResult_PaymentSecretNoneZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone_ptr"))) TS_CResult_PaymentSecretNoneZ_clone_ptr(uint32_t arg) { LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)(arg & ~1); - int64_t ret_val = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv); return ret_val; } @@ -16149,26 +16162,26 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone"))) TS LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)(orig & ~1); LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_ok"))) TS_CResult_PaymentSecretAPIErrorZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_err"))) TS_CResult_PaymentSecretAPIErrorZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1)); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_is_ok"))) TS_CResult_PaymentSecretAPIErrorZ_is_ok(uint32_t o) { @@ -16179,7 +16192,7 @@ jboolean __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_is_ok")) void __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_free"))) TS_CResult_PaymentSecretAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr); FREE((void*)_res); @@ -16189,11 +16202,11 @@ void __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_free"))) TS_ static inline uintptr_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) { LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone_ptr"))) TS_CResult_PaymentSecretAPIErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone_ptr"))) TS_CResult_PaymentSecretAPIErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -16201,26 +16214,26 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone")) LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)(orig & ~1); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_err"))) TS_CResult_PaymentPreimageAPIErrorZ_err(uint32_t e) { - void* e_ptr = (void*)(((uint64_t)e) & ~1); + void* e_ptr = (void*)(((uintptr_t)e) & ~1); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); - e_conv = APIError_clone((LDKAPIError*)(((uint64_t)e) & ~1)); + e_conv = APIError_clone((LDKAPIError*)(((uintptr_t)e) & ~1)); LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_is_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_is_ok(uint32_t o) { @@ -16231,7 +16244,7 @@ jboolean __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_is_ok" void __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_free"))) TS_CResult_PaymentPreimageAPIErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr); FREE((void*)_res); @@ -16241,11 +16254,11 @@ void __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_free"))) T static inline uintptr_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) { LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -int64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr"))) TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr"))) TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr(uint32_t arg) { LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(arg & ~1); - int64_t ret_val = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv); + intptr_t ret_val = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv); return ret_val; } @@ -16253,7 +16266,7 @@ uint32_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone" LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)(orig & ~1); LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_ChannelMonitorZ_free(uint32_tArray _res) { @@ -16263,7 +16276,7 @@ void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_Chann _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); else _res_constr.data = NULL; - uint32_t* _res_vals = _res->elems; + uint32_t* _res_vals = _res->elems /* XXX _res leaks */; for (size_t q = 0; q < _res_constr.datalen; q++) { uint32_t _res_conv_16 = _res_vals[q]; LDKChannelMonitor _res_conv_16_conv; @@ -16278,7 +16291,7 @@ void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_Chann uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_new"))) TS_C2Tuple_BlockHashChannelManagerZ_new(int8_tArray a, uint32_t b) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKChannelManager b_conv; b_conv.inner = (void*)(b & (~1)); b_conv.is_owned = (b & 1) || (b == 0); @@ -16286,12 +16299,12 @@ uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_new")) // Warning: we need a move here but no clone is available for LDKChannelManager LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } void __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_free"))) TS_C2Tuple_BlockHashChannelManagerZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr); FREE((void*)_res); @@ -16299,13 +16312,13 @@ void __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_free"))) T } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(uint32_t o) { - void* o_ptr = (void*)(((uint64_t)o) & ~1); + void* o_ptr = (void*)(((uintptr_t)o) & ~1); CHECK_ACCESS(o_ptr); LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr); // Warning: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(uint32_t e) { @@ -16316,7 +16329,7 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManager e_conv = DecodeError_clone(&e_conv); LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(uint32_t o) { @@ -16327,7 +16340,7 @@ jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManager void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint32_t _res) { if ((_res & 1) != 0) return; - void* _res_ptr = (void*)(((uint64_t)_res) & ~1); + void* _res_ptr = (void*)(((uintptr_t)_res) & ~1); CHECK_ACCESS(_res_ptr); LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr); FREE((void*)_res); @@ -16336,7 +16349,7 @@ void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDec void __attribute__((export_name("TS_PaymentPurpose_free"))) TS_PaymentPurpose_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -16346,12 +16359,12 @@ void __attribute__((export_name("TS_PaymentPurpose_free"))) TS_PaymentPurpose_f static inline uintptr_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) { LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); *ret_copy = PaymentPurpose_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_PaymentPurpose_clone_ptr"))) TS_PaymentPurpose_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_PaymentPurpose_clone_ptr"))) TS_PaymentPurpose_clone_ptr(uint32_t arg) { LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)arg; - int64_t ret_val = PaymentPurpose_clone_ptr(arg_conv); + intptr_t ret_val = PaymentPurpose_clone_ptr(arg_conv); return ret_val; } @@ -16359,36 +16372,36 @@ uint32_t __attribute__((export_name("TS_PaymentPurpose_clone"))) TS_PaymentPurp LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)orig; LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); *ret_copy = PaymentPurpose_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_PaymentPurpose_invoice_payment"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret) { LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); LDKThirtyTwoBytes payment_secret_ref; CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_PaymentPurpose_spontaneous_payment"))) TS_PaymentPurpose_spontaneous_payment(int8_tArray a) { LDKThirtyTwoBytes a_ref; CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); *ret_copy = PaymentPurpose_spontaneous_payment(a_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_ClosureReason_free"))) TS_ClosureReason_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -16398,12 +16411,12 @@ void __attribute__((export_name("TS_ClosureReason_free"))) TS_ClosureReason_fre static inline uintptr_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_ClosureReason_clone_ptr"))) TS_ClosureReason_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ClosureReason_clone_ptr"))) TS_ClosureReason_clone_ptr(uint32_t arg) { LDKClosureReason* arg_conv = (LDKClosureReason*)arg; - int64_t ret_val = ClosureReason_clone_ptr(arg_conv); + intptr_t ret_val = ClosureReason_clone_ptr(arg_conv); return ret_val; } @@ -16411,7 +16424,7 @@ uint32_t __attribute__((export_name("TS_ClosureReason_clone"))) TS_ClosureReaso LDKClosureReason* orig_conv = (LDKClosureReason*)orig; LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16419,35 +16432,35 @@ uint32_t __attribute__((export_name("TS_ClosureReason_counterparty_force_closed LDKStr peer_msg_conv = str_ref_to_owned_c(peer_msg); LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_holder_force_closed"))) TS_ClosureReason_holder_force_closed() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_holder_force_closed(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_cooperative_closure"))) TS_ClosureReason_cooperative_closure() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_cooperative_closure(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_commitment_tx_confirmed"))) TS_ClosureReason_commitment_tx_confirmed() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_commitment_tx_confirmed(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_funding_timed_out"))) TS_ClosureReason_funding_timed_out() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_funding_timed_out(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16455,28 +16468,28 @@ uint32_t __attribute__((export_name("TS_ClosureReason_processing_error"))) TS_C LDKStr err_conv = str_ref_to_owned_c(err); LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_processing_error(err_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_disconnected_peer"))) TS_ClosureReason_disconnected_peer() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_disconnected_peer(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ClosureReason_outdated_channel_manager"))) TS_ClosureReason_outdated_channel_manager() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); *ret_copy = ClosureReason_outdated_channel_manager(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_ClosureReason_write"))) TS_ClosureReason_write(uint32_t obj) { LDKClosureReason* obj_conv = (LDKClosureReason*)obj; LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -16485,15 +16498,15 @@ int8_tArray __attribute__((export_name("TS_ClosureReason_write"))) TS_ClosureRe uint32_t __attribute__((export_name("TS_ClosureReason_read"))) TS_ClosureReason_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ"); *ret_conv = ClosureReason_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_Event_free"))) TS_Event_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -16503,12 +16516,12 @@ void __attribute__((export_name("TS_Event_free"))) TS_Event_free(uint32_t this_ static inline uintptr_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) { LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_Event_clone_ptr"))) TS_Event_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Event_clone_ptr"))) TS_Event_clone_ptr(uint32_t arg) { LDKEvent* arg_conv = (LDKEvent*)arg; - int64_t ret_val = Event_clone_ptr(arg_conv); + intptr_t ret_val = Event_clone_ptr(arg_conv); return ret_val; } @@ -16516,76 +16529,76 @@ uint32_t __attribute__((export_name("TS_Event_clone"))) TS_Event_clone(uint32_t LDKEvent* orig_conv = (LDKEvent*)orig; LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_funding_generation_ready"))) TS_Event_funding_generation_ready(int8_tArray temporary_channel_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) { LDKThirtyTwoBytes temporary_channel_id_ref; CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); + memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id); LDKCVec_u8Z output_script_ref; output_script_ref.datalen = output_script->arr_len; output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); + memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, channel_value_satoshis, output_script_ref, user_channel_id); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_payment_received"))) TS_Event_payment_received(int8_tArray payment_hash, int64_t amt, uint32_t purpose) { LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); - void* purpose_ptr = (void*)(((uint64_t)purpose) & ~1); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* purpose_ptr = (void*)(((uintptr_t)purpose) & ~1); CHECK_ACCESS(purpose_ptr); LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); - purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uint64_t)purpose) & ~1)); + purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)(((uintptr_t)purpose) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_received(payment_hash_ref, amt, purpose_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_payment_sent"))) TS_Event_payment_sent(int8_tArray payment_id, int8_tArray payment_preimage, int8_tArray payment_hash, uint32_t fee_paid_msat) { LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); - void* fee_paid_msat_ptr = (void*)(((uint64_t)fee_paid_msat) & ~1); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* fee_paid_msat_ptr = (void*)(((uintptr_t)fee_paid_msat) & ~1); CHECK_ACCESS(fee_paid_msat_ptr); LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr); - fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_paid_msat) & ~1)); + fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)fee_paid_msat) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_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, uint32_t network_update, jboolean all_paths_failed, uint32_tArray path, uint32_t short_channel_id, uint32_t retry) { LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); - void* network_update_ptr = (void*)(((uint64_t)network_update) & ~1); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* network_update_ptr = (void*)(((uintptr_t)network_update) & ~1); CHECK_ACCESS(network_update_ptr); LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr); - network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uint64_t)network_update) & ~1)); + network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)(((uintptr_t)network_update) & ~1)); LDKCVec_RouteHopZ path_constr; path_constr.datalen = path->arr_len; if (path_constr.datalen > 0) path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else path_constr.data = NULL; - uint32_t* path_vals = path->elems; + uint32_t* path_vals = path->elems /* XXX path leaks */; for (size_t k = 0; k < path_constr.datalen; k++) { uint32_t path_conv_10 = path_vals[k]; LDKRouteHop path_conv_10_conv; @@ -16595,10 +16608,10 @@ uint32_t __attribute__((export_name("TS_Event_payment_path_failed"))) TS_Event_ path_conv_10_conv = RouteHop_clone(&path_conv_10_conv); path_constr.data[k] = path_conv_10_conv; } - void* short_channel_id_ptr = (void*)(((uint64_t)short_channel_id) & ~1); + void* short_channel_id_ptr = (void*)(((uintptr_t)short_channel_id) & ~1); CHECK_ACCESS(short_channel_id_ptr); LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr); - short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id) & ~1)); + short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id) & ~1)); LDKRouteParameters retry_conv; retry_conv.inner = (void*)(retry & (~1)); retry_conv.is_owned = (retry & 1) || (retry == 0); @@ -16606,27 +16619,27 @@ uint32_t __attribute__((export_name("TS_Event_payment_path_failed"))) TS_Event_ retry_conv = RouteParameters_clone(&retry_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *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); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_payment_failed"))) TS_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash) { LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_pending_htlcs_forwardable"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) { LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_pending_htlcs_forwardable(time_forwardable); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16637,75 +16650,75 @@ uint32_t __attribute__((export_name("TS_Event_spendable_outputs"))) TS_Event_sp outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else outputs_constr.data = NULL; - uint32_t* outputs_vals = outputs->elems; + uint32_t* outputs_vals = outputs->elems /* XXX outputs leaks */; for (size_t b = 0; b < outputs_constr.datalen; b++) { uint32_t outputs_conv_27 = outputs_vals[b]; - void* outputs_conv_27_ptr = (void*)(((uint64_t)outputs_conv_27) & ~1); + void* outputs_conv_27_ptr = (void*)(((uintptr_t)outputs_conv_27) & ~1); CHECK_ACCESS(outputs_conv_27_ptr); LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr); - outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1)); + outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)outputs_conv_27) & ~1)); outputs_constr.data[b] = outputs_conv_27_conv; } LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_spendable_outputs(outputs_constr); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_payment_forwarded"))) TS_Event_payment_forwarded(uint32_t fee_earned_msat, jboolean claim_from_onchain_tx) { - void* fee_earned_msat_ptr = (void*)(((uint64_t)fee_earned_msat) & ~1); + void* fee_earned_msat_ptr = (void*)(((uintptr_t)fee_earned_msat) & ~1); CHECK_ACCESS(fee_earned_msat_ptr); LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr); - fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)fee_earned_msat) & ~1)); + fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)fee_earned_msat) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_forwarded(fee_earned_msat_conv, claim_from_onchain_tx); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_channel_closed"))) TS_Event_channel_closed(int8_tArray channel_id, int64_t user_channel_id, uint32_t reason) { LDKThirtyTwoBytes channel_id_ref; CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); - void* reason_ptr = (void*)(((uint64_t)reason) & ~1); + memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); + void* reason_ptr = (void*)(((uintptr_t)reason) & ~1); CHECK_ACCESS(reason_ptr); LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); - reason_conv = ClosureReason_clone((LDKClosureReason*)(((uint64_t)reason) & ~1)); + reason_conv = ClosureReason_clone((LDKClosureReason*)(((uintptr_t)reason) & ~1)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_discard_funding"))) TS_Event_discard_funding(int8_tArray channel_id, int8_tArray transaction) { LDKThirtyTwoBytes channel_id_ref; CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); + memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); LDKTransaction transaction_ref; transaction_ref.datalen = transaction->arr_len; transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); + memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction); transaction_ref.data_is_owned = true; LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Event_payment_path_successful"))) TS_Event_payment_path_successful(int8_tArray payment_id, int8_tArray payment_hash, uint32_tArray path) { LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKCVec_RouteHopZ path_constr; path_constr.datalen = path->arr_len; if (path_constr.datalen > 0) path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else path_constr.data = NULL; - uint32_t* path_vals = path->elems; + uint32_t* path_vals = path->elems /* XXX path leaks */; for (size_t k = 0; k < path_constr.datalen; k++) { uint32_t path_conv_10 = path_vals[k]; LDKRouteHop path_conv_10_conv; @@ -16717,14 +16730,14 @@ uint32_t __attribute__((export_name("TS_Event_payment_path_successful"))) TS_Ev } LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_Event_write"))) TS_Event_write(uint32_t obj) { LDKEvent* obj_conv = (LDKEvent*)obj; LDKCVec_u8Z ret_var = Event_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -16733,15 +16746,15 @@ int8_tArray __attribute__((export_name("TS_Event_write"))) TS_Event_write(uint3 uint32_t __attribute__((export_name("TS_Event_read"))) TS_Event_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); *ret_conv = Event_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_MessageSendEvent_free"))) TS_MessageSendEvent_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -16751,12 +16764,12 @@ void __attribute__((export_name("TS_MessageSendEvent_free"))) TS_MessageSendEve static inline uintptr_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) { LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_MessageSendEvent_clone_ptr"))) TS_MessageSendEvent_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_MessageSendEvent_clone_ptr"))) TS_MessageSendEvent_clone_ptr(uint32_t arg) { LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)arg; - int64_t ret_val = MessageSendEvent_clone_ptr(arg_conv); + intptr_t ret_val = MessageSendEvent_clone_ptr(arg_conv); return ret_val; } @@ -16764,14 +16777,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_clone"))) TS_MessageSe LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)orig; LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_accept_channel"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKAcceptChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16779,14 +16792,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_accept_channel")) msg_conv = AcceptChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_open_channel"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKOpenChannel msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16794,14 +16807,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_open_channel"))) msg_conv = OpenChannel_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_created"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKFundingCreated msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16809,14 +16822,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_created") msg_conv = FundingCreated_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_signed"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKFundingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16824,14 +16837,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_signed")) msg_conv = FundingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_locked"))) TS_MessageSendEvent_send_funding_locked(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKFundingLocked msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16839,14 +16852,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_funding_locked")) msg_conv = FundingLocked_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_announcement_signatures"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKAnnouncementSignatures msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16854,14 +16867,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_announcement_sign msg_conv = AnnouncementSignatures_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_update_htlcs"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint32_t updates) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKCommitmentUpdate updates_conv; updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = (updates & 1) || (updates == 0); @@ -16869,14 +16882,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_update_htlcs"))) TS_Me updates_conv = CommitmentUpdate_clone(&updates_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_revoke_and_ack"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKRevokeAndACK msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16884,14 +16897,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_revoke_and_ack")) msg_conv = RevokeAndACK_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_closing_signed"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKClosingSigned msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16899,14 +16912,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_closing_signed")) msg_conv = ClosingSigned_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_shutdown"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKShutdown msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16914,14 +16927,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_shutdown"))) TS_M msg_conv = Shutdown_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_reestablish"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKChannelReestablish msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16929,7 +16942,7 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_reestabli msg_conv = ChannelReestablish_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16946,7 +16959,7 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_anno update_msg_conv = ChannelUpdate_clone(&update_msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16958,7 +16971,7 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_broadcast_node_announc msg_conv = NodeAnnouncement_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -16970,14 +16983,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_upda msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_update"))) TS_MessageSendEvent_send_channel_update(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKChannelUpdate msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -16985,28 +16998,28 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_update")) msg_conv = ChannelUpdate_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_handle_error"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint32_t action) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); - void* action_ptr = (void*)(((uint64_t)action) & ~1); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + void* action_ptr = (void*)(((uintptr_t)action) & ~1); CHECK_ACCESS(action_ptr); LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr); - action_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action) & ~1)); + action_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)action) & ~1)); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_range_query"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKQueryChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -17014,14 +17027,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_channel_range_que msg_conv = QueryChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_short_ids_query"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKQueryShortChannelIds msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -17029,14 +17042,14 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_short_ids_query") msg_conv = QueryShortChannelIds_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_MessageSendEvent_send_reply_channel_range"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint32_t msg) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKReplyChannelRange msg_conv; msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = (msg & 1) || (msg == 0); @@ -17044,13 +17057,13 @@ uint32_t __attribute__((export_name("TS_MessageSendEvent_send_reply_channel_ran msg_conv = ReplyChannelRange_clone(&msg_conv); LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } void __attribute__((export_name("TS_MessageSendEventsProvider_free"))) TS_MessageSendEventsProvider_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -17059,7 +17072,7 @@ void __attribute__((export_name("TS_MessageSendEventsProvider_free"))) TS_Messa void __attribute__((export_name("TS_EventsProvider_free"))) TS_EventsProvider_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -17068,7 +17081,7 @@ void __attribute__((export_name("TS_EventsProvider_free"))) TS_EventsProvider_f void __attribute__((export_name("TS_EventHandler_free"))) TS_EventHandler_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -17077,7 +17090,7 @@ void __attribute__((export_name("TS_EventHandler_free"))) TS_EventHandler_free( void __attribute__((export_name("TS_APIError_free"))) TS_APIError_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -17087,12 +17100,12 @@ void __attribute__((export_name("TS_APIError_free"))) TS_APIError_free(uint32_t static inline uintptr_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_APIError_clone_ptr"))) TS_APIError_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_APIError_clone_ptr"))) TS_APIError_clone_ptr(uint32_t arg) { LDKAPIError* arg_conv = (LDKAPIError*)arg; - int64_t ret_val = APIError_clone_ptr(arg_conv); + intptr_t ret_val = APIError_clone_ptr(arg_conv); return ret_val; } @@ -17100,7 +17113,7 @@ uint32_t __attribute__((export_name("TS_APIError_clone"))) TS_APIError_clone(ui LDKAPIError* orig_conv = (LDKAPIError*)orig; LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -17108,7 +17121,7 @@ uint32_t __attribute__((export_name("TS_APIError_apimisuse_error"))) TS_APIErro LDKStr err_conv = str_ref_to_owned_c(err); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_apimisuse_error(err_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -17116,7 +17129,7 @@ uint32_t __attribute__((export_name("TS_APIError_fee_rate_too_high"))) TS_APIEr LDKStr err_conv = str_ref_to_owned_c(err); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -17124,7 +17137,7 @@ uint32_t __attribute__((export_name("TS_APIError_route_error"))) TS_APIError_ro LDKStr err_conv = str_ref_to_owned_c(err); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_route_error(err_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -17132,14 +17145,14 @@ uint32_t __attribute__((export_name("TS_APIError_channel_unavailable"))) TS_API LDKStr err_conv = str_ref_to_owned_c(err); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_channel_unavailable(err_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_APIError_monitor_update_failed"))) TS_APIError_monitor_update_failed() { LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_monitor_update_failed(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -17151,41 +17164,41 @@ uint32_t __attribute__((export_name("TS_APIError_incompatible_shutdown_script") script_conv = ShutdownScript_clone(&script_conv); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); *ret_copy = APIError_incompatible_shutdown_script(script_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_sign"))) TS_sign(int8_tArray msg, int8_tArray sk) { LDKu8slice msg_ref; msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; + msg_ref.data = msg->elems /* XXX msg leaks */; unsigned char sk_arr[32]; CHECK(sk->arr_len == 32); - memcpy(sk_arr, sk->elems, 32); + memcpy(sk_arr, sk->elems, 32); FREE(sk); unsigned char (*sk_ref)[32] = &sk_arr; LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); *ret_conv = sign(msg_ref, sk_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_recover_pk"))) TS_recover_pk(int8_tArray msg, jstring sig) { LDKu8slice msg_ref; msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; + msg_ref.data = msg->elems /* XXX msg leaks */; LDKStr sig_conv = str_ref_to_owned_c(sig); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = recover_pk(msg_ref, sig_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } jboolean __attribute__((export_name("TS_verify"))) TS_verify(int8_tArray msg, jstring sig, int8_tArray pk) { LDKu8slice msg_ref; msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; + msg_ref.data = msg->elems /* XXX msg leaks */; LDKStr sig_conv = str_ref_to_owned_c(sig); LDKPublicKey pk_ref; CHECK(pk->arr_len == 33); - memcpy(pk_ref.compressed_form, pk->elems, 33); + memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk); jboolean ret_val = verify(msg_ref, sig_conv, pk_ref); return ret_val; } @@ -17349,22 +17362,22 @@ void __attribute__((export_name("TS_Record_set_line"))) TS_Record_set_line(uint static inline uintptr_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { LDKRecord ret_var = Record_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Record_clone_ptr"))) TS_Record_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Record_clone_ptr"))) TS_Record_clone_ptr(uint32_t arg) { LDKRecord arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Record_clone_ptr(&arg_conv); + intptr_t ret_val = Record_clone_ptr(&arg_conv); return ret_val; } @@ -17374,11 +17387,11 @@ uint32_t __attribute__((export_name("TS_Record_clone"))) TS_Record_clone(uint32 orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRecord ret_var = Record_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17387,7 +17400,7 @@ uint32_t __attribute__((export_name("TS_Record_clone"))) TS_Record_clone(uint32 void __attribute__((export_name("TS_Logger_free"))) TS_Logger_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -17455,11 +17468,11 @@ void __attribute__((export_name("TS_ChannelHandshakeConfig_set_our_htlc_minimum uint32_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) { LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17468,22 +17481,22 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeConfig_new"))) TS_Chann static inline uintptr_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone_ptr"))) TS_ChannelHandshakeConfig_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone_ptr"))) TS_ChannelHandshakeConfig_clone_ptr(uint32_t arg) { LDKChannelHandshakeConfig arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelHandshakeConfig_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelHandshakeConfig_clone_ptr(&arg_conv); return ret_val; } @@ -17493,11 +17506,11 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone"))) TS_Cha orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17506,11 +17519,11 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone"))) TS_Cha uint32_t __attribute__((export_name("TS_ChannelHandshakeConfig_default"))) TS_ChannelHandshakeConfig_default() { LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17663,11 +17676,11 @@ void __attribute__((export_name("TS_ChannelHandshakeLimits_set_their_to_self_de uint32_t __attribute__((export_name("TS_ChannelHandshakeLimits_new"))) TS_ChannelHandshakeLimits_new(int64_t min_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 force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_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, force_announced_channel_preference_arg, their_to_self_delay_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17676,22 +17689,22 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeLimits_new"))) TS_Chann static inline uintptr_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone_ptr"))) TS_ChannelHandshakeLimits_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone_ptr"))) TS_ChannelHandshakeLimits_clone_ptr(uint32_t arg) { LDKChannelHandshakeLimits arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelHandshakeLimits_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelHandshakeLimits_clone_ptr(&arg_conv); return ret_val; } @@ -17701,11 +17714,11 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone"))) TS_Cha orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17714,11 +17727,11 @@ uint32_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone"))) TS_Cha uint32_t __attribute__((export_name("TS_ChannelHandshakeLimits_default"))) TS_ChannelHandshakeLimits_default() { LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17854,11 +17867,11 @@ void __attribute__((export_name("TS_ChannelConfig_set_force_close_avoidance_max uint32_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, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg, int64_t max_dust_htlc_exposure_msat_arg, int64_t force_close_avoidance_max_fee_satoshis_arg) { LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17867,22 +17880,22 @@ uint32_t __attribute__((export_name("TS_ChannelConfig_new"))) TS_ChannelConfig_ static inline uintptr_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { LDKChannelConfig ret_var = ChannelConfig_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelConfig_clone_ptr"))) TS_ChannelConfig_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelConfig_clone_ptr"))) TS_ChannelConfig_clone_ptr(uint32_t arg) { LDKChannelConfig arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelConfig_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelConfig_clone_ptr(&arg_conv); return ret_val; } @@ -17892,11 +17905,11 @@ uint32_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfi orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17905,11 +17918,11 @@ uint32_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfi uint32_t __attribute__((export_name("TS_ChannelConfig_default"))) TS_ChannelConfig_default() { LDKChannelConfig ret_var = ChannelConfig_default(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17922,7 +17935,7 @@ int8_tArray __attribute__((export_name("TS_ChannelConfig_write"))) TS_ChannelCo obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -17931,10 +17944,10 @@ int8_tArray __attribute__((export_name("TS_ChannelConfig_write"))) TS_ChannelCo uint32_t __attribute__((export_name("TS_ChannelConfig_read"))) TS_ChannelConfig_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); *ret_conv = ChannelConfig_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_UserConfig_free"))) TS_UserConfig_free(uint32_t this_obj) { @@ -17951,11 +17964,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_get_own_channel_config"))) T this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeConfig ret_var = UserConfig_get_own_channel_config(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -17981,11 +17994,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_get_peer_channel_config_limi this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelHandshakeLimits ret_var = UserConfig_get_peer_channel_config_limits(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18011,11 +18024,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_get_channel_options"))) TS_U this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelConfig ret_var = UserConfig_get_channel_options(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18086,11 +18099,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_new"))) TS_UserConfig_new(ui CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_options_arg_conv); channel_options_arg_conv = ChannelConfig_clone(&channel_options_arg_conv); LDKUserConfig ret_var = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18099,22 +18112,22 @@ uint32_t __attribute__((export_name("TS_UserConfig_new"))) TS_UserConfig_new(ui static inline uintptr_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { LDKUserConfig ret_var = UserConfig_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UserConfig_clone_ptr"))) TS_UserConfig_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UserConfig_clone_ptr"))) TS_UserConfig_clone_ptr(uint32_t arg) { LDKUserConfig arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UserConfig_clone_ptr(&arg_conv); + intptr_t ret_val = UserConfig_clone_ptr(&arg_conv); return ret_val; } @@ -18124,11 +18137,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_clone"))) TS_UserConfig_clon orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUserConfig ret_var = UserConfig_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18137,11 +18150,11 @@ uint32_t __attribute__((export_name("TS_UserConfig_clone"))) TS_UserConfig_clon uint32_t __attribute__((export_name("TS_UserConfig_default"))) TS_UserConfig_default() { LDKUserConfig ret_var = UserConfig_default(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18158,22 +18171,22 @@ void __attribute__((export_name("TS_BestBlock_free"))) TS_BestBlock_free(uint32 static inline uintptr_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { LDKBestBlock ret_var = BestBlock_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_BestBlock_clone_ptr"))) TS_BestBlock_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_BestBlock_clone_ptr"))) TS_BestBlock_clone_ptr(uint32_t arg) { LDKBestBlock arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = BestBlock_clone_ptr(&arg_conv); + intptr_t ret_val = BestBlock_clone_ptr(&arg_conv); return ret_val; } @@ -18183,11 +18196,11 @@ uint32_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone( orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBestBlock ret_var = BestBlock_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18197,11 +18210,11 @@ uint32_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone( uint32_t __attribute__((export_name("TS_BestBlock_from_genesis"))) TS_BestBlock_from_genesis(uint32_t network) { LDKNetwork network_conv = LDKNetwork_from_js(network); LDKBestBlock ret_var = BestBlock_from_genesis(network_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18211,13 +18224,13 @@ uint32_t __attribute__((export_name("TS_BestBlock_from_genesis"))) TS_BestBlock uint32_t __attribute__((export_name("TS_BestBlock_new"))) TS_BestBlock_new(int8_tArray block_hash, int32_t height) { LDKThirtyTwoBytes block_hash_ref; CHECK(block_hash->arr_len == 32); - memcpy(block_hash_ref.data, block_hash->elems, 32); + memcpy(block_hash_ref.data, block_hash->elems, 32); FREE(block_hash); LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18229,7 +18242,7 @@ int8_tArray __attribute__((export_name("TS_BestBlock_block_hash"))) TS_BestBloc this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, BestBlock_block_hash(&this_arg_conv).data, 32); return ret_arr; } @@ -18261,7 +18274,7 @@ uint32_t __attribute__((export_name("TS_AccessError_unknown_tx"))) TS_AccessErr void __attribute__((export_name("TS_Access_free"))) TS_Access_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18270,7 +18283,7 @@ void __attribute__((export_name("TS_Access_free"))) TS_Access_free(uint32_t thi void __attribute__((export_name("TS_Listen_free"))) TS_Listen_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18279,7 +18292,7 @@ void __attribute__((export_name("TS_Listen_free"))) TS_Listen_free(uint32_t thi void __attribute__((export_name("TS_Confirm_free"))) TS_Confirm_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18304,7 +18317,7 @@ uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_permanent_failu void __attribute__((export_name("TS_Watch_free"))) TS_Watch_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18313,7 +18326,7 @@ void __attribute__((export_name("TS_Watch_free"))) TS_Watch_free(uint32_t this_ void __attribute__((export_name("TS_Filter_free"))) TS_Filter_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18333,7 +18346,7 @@ int8_tArray __attribute__((export_name("TS_WatchedOutput_get_block_hash"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, WatchedOutput_get_block_hash(&this_ptr_conv).data, 32); return ret_arr; } @@ -18345,7 +18358,7 @@ void __attribute__((export_name("TS_WatchedOutput_set_block_hash"))) TS_Watched CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); WatchedOutput_set_block_hash(&this_ptr_conv, val_ref); } @@ -18355,11 +18368,11 @@ uint32_t __attribute__((export_name("TS_WatchedOutput_get_outpoint"))) TS_Watch this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18385,7 +18398,7 @@ int8_tArray __attribute__((export_name("TS_WatchedOutput_get_script_pubkey"))) this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -18398,14 +18411,14 @@ void __attribute__((export_name("TS_WatchedOutput_set_script_pubkey"))) TS_Watc LDKCVec_u8Z val_ref; val_ref.datalen = val->arr_len; val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); } uint32_t __attribute__((export_name("TS_WatchedOutput_new"))) TS_WatchedOutput_new(int8_tArray block_hash_arg, uint32_t outpoint_arg, int8_tArray script_pubkey_arg) { LDKThirtyTwoBytes block_hash_arg_ref; CHECK(block_hash_arg->arr_len == 32); - memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); + memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg); LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = (void*)(outpoint_arg & (~1)); outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); @@ -18414,13 +18427,13 @@ uint32_t __attribute__((export_name("TS_WatchedOutput_new"))) TS_WatchedOutput_ LDKCVec_u8Z script_pubkey_arg_ref; script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len; script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); + memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg); LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18429,22 +18442,22 @@ uint32_t __attribute__((export_name("TS_WatchedOutput_new"))) TS_WatchedOutput_ static inline uintptr_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { LDKWatchedOutput ret_var = WatchedOutput_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_WatchedOutput_clone_ptr"))) TS_WatchedOutput_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_WatchedOutput_clone_ptr"))) TS_WatchedOutput_clone_ptr(uint32_t arg) { LDKWatchedOutput arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = WatchedOutput_clone_ptr(&arg_conv); + intptr_t ret_val = WatchedOutput_clone_ptr(&arg_conv); return ret_val; } @@ -18454,11 +18467,11 @@ uint32_t __attribute__((export_name("TS_WatchedOutput_clone"))) TS_WatchedOutpu orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18476,7 +18489,7 @@ int64_t __attribute__((export_name("TS_WatchedOutput_hash"))) TS_WatchedOutput_ void __attribute__((export_name("TS_BroadcasterInterface_free"))) TS_BroadcasterInterface_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18513,7 +18526,7 @@ jboolean __attribute__((export_name("TS_ConfirmationTarget_eq"))) TS_Confirmati void __attribute__((export_name("TS_FeeEstimator_free"))) TS_FeeEstimator_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18530,22 +18543,22 @@ void __attribute__((export_name("TS_MonitorUpdateId_free"))) TS_MonitorUpdateId static inline uintptr_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_MonitorUpdateId_clone_ptr"))) TS_MonitorUpdateId_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_MonitorUpdateId_clone_ptr"))) TS_MonitorUpdateId_clone_ptr(uint32_t arg) { LDKMonitorUpdateId arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = MonitorUpdateId_clone_ptr(&arg_conv); + intptr_t ret_val = MonitorUpdateId_clone_ptr(&arg_conv); return ret_val; } @@ -18555,11 +18568,11 @@ uint32_t __attribute__((export_name("TS_MonitorUpdateId_clone"))) TS_MonitorUpd orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18590,7 +18603,7 @@ jboolean __attribute__((export_name("TS_MonitorUpdateId_eq"))) TS_MonitorUpdate void __attribute__((export_name("TS_Persist_free"))) TS_Persist_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18614,31 +18627,31 @@ void __attribute__((export_name("TS_ChainMonitor_free"))) TS_ChainMonitor_free( } uint32_t __attribute__((export_name("TS_ChainMonitor_new"))) TS_ChainMonitor_new(uint32_t chain_source, uint32_t broadcaster, uint32_t logger, uint32_t feeest, uint32_t persister) { - void* chain_source_ptr = (void*)(((uint64_t)chain_source) & ~1); + void* chain_source_ptr = (void*)(((uintptr_t)chain_source) & ~1); CHECK_ACCESS(chain_source_ptr); LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); // Warning: we may need a move here but no clone is available for LDKCOption_FilterZ if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { // Manually implement clone for Java trait instances } - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - void* feeest_ptr = (void*)(((uint64_t)feeest) & ~1); + void* feeest_ptr = (void*)(((uintptr_t)feeest) & ~1); CHECK_ACCESS(feeest_ptr); LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); - void* persister_ptr = (void*)(((uint64_t)persister) & ~1); + void* persister_ptr = (void*)(((uintptr_t)persister) & ~1); CHECK_ACCESS(persister_ptr); LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18656,7 +18669,7 @@ uint32_tArray __attribute__((export_name("TS_ChainMonitor_get_claimable_balance ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); else ignored_channels_constr.data = NULL; - uint32_t* ignored_channels_vals = ignored_channels->elems; + uint32_t* ignored_channels_vals = ignored_channels->elems /* XXX ignored_channels leaks */; for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { uint32_t ignored_channels_conv_16 = ignored_channels_vals[q]; LDKChannelDetails ignored_channels_conv_16_conv; @@ -18668,12 +18681,12 @@ uint32_tArray __attribute__((export_name("TS_ChainMonitor_get_claimable_balance } LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t j = 0; j < ret_var.datalen; j++) { LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_conv_9_copy = ret_var.data[j]; - uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy; + uintptr_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; ret_arr_ptr[j] = ret_conv_9_ref; } @@ -18693,7 +18706,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_get_monitor"))) TS_ChainMo funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_tArray __attribute__((export_name("TS_ChainMonitor_list_monitors"))) TS_ChainMonitor_list_monitors(uint32_t this_arg) { @@ -18703,15 +18716,15 @@ uint32_tArray __attribute__((export_name("TS_ChainMonitor_list_monitors"))) TS_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t k = 0; k < ret_var.datalen; k++) { LDKOutPoint ret_conv_10_var = ret_var.data[k]; - uint64_t ret_conv_10_ref = 0; - CHECK((((uint64_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_10_ref = 0; + CHECK((((uintptr_t)ret_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var); - ret_conv_10_ref = (uint64_t)ret_conv_10_var.inner; + ret_conv_10_ref = (uintptr_t)ret_conv_10_var.inner; if (ret_conv_10_var.is_owned) { ret_conv_10_ref |= 1; } @@ -18739,7 +18752,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_channel_monitor_updated")) completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChainMonitor_as_Listen"))) TS_ChainMonitor_as_Listen(uint32_t this_arg) { @@ -18749,7 +18762,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_as_Listen"))) TS_ChainMoni CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChainMonitor_as_Confirm"))) TS_ChainMonitor_as_Confirm(uint32_t this_arg) { @@ -18759,7 +18772,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_as_Confirm"))) TS_ChainMon CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChainMonitor_as_Watch"))) TS_ChainMonitor_as_Watch(uint32_t this_arg) { @@ -18769,7 +18782,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_as_Watch"))) TS_ChainMonit CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChainMonitor_as_EventsProvider"))) TS_ChainMonitor_as_EventsProvider(uint32_t this_arg) { @@ -18779,7 +18792,7 @@ uint32_t __attribute__((export_name("TS_ChainMonitor_as_EventsProvider"))) TS_C CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_ChannelMonitorUpdate_free"))) TS_ChannelMonitorUpdate_free(uint32_t this_obj) { @@ -18809,22 +18822,22 @@ void __attribute__((export_name("TS_ChannelMonitorUpdate_set_update_id"))) TS_C static inline uintptr_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone_ptr"))) TS_ChannelMonitorUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone_ptr"))) TS_ChannelMonitorUpdate_clone_ptr(uint32_t arg) { LDKChannelMonitorUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelMonitorUpdate_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelMonitorUpdate_clone_ptr(&arg_conv); return ret_val; } @@ -18834,11 +18847,11 @@ uint32_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone"))) TS_Chann orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -18851,7 +18864,7 @@ int8_tArray __attribute__((export_name("TS_ChannelMonitorUpdate_write"))) TS_Ch obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -18860,15 +18873,15 @@ int8_tArray __attribute__((export_name("TS_ChannelMonitorUpdate_write"))) TS_Ch uint32_t __attribute__((export_name("TS_ChannelMonitorUpdate_read"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); *ret_conv = ChannelMonitorUpdate_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_MonitorEvent_free"))) TS_MonitorEvent_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -18878,12 +18891,12 @@ void __attribute__((export_name("TS_MonitorEvent_free"))) TS_MonitorEvent_free( static inline uintptr_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_MonitorEvent_clone_ptr"))) TS_MonitorEvent_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_MonitorEvent_clone_ptr"))) TS_MonitorEvent_clone_ptr(uint32_t arg) { LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)arg; - int64_t ret_val = MonitorEvent_clone_ptr(arg_conv); + intptr_t ret_val = MonitorEvent_clone_ptr(arg_conv); return ret_val; } @@ -18891,7 +18904,7 @@ uint32_t __attribute__((export_name("TS_MonitorEvent_clone"))) TS_MonitorEvent_ LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)orig; LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -18903,7 +18916,7 @@ uint32_t __attribute__((export_name("TS_MonitorEvent_htlcevent"))) TS_MonitorEv a_conv = HTLCUpdate_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_htlcevent(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -18915,7 +18928,7 @@ uint32_t __attribute__((export_name("TS_MonitorEvent_commitment_tx_confirmed")) a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -18927,7 +18940,7 @@ uint32_t __attribute__((export_name("TS_MonitorEvent_update_completed"))) TS_Mo funding_txo_conv = OutPoint_clone(&funding_txo_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -18939,14 +18952,14 @@ uint32_t __attribute__((export_name("TS_MonitorEvent_update_failed"))) TS_Monit a_conv = OutPoint_clone(&a_conv); LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_copy = MonitorEvent_update_failed(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEvent_write(uint32_t obj) { LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)obj; LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -18955,10 +18968,10 @@ int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEve uint32_t __attribute__((export_name("TS_MonitorEvent_read"))) TS_MonitorEvent_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); *ret_conv = MonitorEvent_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_HTLCUpdate_free"))) TS_HTLCUpdate_free(uint32_t this_obj) { @@ -18971,22 +18984,22 @@ void __attribute__((export_name("TS_HTLCUpdate_free"))) TS_HTLCUpdate_free(uint static inline uintptr_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_HTLCUpdate_clone_ptr"))) TS_HTLCUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_HTLCUpdate_clone_ptr"))) TS_HTLCUpdate_clone_ptr(uint32_t arg) { LDKHTLCUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = HTLCUpdate_clone_ptr(&arg_conv); + intptr_t ret_val = HTLCUpdate_clone_ptr(&arg_conv); return ret_val; } @@ -18996,11 +19009,11 @@ uint32_t __attribute__((export_name("TS_HTLCUpdate_clone"))) TS_HTLCUpdate_clon orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19013,7 +19026,7 @@ int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_w obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -19022,15 +19035,15 @@ int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_w uint32_t __attribute__((export_name("TS_HTLCUpdate_read"))) TS_HTLCUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); *ret_conv = HTLCUpdate_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_Balance_free"))) TS_Balance_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -19040,12 +19053,12 @@ void __attribute__((export_name("TS_Balance_free"))) TS_Balance_free(uint32_t t static inline uintptr_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_Balance_clone_ptr"))) TS_Balance_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Balance_clone_ptr"))) TS_Balance_clone_ptr(uint32_t arg) { LDKBalance* arg_conv = (LDKBalance*)arg; - int64_t ret_val = Balance_clone_ptr(arg_conv); + intptr_t ret_val = Balance_clone_ptr(arg_conv); return ret_val; } @@ -19053,35 +19066,35 @@ uint32_t __attribute__((export_name("TS_Balance_clone"))) TS_Balance_clone(uint LDKBalance* orig_conv = (LDKBalance*)orig; LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Balance_claimable_on_channel_close"))) TS_Balance_claimable_on_channel_close(int64_t claimable_amount_satoshis) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Balance_claimable_awaiting_confirmations"))) TS_Balance_claimable_awaiting_confirmations(int64_t claimable_amount_satoshis, int32_t confirmation_height) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_Balance_contentious_claimable"))) TS_Balance_contentious_claimable(int64_t claimable_amount_satoshis, int32_t timeout_height) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_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) { LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_copy = Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -19102,22 +19115,22 @@ void __attribute__((export_name("TS_ChannelMonitor_free"))) TS_ChannelMonitor_f static inline uintptr_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelMonitor_clone_ptr"))) TS_ChannelMonitor_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelMonitor_clone_ptr"))) TS_ChannelMonitor_clone_ptr(uint32_t arg) { LDKChannelMonitor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelMonitor_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelMonitor_clone_ptr(&arg_conv); return ret_val; } @@ -19127,11 +19140,11 @@ uint32_t __attribute__((export_name("TS_ChannelMonitor_clone"))) TS_ChannelMoni orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19144,7 +19157,7 @@ int8_tArray __attribute__((export_name("TS_ChannelMonitor_write"))) TS_ChannelM obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -19159,18 +19172,18 @@ uint32_t __attribute__((export_name("TS_ChannelMonitor_update_monitor"))) TS_Ch updates_conv.inner = (void*)(updates & (~1)); updates_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv); - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); if (!(broadcaster & 1)) { CHECK_ACCESS(broadcaster_ptr); } LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); if (!(fee_estimator & 1)) { CHECK_ACCESS(fee_estimator_ptr); } LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int64_t __attribute__((export_name("TS_ChannelMonitor_get_latest_update_id"))) TS_ChannelMonitor_get_latest_update_id(uint32_t this_arg) { @@ -19189,7 +19202,7 @@ uint32_t __attribute__((export_name("TS_ChannelMonitor_get_funding_txo"))) TS_C CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ"); *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); - return ((uint64_t)ret_conv); + return ((uintptr_t)ret_conv); } uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_outputs_to_watch"))) TS_ChannelMonitor_get_outputs_to_watch(uint32_t this_arg) { @@ -19199,12 +19212,12 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_outputs_to_watc CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t o = 0; o < ret_var.datalen; o++) { LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ"); *ret_conv_40_conv = ret_var.data[o]; - ret_arr_ptr[o] = ((uint64_t)ret_conv_40_conv); + ret_arr_ptr[o] = ((uintptr_t)ret_conv_40_conv); } FREE(ret_var.data); @@ -19216,7 +19229,7 @@ void __attribute__((export_name("TS_ChannelMonitor_load_outputs_to_watch"))) TS this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* filter_ptr = (void*)(((uint64_t)filter) & ~1); + void* filter_ptr = (void*)(((uintptr_t)filter) & ~1); if (!(filter & 1)) { CHECK_ACCESS(filter_ptr); } LDKFilter* filter_conv = (LDKFilter*)filter_ptr; ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv); @@ -19229,12 +19242,12 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pendi CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t o = 0; o < ret_var.datalen; o++) { LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); *ret_conv_14_copy = ret_var.data[o]; - uint64_t ret_conv_14_ref = (uint64_t)ret_conv_14_copy; + uintptr_t ret_conv_14_ref = (uintptr_t)ret_conv_14_copy; ret_arr_ptr[o] = ret_conv_14_ref; } @@ -19249,12 +19262,12 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pendi CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t h = 0; h < ret_var.datalen; h++) { LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_conv_7_copy = ret_var.data[h]; - uint64_t ret_conv_7_ref = (uint64_t)ret_conv_7_copy; + uintptr_t ret_conv_7_ref = (uintptr_t)ret_conv_7_copy; ret_arr_ptr[h] = ret_conv_7_ref; } @@ -19267,16 +19280,16 @@ ptrArray __attribute__((export_name("TS_ChannelMonitor_get_latest_holder_commit this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); if (!(logger & 1)) { CHECK_ACCESS(logger_ptr); } LDKLogger* logger_conv = (LDKLogger*)logger_ptr; LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { LDKTransaction ret_conv_12_var = ret_var.data[m]; - int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen); + int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__); memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen); Transaction_free(ret_conv_12_var); ret_arr_ptr[m] = ret_conv_12_arr; @@ -19293,7 +19306,7 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_block_connected"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; txdata_constr.datalen = txdata->arr_len; @@ -19301,32 +19314,32 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_block_connected"))) txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); else txdata_constr.data = NULL; - uint32_t* txdata_vals = txdata->elems; + uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */; for (size_t c = 0; c < txdata_constr.datalen; c++) { uint32_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1); + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); CHECK_ACCESS(txdata_conv_28_ptr); LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1)); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); txdata_constr.data[c] = txdata_conv_28_conv; } - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); 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); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t n = 0; n < ret_var.datalen; n++) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv); + ret_arr_ptr[n] = ((uintptr_t)ret_conv_39_conv); } FREE(ret_var.data); @@ -19340,15 +19353,15 @@ void __attribute__((export_name("TS_ChannelMonitor_block_disconnected"))) TS_Ch CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); @@ -19361,7 +19374,7 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_transactions_confir CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; txdata_constr.datalen = txdata->arr_len; @@ -19369,32 +19382,32 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_transactions_confir txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); else txdata_constr.data = NULL; - uint32_t* txdata_vals = txdata->elems; + uint32_t* txdata_vals = txdata->elems /* XXX txdata leaks */; for (size_t c = 0; c < txdata_constr.datalen; c++) { uint32_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = (void*)(((uint64_t)txdata_conv_28) & ~1); + void* txdata_conv_28_ptr = (void*)(((uintptr_t)txdata_conv_28) & ~1); CHECK_ACCESS(txdata_conv_28_ptr); LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uint64_t)txdata_conv_28) & ~1)); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)(((uintptr_t)txdata_conv_28) & ~1)); txdata_constr.data[c] = txdata_conv_28_conv; } - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); 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); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t n = 0; n < ret_var.datalen; n++) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv); + ret_arr_ptr[n] = ((uintptr_t)ret_conv_39_conv); } FREE(ret_var.data); @@ -19408,15 +19421,15 @@ void __attribute__((export_name("TS_ChannelMonitor_transaction_unconfirmed"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char txid_arr[32]; CHECK(txid->arr_len == 32); - memcpy(txid_arr, txid->elems, 32); + memcpy(txid_arr, txid->elems, 32); FREE(txid); unsigned char (*txid_ref)[32] = &txid_arr; - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); @@ -19429,25 +19442,25 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_best_block_updated" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char header_arr[80]; CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); + memcpy(header_arr, header->elems, 80); FREE(header); unsigned char (*header_ref)[80] = &header_arr; - void* broadcaster_ptr = (void*)(((uint64_t)broadcaster) & ~1); + void* broadcaster_ptr = (void*)(((uintptr_t)broadcaster) & ~1); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t n = 0; n < ret_var.datalen; n++) { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_conv_39_conv = ret_var.data[n]; - ret_arr_ptr[n] = ((uint64_t)ret_conv_39_conv); + ret_arr_ptr[n] = ((uintptr_t)ret_conv_39_conv); } FREE(ret_var.data); @@ -19461,10 +19474,10 @@ ptrArray __attribute__((export_name("TS_ChannelMonitor_get_relevant_txids"))) T CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { - int8_tArray ret_conv_12_arr = init_int8_tArray(32); + int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__); memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32); ret_arr_ptr[m] = ret_conv_12_arr; } @@ -19479,11 +19492,11 @@ uint32_t __attribute__((export_name("TS_ChannelMonitor_current_best_block"))) T this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19497,12 +19510,12 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_claimable_balan CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t j = 0; j < ret_var.datalen; j++) { LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); *ret_conv_9_copy = ret_var.data[j]; - uint64_t ret_conv_9_ref = (uint64_t)ret_conv_9_copy; + uintptr_t ret_conv_9_ref = (uintptr_t)ret_conv_9_copy; ret_arr_ptr[j] = ret_conv_9_ref; } @@ -19513,13 +19526,13 @@ uint32_tArray __attribute__((export_name("TS_ChannelMonitor_get_claimable_balan uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_read"))) TS_C2Tuple_BlockHashChannelMonitorZ_read(int8_tArray ser, uint32_t arg) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_ptr = (void*)(((uint64_t)arg) & ~1); + ser_ref.data = ser->elems /* XXX ser leaks */; + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr; LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ"); *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_OutPoint_free"))) TS_OutPoint_free(uint32_t this_obj) { @@ -19535,7 +19548,7 @@ int8_tArray __attribute__((export_name("TS_OutPoint_get_txid"))) TS_OutPoint_ge this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *OutPoint_get_txid(&this_ptr_conv), 32); return ret_arr; } @@ -19547,7 +19560,7 @@ void __attribute__((export_name("TS_OutPoint_set_txid"))) TS_OutPoint_set_txid( CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); OutPoint_set_txid(&this_ptr_conv, val_ref); } @@ -19571,13 +19584,13 @@ void __attribute__((export_name("TS_OutPoint_set_index"))) TS_OutPoint_set_inde uint32_t __attribute__((export_name("TS_OutPoint_new"))) TS_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) { LDKThirtyTwoBytes txid_arg_ref; CHECK(txid_arg->arr_len == 32); - memcpy(txid_arg_ref.data, txid_arg->elems, 32); + memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19586,22 +19599,22 @@ uint32_t __attribute__((export_name("TS_OutPoint_new"))) TS_OutPoint_new(int8_t static inline uintptr_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { LDKOutPoint ret_var = OutPoint_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_OutPoint_clone_ptr"))) TS_OutPoint_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_OutPoint_clone_ptr"))) TS_OutPoint_clone_ptr(uint32_t arg) { LDKOutPoint arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = OutPoint_clone_ptr(&arg_conv); + intptr_t ret_val = OutPoint_clone_ptr(&arg_conv); return ret_val; } @@ -19611,11 +19624,11 @@ uint32_t __attribute__((export_name("TS_OutPoint_clone"))) TS_OutPoint_clone(ui orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOutPoint ret_var = OutPoint_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19649,7 +19662,7 @@ int8_tArray __attribute__((export_name("TS_OutPoint_to_channel_id"))) TS_OutPoi this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, OutPoint_to_channel_id(&this_arg_conv).data, 32); return ret_arr; } @@ -19660,7 +19673,7 @@ int8_tArray __attribute__((export_name("TS_OutPoint_write"))) TS_OutPoint_write obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -19669,10 +19682,10 @@ int8_tArray __attribute__((export_name("TS_OutPoint_write"))) TS_OutPoint_write uint32_t __attribute__((export_name("TS_OutPoint_read"))) TS_OutPoint_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); *ret_conv = OutPoint_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_free"))) TS_DelayedPaymentOutputDescriptor_free(uint32_t this_obj) { @@ -19689,11 +19702,11 @@ uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_outp this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19718,7 +19731,7 @@ int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_p this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -19730,7 +19743,7 @@ void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_per_comm CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref); } @@ -19756,10 +19769,10 @@ void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_output") this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1)); + val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } @@ -19768,7 +19781,7 @@ int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_r this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -19780,7 +19793,7 @@ void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_revocati CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref); } @@ -19789,7 +19802,7 @@ int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_c this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); return ret_arr; } @@ -19801,7 +19814,7 @@ void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } @@ -19830,23 +19843,23 @@ uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_new"))) outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); LDKPublicKey per_commitment_point_arg_ref; CHECK(per_commitment_point_arg->arr_len == 33); - memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); - void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1); + memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg); + void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); CHECK_ACCESS(output_arg_ptr); LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1)); + output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); LDKPublicKey revocation_pubkey_arg_ref; CHECK(revocation_pubkey_arg->arr_len == 33); - memcpy(revocation_pubkey_arg_ref.compressed_form, revocation_pubkey_arg->elems, 33); + memcpy(revocation_pubkey_arg_ref.compressed_form, revocation_pubkey_arg->elems, 33); FREE(revocation_pubkey_arg); LDKThirtyTwoBytes channel_keys_id_arg_ref; CHECK(channel_keys_id_arg->arr_len == 32); - memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); + memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19855,22 +19868,22 @@ uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_new"))) static inline uintptr_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) { LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone_ptr"))) TS_DelayedPaymentOutputDescriptor_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone_ptr"))) TS_DelayedPaymentOutputDescriptor_clone_ptr(uint32_t arg) { LDKDelayedPaymentOutputDescriptor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); + intptr_t ret_val = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_val; } @@ -19880,11 +19893,11 @@ uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone")) orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19897,7 +19910,7 @@ int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_write obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -19906,10 +19919,10 @@ int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_write uint32_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_read"))) TS_DelayedPaymentOutputDescriptor_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_free"))) TS_StaticPaymentOutputDescriptor_free(uint32_t this_obj) { @@ -19926,11 +19939,11 @@ uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_outpo this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -19955,10 +19968,10 @@ void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_output")) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKTxOut val_conv = *(LDKTxOut*)(val_ptr); - val_conv = TxOut_clone((LDKTxOut*)(((uint64_t)val) & ~1)); + val_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)val) & ~1)); StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv); } @@ -19967,7 +19980,7 @@ int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_ch this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32); return ret_arr; } @@ -19979,7 +19992,7 @@ void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_k CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref); } @@ -20006,19 +20019,19 @@ uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_new"))) T outpoint_arg_conv.is_owned = (outpoint_arg & 1) || (outpoint_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - void* output_arg_ptr = (void*)(((uint64_t)output_arg) & ~1); + void* output_arg_ptr = (void*)(((uintptr_t)output_arg) & ~1); CHECK_ACCESS(output_arg_ptr); LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr); - output_arg_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output_arg) & ~1)); + output_arg_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output_arg) & ~1)); LDKThirtyTwoBytes channel_keys_id_arg_ref; CHECK(channel_keys_id_arg->arr_len == 32); - memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); + memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg); LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20027,22 +20040,22 @@ uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_new"))) T static inline uintptr_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) { LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone_ptr"))) TS_StaticPaymentOutputDescriptor_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone_ptr"))) TS_StaticPaymentOutputDescriptor_clone_ptr(uint32_t arg) { LDKStaticPaymentOutputDescriptor arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); + intptr_t ret_val = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv); return ret_val; } @@ -20052,11 +20065,11 @@ uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone"))) orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20069,7 +20082,7 @@ int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_write" obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -20078,15 +20091,15 @@ int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_write" uint32_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_read"))) TS_StaticPaymentOutputDescriptor_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ"); *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_SpendableOutputDescriptor_free"))) TS_SpendableOutputDescriptor_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -20096,12 +20109,12 @@ void __attribute__((export_name("TS_SpendableOutputDescriptor_free"))) TS_Spend static inline uintptr_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) { LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone_ptr"))) TS_SpendableOutputDescriptor_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone_ptr"))) TS_SpendableOutputDescriptor_clone_ptr(uint32_t arg) { LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)arg; - int64_t ret_val = SpendableOutputDescriptor_clone_ptr(arg_conv); + intptr_t ret_val = SpendableOutputDescriptor_clone_ptr(arg_conv); return ret_val; } @@ -20109,7 +20122,7 @@ uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone"))) TS_ LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)orig; LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -20119,13 +20132,13 @@ uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_output outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); outpoint_conv = OutPoint_clone(&outpoint_conv); - void* output_ptr = (void*)(((uint64_t)output) & ~1); + void* output_ptr = (void*)(((uintptr_t)output) & ~1); CHECK_ACCESS(output_ptr); LDKTxOut output_conv = *(LDKTxOut*)(output_ptr); - output_conv = TxOut_clone((LDKTxOut*)(((uint64_t)output) & ~1)); + output_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)output) & ~1)); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -20137,7 +20150,7 @@ uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_delayed_payme a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -20149,14 +20162,14 @@ uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_paymen a_conv = StaticPaymentOutputDescriptor_clone(&a_conv); LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_SpendableOutputDescriptor_write"))) TS_SpendableOutputDescriptor_write(uint32_t obj) { LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj; LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -20165,15 +20178,15 @@ int8_tArray __attribute__((export_name("TS_SpendableOutputDescriptor_write"))) uint32_t __attribute__((export_name("TS_SpendableOutputDescriptor_read"))) TS_SpendableOutputDescriptor_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ"); *ret_conv = SpendableOutputDescriptor_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_BaseSign_free"))) TS_BaseSign_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -20183,28 +20196,28 @@ void __attribute__((export_name("TS_BaseSign_free"))) TS_BaseSign_free(uint32_t static inline uintptr_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) { LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = Sign_clone(arg); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } -int64_t __attribute__((export_name("TS_Sign_clone_ptr"))) TS_Sign_clone_ptr(uint32_t arg) { - void* arg_ptr = (void*)(((uint64_t)arg) & ~1); +intptr_t __attribute__((export_name("TS_Sign_clone_ptr"))) TS_Sign_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } LDKSign* arg_conv = (LDKSign*)arg_ptr; - int64_t ret_val = Sign_clone_ptr(arg_conv); + intptr_t ret_val = Sign_clone_ptr(arg_conv); return ret_val; } uint32_t __attribute__((export_name("TS_Sign_clone"))) TS_Sign_clone(uint32_t orig) { - void* orig_ptr = (void*)(((uint64_t)orig) & ~1); + void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } LDKSign* orig_conv = (LDKSign*)orig_ptr; LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = Sign_clone(orig_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_Sign_free"))) TS_Sign_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -20213,7 +20226,7 @@ void __attribute__((export_name("TS_Sign_free"))) TS_Sign_free(uint32_t this_pt void __attribute__((export_name("TS_KeysInterface_free"))) TS_KeysInterface_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -20233,7 +20246,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_funding_key"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_funding_key(&this_ptr_conv), 32); return ret_arr; } @@ -20245,7 +20258,7 @@ void __attribute__((export_name("TS_InMemorySigner_set_funding_key"))) TS_InMem CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); InMemorySigner_set_funding_key(&this_ptr_conv, val_ref); } @@ -20254,7 +20267,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_revocation_base_k this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32); return ret_arr; } @@ -20266,7 +20279,7 @@ void __attribute__((export_name("TS_InMemorySigner_set_revocation_base_key"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref); } @@ -20275,7 +20288,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_payment_key"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_payment_key(&this_ptr_conv), 32); return ret_arr; } @@ -20287,7 +20300,7 @@ void __attribute__((export_name("TS_InMemorySigner_set_payment_key"))) TS_InMem CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); InMemorySigner_set_payment_key(&this_ptr_conv, val_ref); } @@ -20296,7 +20309,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_delayed_payment_b this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32); return ret_arr; } @@ -20308,7 +20321,7 @@ void __attribute__((export_name("TS_InMemorySigner_set_delayed_payment_base_key CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref); } @@ -20317,7 +20330,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_htlc_base_key"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32); return ret_arr; } @@ -20329,7 +20342,7 @@ void __attribute__((export_name("TS_InMemorySigner_set_htlc_base_key"))) TS_InM CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSecretKey val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.bytes, val->elems, 32); + memcpy(val_ref.bytes, val->elems, 32); FREE(val); InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref); } @@ -20338,7 +20351,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_get_commitment_seed") this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32); return ret_arr; } @@ -20350,28 +20363,28 @@ void __attribute__((export_name("TS_InMemorySigner_set_commitment_seed"))) TS_I CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref); } static inline uintptr_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) { LDKInMemorySigner ret_var = InMemorySigner_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_InMemorySigner_clone_ptr"))) TS_InMemorySigner_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_InMemorySigner_clone_ptr"))) TS_InMemorySigner_clone_ptr(uint32_t arg) { LDKInMemorySigner arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = InMemorySigner_clone_ptr(&arg_conv); + intptr_t ret_val = InMemorySigner_clone_ptr(&arg_conv); return ret_val; } @@ -20381,11 +20394,11 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_clone"))) TS_InMemorySig orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20395,31 +20408,31 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_clone"))) TS_InMemorySig uint32_t __attribute__((export_name("TS_InMemorySigner_new"))) TS_InMemorySigner_new(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) { LDKSecretKey funding_key_ref; CHECK(funding_key->arr_len == 32); - memcpy(funding_key_ref.bytes, funding_key->elems, 32); + memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key); LDKSecretKey revocation_base_key_ref; CHECK(revocation_base_key->arr_len == 32); - memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); + memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); FREE(revocation_base_key); LDKSecretKey payment_key_ref; CHECK(payment_key->arr_len == 32); - memcpy(payment_key_ref.bytes, payment_key->elems, 32); + memcpy(payment_key_ref.bytes, payment_key->elems, 32); FREE(payment_key); LDKSecretKey delayed_payment_base_key_ref; CHECK(delayed_payment_base_key->arr_len == 32); - memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); + memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); FREE(delayed_payment_base_key); LDKSecretKey htlc_base_key_ref; CHECK(htlc_base_key->arr_len == 32); - memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); + memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); FREE(htlc_base_key); LDKThirtyTwoBytes commitment_seed_ref; CHECK(commitment_seed->arr_len == 32); - memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); + memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); FREE(commitment_seed); LDKThirtyTwoBytes channel_keys_id_ref; CHECK(channel_keys_id->arr_len == 32); - memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); + memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id); LDKInMemorySigner ret_var = InMemorySigner_new(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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20432,11 +20445,11 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_counterparty_pubkeys"))) this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20476,11 +20489,11 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_funding_outpoint"))) TS_ this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20493,11 +20506,11 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_get_channel_parameters") this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20513,7 +20526,7 @@ jboolean __attribute__((export_name("TS_InMemorySigner_opt_anchors"))) TS_InMem return ret_val; } -uint32_t __attribute__((export_name("TS_InMemorySigner_sign_counterparty_payment_input"))) TS_InMemorySigner_sign_counterparty_payment_input(uint32_t this_arg, int8_tArray spend_tx, int64_t input_idx, uint32_t descriptor) { +uint32_t __attribute__((export_name("TS_InMemorySigner_sign_counterparty_payment_input"))) TS_InMemorySigner_sign_counterparty_payment_input(uint32_t this_arg, int8_tArray spend_tx, intptr_t input_idx, uint32_t descriptor) { LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; @@ -20521,7 +20534,7 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_sign_counterparty_paymen LDKTransaction spend_tx_ref; spend_tx_ref.datalen = spend_tx->arr_len; spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); + memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); spend_tx_ref.data_is_owned = true; LDKStaticPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); @@ -20529,10 +20542,10 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_sign_counterparty_paymen CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } -uint32_t __attribute__((export_name("TS_InMemorySigner_sign_dynamic_p2wsh_input"))) TS_InMemorySigner_sign_dynamic_p2wsh_input(uint32_t this_arg, int8_tArray spend_tx, int64_t input_idx, uint32_t descriptor) { +uint32_t __attribute__((export_name("TS_InMemorySigner_sign_dynamic_p2wsh_input"))) TS_InMemorySigner_sign_dynamic_p2wsh_input(uint32_t this_arg, int8_tArray spend_tx, intptr_t input_idx, uint32_t descriptor) { LDKInMemorySigner this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; @@ -20540,7 +20553,7 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_sign_dynamic_p2wsh_input LDKTransaction spend_tx_ref; spend_tx_ref.datalen = spend_tx->arr_len; spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); + memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx); spend_tx_ref.data_is_owned = true; LDKDelayedPaymentOutputDescriptor descriptor_conv; descriptor_conv.inner = (void*)(descriptor & (~1)); @@ -20548,7 +20561,7 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_sign_dynamic_p2wsh_input CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv); LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ"); *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_InMemorySigner_as_BaseSign"))) TS_InMemorySigner_as_BaseSign(uint32_t this_arg) { @@ -20558,7 +20571,7 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_as_BaseSign"))) TS_InMem CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign"); *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_InMemorySigner_as_Sign"))) TS_InMemorySigner_as_Sign(uint32_t this_arg) { @@ -20568,7 +20581,7 @@ uint32_t __attribute__((export_name("TS_InMemorySigner_as_Sign"))) TS_InMemoryS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); *ret_ret = InMemorySigner_as_Sign(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemorySigner_write(uint32_t obj) { @@ -20577,7 +20590,7 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemory obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -20586,10 +20599,10 @@ int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemory uint32_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ"); *ret_conv = InMemorySigner_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_KeysManager_free"))) TS_KeysManager_free(uint32_t this_obj) { @@ -20603,14 +20616,14 @@ void __attribute__((export_name("TS_KeysManager_free"))) TS_KeysManager_free(ui uint32_t __attribute__((export_name("TS_KeysManager_new"))) TS_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) { unsigned char seed_arr[32]; CHECK(seed->arr_len == 32); - memcpy(seed_arr, seed->elems, 32); + memcpy(seed_arr, seed->elems, 32); FREE(seed); unsigned char (*seed_ref)[32] = &seed_arr; LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20624,14 +20637,14 @@ uint32_t __attribute__((export_name("TS_KeysManager_derive_channel_keys"))) TS_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char params_arr[32]; CHECK(params->arr_len == 32); - memcpy(params_arr, params->elems, 32); + memcpy(params_arr, params->elems, 32); FREE(params); unsigned char (*params_ref)[32] = ¶ms_arr; LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20649,13 +20662,13 @@ uint32_t __attribute__((export_name("TS_KeysManager_spend_spendable_outputs"))) descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else descriptors_constr.data = NULL; - uint32_t* descriptors_vals = descriptors->elems; + uint32_t* descriptors_vals = descriptors->elems /* XXX descriptors leaks */; for (size_t b = 0; b < descriptors_constr.datalen; b++) { uint32_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = (void*)(((uint64_t)descriptors_conv_27) & ~1); + void* descriptors_conv_27_ptr = (void*)(((uintptr_t)descriptors_conv_27) & ~1); CHECK_ACCESS(descriptors_conv_27_ptr); LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)descriptors_conv_27) & ~1)); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uintptr_t)descriptors_conv_27) & ~1)); descriptors_constr.data[b] = descriptors_conv_27_conv; } LDKCVec_TxOutZ outputs_constr; @@ -20664,22 +20677,22 @@ uint32_t __attribute__((export_name("TS_KeysManager_spend_spendable_outputs"))) outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); else outputs_constr.data = NULL; - uint32_t* outputs_vals = outputs->elems; + uint32_t* outputs_vals = outputs->elems /* XXX outputs leaks */; for (size_t h = 0; h < outputs_constr.datalen; h++) { uint32_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = (void*)(((uint64_t)outputs_conv_7) & ~1); + void* outputs_conv_7_ptr = (void*)(((uintptr_t)outputs_conv_7) & ~1); CHECK_ACCESS(outputs_conv_7_ptr); LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uint64_t)outputs_conv_7) & ~1)); + outputs_conv_7_conv = TxOut_clone((LDKTxOut*)(((uintptr_t)outputs_conv_7) & ~1)); outputs_constr.data[h] = outputs_conv_7_conv; } LDKCVec_u8Z change_destination_script_ref; change_destination_script_ref.datalen = change_destination_script->arr_len; change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); + memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script); LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_KeysManager_as_KeysInterface"))) TS_KeysManager_as_KeysInterface(uint32_t this_arg) { @@ -20689,7 +20702,7 @@ uint32_t __attribute__((export_name("TS_KeysManager_as_KeysInterface"))) TS_Key CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_ChannelManager_free"))) TS_ChannelManager_free(uint32_t this_obj) { @@ -20732,11 +20745,11 @@ uint32_t __attribute__((export_name("TS_ChainParameters_get_best_block"))) TS_C this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20764,11 +20777,11 @@ uint32_t __attribute__((export_name("TS_ChainParameters_new"))) TS_ChainParamet CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20777,22 +20790,22 @@ uint32_t __attribute__((export_name("TS_ChainParameters_new"))) TS_ChainParamet static inline uintptr_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { LDKChainParameters ret_var = ChainParameters_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChainParameters_clone_ptr"))) TS_ChainParameters_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChainParameters_clone_ptr"))) TS_ChainParameters_clone_ptr(uint32_t arg) { LDKChainParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChainParameters_clone_ptr(&arg_conv); + intptr_t ret_val = ChainParameters_clone_ptr(&arg_conv); return ret_val; } @@ -20802,11 +20815,11 @@ uint32_t __attribute__((export_name("TS_ChainParameters_clone"))) TS_ChainParam orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20874,11 +20887,11 @@ void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_cltv_expiry_ uint32_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) { LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20887,22 +20900,22 @@ uint32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_new"))) TS_C static inline uintptr_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone_ptr"))) TS_CounterpartyForwardingInfo_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone_ptr"))) TS_CounterpartyForwardingInfo_clone_ptr(uint32_t arg) { LDKCounterpartyForwardingInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = CounterpartyForwardingInfo_clone_ptr(&arg_conv); + intptr_t ret_val = CounterpartyForwardingInfo_clone_ptr(&arg_conv); return ret_val; } @@ -20912,11 +20925,11 @@ uint32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone"))) TS orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -20936,7 +20949,7 @@ int8_tArray __attribute__((export_name("TS_ChannelCounterparty_get_node_id"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -20948,7 +20961,7 @@ void __attribute__((export_name("TS_ChannelCounterparty_set_node_id"))) TS_Chan CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); } @@ -20958,11 +20971,11 @@ uint32_t __attribute__((export_name("TS_ChannelCounterparty_get_features"))) TS this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21005,12 +21018,12 @@ uint32_t __attribute__((export_name("TS_ChannelCounterparty_get_forwarding_info this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21034,7 +21047,7 @@ void __attribute__((export_name("TS_ChannelCounterparty_set_forwarding_info"))) uint32_t __attribute__((export_name("TS_ChannelCounterparty_new"))) TS_ChannelCounterparty_new(int8_tArray node_id_arg, uint32_t features_arg, int64_t unspendable_punishment_reserve_arg, uint32_t forwarding_info_arg) { LDKPublicKey node_id_arg_ref; CHECK(node_id_arg->arr_len == 33); - memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); + memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); LDKInitFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); @@ -21046,11 +21059,11 @@ uint32_t __attribute__((export_name("TS_ChannelCounterparty_new"))) TS_ChannelC CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21059,22 +21072,22 @@ uint32_t __attribute__((export_name("TS_ChannelCounterparty_new"))) TS_ChannelC static inline uintptr_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelCounterparty_clone_ptr"))) TS_ChannelCounterparty_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelCounterparty_clone_ptr"))) TS_ChannelCounterparty_clone_ptr(uint32_t arg) { LDKChannelCounterparty arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelCounterparty_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelCounterparty_clone_ptr(&arg_conv); return ret_val; } @@ -21084,11 +21097,11 @@ uint32_t __attribute__((export_name("TS_ChannelCounterparty_clone"))) TS_Channe orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21108,7 +21121,7 @@ int8_tArray __attribute__((export_name("TS_ChannelDetails_get_channel_id"))) TS this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ChannelDetails_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -21120,7 +21133,7 @@ void __attribute__((export_name("TS_ChannelDetails_set_channel_id"))) TS_Channe CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ChannelDetails_set_channel_id(&this_ptr_conv, val_ref); } @@ -21130,11 +21143,11 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_counterparty"))) TS_ this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21160,12 +21173,12 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_funding_txo"))) TS_C this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21193,7 +21206,7 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_short_channel_id"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21202,10 +21215,10 @@ void __attribute__((export_name("TS_ChannelDetails_set_short_channel_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); } @@ -21233,7 +21246,7 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_unspendable_punishme CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21242,10 +21255,10 @@ void __attribute__((export_name("TS_ChannelDetails_set_unspendable_punishment_r this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); } @@ -21324,7 +21337,7 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_confirmations_requir CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21333,10 +21346,10 @@ void __attribute__((export_name("TS_ChannelDetails_set_confirmations_required") this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); } @@ -21347,7 +21360,7 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_get_force_close_spend_de CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21356,10 +21369,10 @@ void __attribute__((export_name("TS_ChannelDetails_set_force_close_spend_delay" this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); - val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)val) & ~1)); ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); } @@ -21434,7 +21447,7 @@ void __attribute__((export_name("TS_ChannelDetails_set_is_public"))) TS_Channel uint32_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetails_new(int8_tArray channel_id_arg, uint32_t counterparty_arg, uint32_t funding_txo_arg, uint32_t short_channel_id_arg, int64_t channel_value_satoshis_arg, uint32_t unspendable_punishment_reserve_arg, int64_t user_channel_id_arg, int64_t balance_msat_arg, int64_t outbound_capacity_msat_arg, int64_t inbound_capacity_msat_arg, uint32_t confirmations_required_arg, uint32_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_funding_locked_arg, jboolean is_usable_arg, jboolean is_public_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKChannelCounterparty counterparty_arg_conv; counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1)); counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0); @@ -21445,27 +21458,27 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetail funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); - void* short_channel_id_arg_ptr = (void*)(((uint64_t)short_channel_id_arg) & ~1); + void* short_channel_id_arg_ptr = (void*)(((uintptr_t)short_channel_id_arg) & ~1); CHECK_ACCESS(short_channel_id_arg_ptr); LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); - short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1)); - void* unspendable_punishment_reserve_arg_ptr = (void*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1); + short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)short_channel_id_arg) & ~1)); + void* unspendable_punishment_reserve_arg_ptr = (void*)(((uintptr_t)unspendable_punishment_reserve_arg) & ~1); CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); - void* confirmations_required_arg_ptr = (void*)(((uint64_t)confirmations_required_arg) & ~1); + void* confirmations_required_arg_ptr = (void*)(((uintptr_t)confirmations_required_arg) & ~1); CHECK_ACCESS(confirmations_required_arg_ptr); LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr); - confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1)); - void* force_close_spend_delay_arg_ptr = (void*)(((uint64_t)force_close_spend_delay_arg) & ~1); + confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)confirmations_required_arg) & ~1)); + void* force_close_spend_delay_arg_ptr = (void*)(((uintptr_t)force_close_spend_delay_arg) & ~1); CHECK_ACCESS(force_close_spend_delay_arg_ptr); LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); - force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uint64_t)force_close_spend_delay_arg) & ~1)); + force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)(((uintptr_t)force_close_spend_delay_arg) & ~1)); LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_ref, counterparty_arg_conv, funding_txo_arg_conv, short_channel_id_arg_conv, channel_value_satoshis_arg, unspendable_punishment_reserve_arg_conv, user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21474,22 +21487,22 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetail static inline uintptr_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { LDKChannelDetails ret_var = ChannelDetails_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelDetails_clone_ptr"))) TS_ChannelDetails_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelDetails_clone_ptr"))) TS_ChannelDetails_clone_ptr(uint32_t arg) { LDKChannelDetails arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelDetails_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelDetails_clone_ptr(&arg_conv); return ret_val; } @@ -21499,11 +21512,11 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_clone"))) TS_ChannelDeta orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21512,7 +21525,7 @@ uint32_t __attribute__((export_name("TS_ChannelDetails_clone"))) TS_ChannelDeta void __attribute__((export_name("TS_PaymentSendFailure_free"))) TS_PaymentSendFailure_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -21522,12 +21535,12 @@ void __attribute__((export_name("TS_PaymentSendFailure_free"))) TS_PaymentSendF static inline uintptr_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) { LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_PaymentSendFailure_clone_ptr"))) TS_PaymentSendFailure_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_PaymentSendFailure_clone_ptr"))) TS_PaymentSendFailure_clone_ptr(uint32_t arg) { LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)arg; - int64_t ret_val = PaymentSendFailure_clone_ptr(arg_conv); + intptr_t ret_val = PaymentSendFailure_clone_ptr(arg_conv); return ret_val; } @@ -21535,18 +21548,18 @@ uint32_t __attribute__((export_name("TS_PaymentSendFailure_clone"))) TS_Payment LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)orig; LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_PaymentSendFailure_parameter_error"))) TS_PaymentSendFailure_parameter_error(uint32_t a) { - void* a_ptr = (void*)(((uint64_t)a) & ~1); + void* a_ptr = (void*)(((uintptr_t)a) & ~1); CHECK_ACCESS(a_ptr); LDKAPIError a_conv = *(LDKAPIError*)(a_ptr); - a_conv = APIError_clone((LDKAPIError*)(((uint64_t)a) & ~1)); + a_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a) & ~1)); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_parameter_error(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21557,18 +21570,18 @@ uint32_t __attribute__((export_name("TS_PaymentSendFailure_path_parameter_error a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); else a_constr.data = NULL; - uint32_t* a_vals = a->elems; + uint32_t* a_vals = a->elems /* XXX a leaks */; for (size_t w = 0; w < a_constr.datalen; w++) { uint32_t a_conv_22 = a_vals[w]; - void* a_conv_22_ptr = (void*)(((uint64_t)a_conv_22) & ~1); + void* a_conv_22_ptr = (void*)(((uintptr_t)a_conv_22) & ~1); CHECK_ACCESS(a_conv_22_ptr); LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr); - a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1)); + a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uintptr_t)a_conv_22) & ~1)); a_constr.data[w] = a_conv_22_conv; } LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_path_parameter_error(a_constr); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21579,18 +21592,18 @@ uint32_t __attribute__((export_name("TS_PaymentSendFailure_all_failed_retry_saf a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements"); else a_constr.data = NULL; - uint32_t* a_vals = a->elems; + uint32_t* a_vals = a->elems /* XXX a leaks */; for (size_t k = 0; k < a_constr.datalen; k++) { uint32_t a_conv_10 = a_vals[k]; - void* a_conv_10_ptr = (void*)(((uint64_t)a_conv_10) & ~1); + void* a_conv_10_ptr = (void*)(((uintptr_t)a_conv_10) & ~1); CHECK_ACCESS(a_conv_10_ptr); LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr); - a_conv_10_conv = APIError_clone((LDKAPIError*)(((uint64_t)a_conv_10) & ~1)); + a_conv_10_conv = APIError_clone((LDKAPIError*)(((uintptr_t)a_conv_10) & ~1)); a_constr.data[k] = a_conv_10_conv; } LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -21601,10 +21614,10 @@ uint32_t __attribute__((export_name("TS_PaymentSendFailure_partial_failure"))) results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements"); else results_constr.data = NULL; - uint32_t* results_vals = results->elems; + uint32_t* results_vals = results->elems /* XXX results leaks */; for (size_t w = 0; w < results_constr.datalen; w++) { uint32_t results_conv_22 = results_vals[w]; - void* results_conv_22_ptr = (void*)(((uint64_t)results_conv_22) & ~1); + void* results_conv_22_ptr = (void*)(((uintptr_t)results_conv_22) & ~1); CHECK_ACCESS(results_conv_22_ptr); LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr); results_constr.data[w] = results_conv_22_conv; @@ -21616,27 +21629,27 @@ uint32_t __attribute__((export_name("TS_PaymentSendFailure_partial_failure"))) failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ChannelManager_new"))) TS_ChannelManager_new(uint32_t fee_est, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t keys_manager, uint32_t config, uint32_t params) { - void* fee_est_ptr = (void*)(((uint64_t)fee_est) & ~1); + void* fee_est_ptr = (void*)(((uintptr_t)fee_est) & ~1); CHECK_ACCESS(fee_est_ptr); LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); - void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1); + void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); CHECK_ACCESS(chain_monitor_ptr); LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1); + void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); CHECK_ACCESS(tx_broadcaster_ptr); LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); + void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); LDKUserConfig config_conv; @@ -21650,11 +21663,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_new"))) TS_ChannelManage CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv); params_conv = ChainParameters_clone(¶ms_conv); LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21667,11 +21680,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_get_current_default_conf this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -21685,7 +21698,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_channel"))) TS_Ch CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_network_key_ref; CHECK(their_network_key->arr_len == 33); - memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); + memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key); LDKUserConfig override_config_conv; override_config_conv.inner = (void*)(override_config & (~1)); override_config_conv.is_owned = (override_config & 1) || (override_config == 0); @@ -21693,7 +21706,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_channel"))) TS_Ch override_config_conv = UserConfig_clone(&override_config_conv); LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ"); *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_tArray __attribute__((export_name("TS_ChannelManager_list_channels"))) TS_ChannelManager_list_channels(uint32_t this_arg) { @@ -21703,15 +21716,15 @@ uint32_tArray __attribute__((export_name("TS_ChannelManager_list_channels"))) T CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t q = 0; q < ret_var.datalen; q++) { LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - uint64_t ret_conv_16_ref = 0; - CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; } @@ -21729,15 +21742,15 @@ uint32_tArray __attribute__((export_name("TS_ChannelManager_list_usable_channel CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t q = 0; q < ret_var.datalen; q++) { LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - uint64_t ret_conv_16_ref = 0; - CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; } @@ -21755,11 +21768,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_close_channel"))) TS_Cha CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); + memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); unsigned char (*channel_id_ref)[32] = &channel_id_arr; LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_close_channel_with_target_feerate"))) TS_ChannelManager_close_channel_with_target_feerate(uint32_t this_arg, int8_tArray channel_id, int32_t target_feerate_sats_per_1000_weight) { @@ -21769,11 +21782,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_close_channel_with_targe CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); + memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); unsigned char (*channel_id_ref)[32] = &channel_id_arr; LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, target_feerate_sats_per_1000_weight); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_force_close_channel"))) TS_ChannelManager_force_close_channel(uint32_t this_arg, int8_tArray channel_id) { @@ -21783,11 +21796,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_force_close_channel"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char channel_id_arr[32]; CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); + memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); unsigned char (*channel_id_ref)[32] = &channel_id_arr; LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChannelManager_force_close_channel(&this_arg_conv, channel_id_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ChannelManager_force_close_all_channels"))) TS_ChannelManager_force_close_all_channels(uint32_t this_arg) { @@ -21809,13 +21822,13 @@ uint32_t __attribute__((export_name("TS_ChannelManager_send_payment"))) TS_Chan CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKThirtyTwoBytes payment_secret_ref; CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_retry_payment"))) TS_ChannelManager_retry_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_id) { @@ -21829,10 +21842,10 @@ uint32_t __attribute__((export_name("TS_ChannelManager_retry_payment"))) TS_Cha CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_ChannelManager_abandon_payment(uint32_t this_arg, int8_tArray payment_id) { @@ -21842,7 +21855,7 @@ void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_Chann CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_id_ref; CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); } @@ -21857,10 +21870,10 @@ uint32_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_payment CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ"); *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_funding_transaction_generated"))) TS_ChannelManager_funding_transaction_generated(uint32_t this_arg, int8_tArray temporary_channel_id, int8_tArray funding_transaction) { @@ -21870,16 +21883,16 @@ uint32_t __attribute__((export_name("TS_ChannelManager_funding_transaction_gene CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char temporary_channel_id_arr[32]; CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); + memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id); unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; LDKTransaction funding_transaction_ref; funding_transaction_ref.datalen = funding_transaction->arr_len; funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); + memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); funding_transaction_ref.data_is_owned = true; LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, funding_transaction_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ChannelManager_broadcast_node_announcement"))) TS_ChannelManager_broadcast_node_announcement(uint32_t this_arg, int8_tArray rgb, int8_tArray alias, uint32_tArray addresses) { @@ -21889,20 +21902,20 @@ void __attribute__((export_name("TS_ChannelManager_broadcast_node_announcement" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThreeBytes rgb_ref; CHECK(rgb->arr_len == 3); - memcpy(rgb_ref.data, rgb->elems, 3); + memcpy(rgb_ref.data, rgb->elems, 3); FREE(rgb); LDKThirtyTwoBytes alias_ref; CHECK(alias->arr_len == 32); - memcpy(alias_ref.data, alias->elems, 32); + memcpy(alias_ref.data, alias->elems, 32); FREE(alias); LDKCVec_NetAddressZ addresses_constr; addresses_constr.datalen = addresses->arr_len; if (addresses_constr.datalen > 0) addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else addresses_constr.data = NULL; - uint32_t* addresses_vals = addresses->elems; + uint32_t* addresses_vals = addresses->elems /* XXX addresses leaks */; for (size_t m = 0; m < addresses_constr.datalen; m++) { uint32_t addresses_conv_12 = addresses_vals[m]; - void* addresses_conv_12_ptr = (void*)(((uint64_t)addresses_conv_12) & ~1); + void* addresses_conv_12_ptr = (void*)(((uintptr_t)addresses_conv_12) & ~1); CHECK_ACCESS(addresses_conv_12_ptr); LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr); addresses_constr.data[m] = addresses_conv_12_conv; @@ -21933,7 +21946,7 @@ jboolean __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char payment_hash_arr[32]; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_arr, payment_hash->elems, 32); + memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); unsigned char (*payment_hash_ref)[32] = &payment_hash_arr; jboolean ret_val = ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); return ret_val; @@ -21946,7 +21959,7 @@ jboolean __attribute__((export_name("TS_ChannelManager_claim_funds"))) TS_Chann CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); jboolean ret_val = ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); return ret_val; } @@ -21956,7 +21969,7 @@ int8_tArray __attribute__((export_name("TS_ChannelManager_get_our_node_id"))) T this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33); return ret_arr; } @@ -21966,13 +21979,13 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment") this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1)); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ"); *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_legacy"))) TS_ChannelManager_create_inbound_payment_legacy(uint32_t this_arg, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) { @@ -21980,13 +21993,13 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_l this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1)); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ"); *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_for_hash"))) TS_ChannelManager_create_inbound_payment_for_hash(uint32_t this_arg, int8_tArray payment_hash, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) { @@ -21996,14 +22009,14 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_f CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); - void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1)); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ"); *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_for_hash_legacy"))) TS_ChannelManager_create_inbound_payment_for_hash_legacy(uint32_t this_arg, int8_tArray payment_hash, uint32_t min_value_msat, int32_t invoice_expiry_delta_secs) { @@ -22013,14 +22026,14 @@ uint32_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_f CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); - void* min_value_msat_ptr = (void*)(((uint64_t)min_value_msat) & ~1); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* min_value_msat_ptr = (void*)(((uintptr_t)min_value_msat) & ~1); CHECK_ACCESS(min_value_msat_ptr); LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)min_value_msat) & ~1)); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)min_value_msat) & ~1)); LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ"); *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_get_payment_preimage"))) TS_ChannelManager_get_payment_preimage(uint32_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { @@ -22030,13 +22043,13 @@ uint32_t __attribute__((export_name("TS_ChannelManager_get_payment_preimage"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); LDKThirtyTwoBytes payment_secret_ref; CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ"); *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ChannelManager_as_MessageSendEventsProvider"))) TS_ChannelManager_as_MessageSendEventsProvider(uint32_t this_arg) { @@ -22046,7 +22059,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_as_MessageSendEventsProv CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChannelManager_as_EventsProvider"))) TS_ChannelManager_as_EventsProvider(uint32_t this_arg) { @@ -22056,7 +22069,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_as_EventsProvider"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChannelManager_as_Listen"))) TS_ChannelManager_as_Listen(uint32_t this_arg) { @@ -22066,7 +22079,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_as_Listen"))) TS_Channel CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); *ret_ret = ChannelManager_as_Listen(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_ChannelManager_as_Confirm(uint32_t this_arg) { @@ -22076,7 +22089,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_Channe CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_ChannelManager_await_persistable_update"))) TS_ChannelManager_await_persistable_update(uint32_t this_arg) { @@ -22093,11 +22106,11 @@ uint32_t __attribute__((export_name("TS_ChannelManager_current_best_block"))) T this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22111,7 +22124,7 @@ uint32_t __attribute__((export_name("TS_ChannelManager_as_ChannelMessageHandler CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } int8_tArray __attribute__((export_name("TS_ChannelManager_write"))) TS_ChannelManager_write(uint32_t obj) { @@ -22120,7 +22133,7 @@ int8_tArray __attribute__((export_name("TS_ChannelManager_write"))) TS_ChannelM obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -22140,7 +22153,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_keys_manager this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv)) | 1; return ret_ret; } @@ -22149,7 +22162,7 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_keys_manager"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr); ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv); @@ -22161,7 +22174,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_fee_estimato this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv)) | 1; return ret_ret; } @@ -22170,7 +22183,7 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_fee_estimator")) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); @@ -22182,7 +22195,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_chain_monito this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv)) | 1; return ret_ret; } @@ -22191,7 +22204,7 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_chain_monitor")) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKWatch val_conv = *(LDKWatch*)(val_ptr); ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); @@ -22203,7 +22216,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_tx_broadcast this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv)) | 1; return ret_ret; } @@ -22212,7 +22225,7 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_tx_broadcaster") this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); @@ -22224,7 +22237,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_logger"))) T this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)ChannelManagerReadArgs_get_logger(&this_ptr_conv)) | 1; return ret_ret; } @@ -22233,7 +22246,7 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_logger"))) TS_Ch this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKLogger val_conv = *(LDKLogger*)(val_ptr); ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); @@ -22245,11 +22258,11 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_default_conf this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22270,19 +22283,19 @@ void __attribute__((export_name("TS_ChannelManagerReadArgs_set_default_config") } uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_ChannelManagerReadArgs_new(uint32_t keys_manager, uint32_t fee_estimator, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t default_config, uint32_tArray channel_monitors) { - void* keys_manager_ptr = (void*)(((uint64_t)keys_manager) & ~1); + void* keys_manager_ptr = (void*)(((uintptr_t)keys_manager) & ~1); CHECK_ACCESS(keys_manager_ptr); LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr); - void* fee_estimator_ptr = (void*)(((uint64_t)fee_estimator) & ~1); + void* fee_estimator_ptr = (void*)(((uintptr_t)fee_estimator) & ~1); CHECK_ACCESS(fee_estimator_ptr); LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr); - void* chain_monitor_ptr = (void*)(((uint64_t)chain_monitor) & ~1); + void* chain_monitor_ptr = (void*)(((uintptr_t)chain_monitor) & ~1); CHECK_ACCESS(chain_monitor_ptr); LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - void* tx_broadcaster_ptr = (void*)(((uint64_t)tx_broadcaster) & ~1); + void* tx_broadcaster_ptr = (void*)(((uintptr_t)tx_broadcaster) & ~1); CHECK_ACCESS(tx_broadcaster_ptr); LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); LDKUserConfig default_config_conv; @@ -22296,7 +22309,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_Chann channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); else channel_monitors_constr.data = NULL; - uint32_t* channel_monitors_vals = channel_monitors->elems; + uint32_t* channel_monitors_vals = channel_monitors->elems /* XXX channel_monitors leaks */; for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { uint32_t channel_monitors_conv_16 = channel_monitors_vals[q]; LDKChannelMonitor channel_monitors_conv_16_conv; @@ -22306,11 +22319,11 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_Chann channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; } 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22320,7 +22333,7 @@ uint32_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_Chann uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_read"))) TS_C2Tuple_BlockHashChannelManagerZ_read(int8_tArray ser, uint32_t arg) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKChannelManagerReadArgs arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = (arg & 1) || (arg == 0); @@ -22328,7 +22341,7 @@ uint32_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_read") // Warning: we need a move here but no clone is available for LDKChannelManagerReadArgs LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ"); *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint32_t this_obj) { @@ -22341,22 +22354,22 @@ void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(ui static inline uintptr_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { LDKDecodeError ret_var = DecodeError_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint32_t arg) { LDKDecodeError arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = DecodeError_clone_ptr(&arg_conv); + intptr_t ret_val = DecodeError_clone_ptr(&arg_conv); return ret_val; } @@ -22366,11 +22379,11 @@ uint32_t __attribute__((export_name("TS_DecodeError_clone"))) TS_DecodeError_cl orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDecodeError ret_var = DecodeError_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22391,11 +22404,11 @@ uint32_t __attribute__((export_name("TS_Init_get_features"))) TS_Init_get_featu this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22422,11 +22435,11 @@ uint32_t __attribute__((export_name("TS_Init_new"))) TS_Init_new(uint32_t featu CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv); features_arg_conv = InitFeatures_clone(&features_arg_conv); LDKInit ret_var = Init_new(features_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22435,22 +22448,22 @@ uint32_t __attribute__((export_name("TS_Init_new"))) TS_Init_new(uint32_t featu static inline uintptr_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { LDKInit ret_var = Init_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Init_clone_ptr"))) TS_Init_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Init_clone_ptr"))) TS_Init_clone_ptr(uint32_t arg) { LDKInit arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Init_clone_ptr(&arg_conv); + intptr_t ret_val = Init_clone_ptr(&arg_conv); return ret_val; } @@ -22460,11 +22473,11 @@ uint32_t __attribute__((export_name("TS_Init_clone"))) TS_Init_clone(uint32_t o orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInit ret_var = Init_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22484,7 +22497,7 @@ int8_tArray __attribute__((export_name("TS_ErrorMessage_get_channel_id"))) TS_E this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ErrorMessage_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -22496,7 +22509,7 @@ void __attribute__((export_name("TS_ErrorMessage_set_channel_id"))) TS_ErrorMes CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ErrorMessage_set_channel_id(&this_ptr_conv, val_ref); } @@ -22523,14 +22536,14 @@ void __attribute__((export_name("TS_ErrorMessage_set_data"))) TS_ErrorMessage_s uint32_t __attribute__((export_name("TS_ErrorMessage_new"))) TS_ErrorMessage_new(int8_tArray channel_id_arg, jstring data_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKStr data_arg_conv = str_ref_to_owned_c(data_arg); LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22539,22 +22552,22 @@ uint32_t __attribute__((export_name("TS_ErrorMessage_new"))) TS_ErrorMessage_ne static inline uintptr_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { LDKErrorMessage ret_var = ErrorMessage_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ErrorMessage_clone_ptr"))) TS_ErrorMessage_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ErrorMessage_clone_ptr"))) TS_ErrorMessage_clone_ptr(uint32_t arg) { LDKErrorMessage arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ErrorMessage_clone_ptr(&arg_conv); + intptr_t ret_val = ErrorMessage_clone_ptr(&arg_conv); return ret_val; } @@ -22564,11 +22577,11 @@ uint32_t __attribute__((export_name("TS_ErrorMessage_clone"))) TS_ErrorMessage_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22619,11 +22632,11 @@ void __attribute__((export_name("TS_Ping_set_byteslen"))) TS_Ping_set_byteslen( uint32_t __attribute__((export_name("TS_Ping_new"))) TS_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) { LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22632,22 +22645,22 @@ uint32_t __attribute__((export_name("TS_Ping_new"))) TS_Ping_new(int16_t pongle static inline uintptr_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { LDKPing ret_var = Ping_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Ping_clone_ptr"))) TS_Ping_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Ping_clone_ptr"))) TS_Ping_clone_ptr(uint32_t arg) { LDKPing arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Ping_clone_ptr(&arg_conv); + intptr_t ret_val = Ping_clone_ptr(&arg_conv); return ret_val; } @@ -22657,11 +22670,11 @@ uint32_t __attribute__((export_name("TS_Ping_clone"))) TS_Ping_clone(uint32_t o orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPing ret_var = Ping_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22695,11 +22708,11 @@ void __attribute__((export_name("TS_Pong_set_byteslen"))) TS_Pong_set_byteslen( uint32_t __attribute__((export_name("TS_Pong_new"))) TS_Pong_new(int16_t byteslen_arg) { LDKPong ret_var = Pong_new(byteslen_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22708,22 +22721,22 @@ uint32_t __attribute__((export_name("TS_Pong_new"))) TS_Pong_new(int16_t bytesl static inline uintptr_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { LDKPong ret_var = Pong_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Pong_clone_ptr"))) TS_Pong_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Pong_clone_ptr"))) TS_Pong_clone_ptr(uint32_t arg) { LDKPong arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Pong_clone_ptr(&arg_conv); + intptr_t ret_val = Pong_clone_ptr(&arg_conv); return ret_val; } @@ -22733,11 +22746,11 @@ uint32_t __attribute__((export_name("TS_Pong_clone"))) TS_Pong_clone(uint32_t o orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPong ret_var = Pong_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -22757,7 +22770,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_chain_hash"))) TS_Op this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *OpenChannel_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -22769,7 +22782,7 @@ void __attribute__((export_name("TS_OpenChannel_set_chain_hash"))) TS_OpenChann CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); OpenChannel_set_chain_hash(&this_ptr_conv, val_ref); } @@ -22778,7 +22791,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_temporary_channel_id this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -22790,7 +22803,7 @@ void __attribute__((export_name("TS_OpenChannel_set_temporary_channel_id"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); } @@ -22952,7 +22965,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_funding_pubkey"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -22964,7 +22977,7 @@ void __attribute__((export_name("TS_OpenChannel_set_funding_pubkey"))) TS_OpenC CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref); } @@ -22973,7 +22986,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_revocation_basepoint this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -22985,7 +22998,7 @@ void __attribute__((export_name("TS_OpenChannel_set_revocation_basepoint"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); } @@ -22994,7 +23007,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_payment_point"))) TS this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23006,7 +23019,7 @@ void __attribute__((export_name("TS_OpenChannel_set_payment_point"))) TS_OpenCh CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_payment_point(&this_ptr_conv, val_ref); } @@ -23015,7 +23028,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_delayed_payment_base this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23027,7 +23040,7 @@ void __attribute__((export_name("TS_OpenChannel_set_delayed_payment_basepoint") CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } @@ -23036,7 +23049,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_htlc_basepoint"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23048,7 +23061,7 @@ void __attribute__((export_name("TS_OpenChannel_set_htlc_basepoint"))) TS_OpenC CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); } @@ -23057,7 +23070,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_get_first_per_commitment this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23069,7 +23082,7 @@ void __attribute__((export_name("TS_OpenChannel_set_first_per_commitment_point" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } @@ -23096,12 +23109,12 @@ uint32_t __attribute__((export_name("TS_OpenChannel_get_channel_type"))) TS_Ope this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23124,22 +23137,22 @@ void __attribute__((export_name("TS_OpenChannel_set_channel_type"))) TS_OpenCha static inline uintptr_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { LDKOpenChannel ret_var = OpenChannel_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_OpenChannel_clone_ptr"))) TS_OpenChannel_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_OpenChannel_clone_ptr"))) TS_OpenChannel_clone_ptr(uint32_t arg) { LDKOpenChannel arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = OpenChannel_clone_ptr(&arg_conv); + intptr_t ret_val = OpenChannel_clone_ptr(&arg_conv); return ret_val; } @@ -23149,11 +23162,11 @@ uint32_t __attribute__((export_name("TS_OpenChannel_clone"))) TS_OpenChannel_cl orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23173,7 +23186,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_temporary_channel_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -23185,7 +23198,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_temporary_channel_id"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); } @@ -23313,7 +23326,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_funding_pubkey"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23325,7 +23338,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_funding_pubkey"))) TS_Acc CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref); } @@ -23334,7 +23347,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_revocation_basepoi this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23346,7 +23359,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_revocation_basepoint"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); } @@ -23355,7 +23368,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_payment_point"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23367,7 +23380,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_payment_point"))) TS_Acce CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_payment_point(&this_ptr_conv, val_ref); } @@ -23376,7 +23389,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_delayed_payment_ba this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23388,7 +23401,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_delayed_payment_basepoint CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } @@ -23397,7 +23410,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_htlc_basepoint"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23409,7 +23422,7 @@ void __attribute__((export_name("TS_AcceptChannel_set_htlc_basepoint"))) TS_Acc CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); } @@ -23418,7 +23431,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_get_first_per_commitme this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23430,28 +23443,28 @@ void __attribute__((export_name("TS_AcceptChannel_set_first_per_commitment_poin CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); } static inline uintptr_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) { LDKAcceptChannel ret_var = AcceptChannel_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_AcceptChannel_clone_ptr"))) TS_AcceptChannel_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_AcceptChannel_clone_ptr"))) TS_AcceptChannel_clone_ptr(uint32_t arg) { LDKAcceptChannel arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = AcceptChannel_clone_ptr(&arg_conv); + intptr_t ret_val = AcceptChannel_clone_ptr(&arg_conv); return ret_val; } @@ -23461,11 +23474,11 @@ uint32_t __attribute__((export_name("TS_AcceptChannel_clone"))) TS_AcceptChanne orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23485,7 +23498,7 @@ int8_tArray __attribute__((export_name("TS_FundingCreated_get_temporary_channel this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *FundingCreated_get_temporary_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -23497,7 +23510,7 @@ void __attribute__((export_name("TS_FundingCreated_set_temporary_channel_id"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref); } @@ -23506,7 +23519,7 @@ int8_tArray __attribute__((export_name("TS_FundingCreated_get_funding_txid"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *FundingCreated_get_funding_txid(&this_ptr_conv), 32); return ret_arr; } @@ -23518,7 +23531,7 @@ void __attribute__((export_name("TS_FundingCreated_set_funding_txid"))) TS_Fund CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); FundingCreated_set_funding_txid(&this_ptr_conv, val_ref); } @@ -23544,7 +23557,7 @@ int8_tArray __attribute__((export_name("TS_FundingCreated_get_signature"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, FundingCreated_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -23556,26 +23569,26 @@ void __attribute__((export_name("TS_FundingCreated_set_signature"))) TS_Funding CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); FundingCreated_set_signature(&this_ptr_conv, val_ref); } uint32_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) { LDKThirtyTwoBytes temporary_channel_id_arg_ref; CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); + memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg); LDKThirtyTwoBytes funding_txid_arg_ref; CHECK(funding_txid_arg->arr_len == 32); - memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); + memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); FREE(funding_txid_arg); LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23584,22 +23597,22 @@ uint32_t __attribute__((export_name("TS_FundingCreated_new"))) TS_FundingCreate static inline uintptr_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) { LDKFundingCreated ret_var = FundingCreated_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_FundingCreated_clone_ptr"))) TS_FundingCreated_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_FundingCreated_clone_ptr"))) TS_FundingCreated_clone_ptr(uint32_t arg) { LDKFundingCreated arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = FundingCreated_clone_ptr(&arg_conv); + intptr_t ret_val = FundingCreated_clone_ptr(&arg_conv); return ret_val; } @@ -23609,11 +23622,11 @@ uint32_t __attribute__((export_name("TS_FundingCreated_clone"))) TS_FundingCrea orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23633,7 +23646,7 @@ int8_tArray __attribute__((export_name("TS_FundingSigned_get_channel_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *FundingSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -23645,7 +23658,7 @@ void __attribute__((export_name("TS_FundingSigned_set_channel_id"))) TS_Funding CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); FundingSigned_set_channel_id(&this_ptr_conv, val_ref); } @@ -23654,7 +23667,7 @@ int8_tArray __attribute__((export_name("TS_FundingSigned_get_signature"))) TS_F this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, FundingSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -23666,23 +23679,23 @@ void __attribute__((export_name("TS_FundingSigned_set_signature"))) TS_FundingS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); FundingSigned_set_signature(&this_ptr_conv, val_ref); } uint32_t __attribute__((export_name("TS_FundingSigned_new"))) TS_FundingSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23691,22 +23704,22 @@ uint32_t __attribute__((export_name("TS_FundingSigned_new"))) TS_FundingSigned_ static inline uintptr_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) { LDKFundingSigned ret_var = FundingSigned_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_FundingSigned_clone_ptr"))) TS_FundingSigned_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_FundingSigned_clone_ptr"))) TS_FundingSigned_clone_ptr(uint32_t arg) { LDKFundingSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = FundingSigned_clone_ptr(&arg_conv); + intptr_t ret_val = FundingSigned_clone_ptr(&arg_conv); return ret_val; } @@ -23716,11 +23729,11 @@ uint32_t __attribute__((export_name("TS_FundingSigned_clone"))) TS_FundingSigne orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23740,7 +23753,7 @@ int8_tArray __attribute__((export_name("TS_FundingLocked_get_channel_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *FundingLocked_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -23752,7 +23765,7 @@ void __attribute__((export_name("TS_FundingLocked_set_channel_id"))) TS_Funding CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); FundingLocked_set_channel_id(&this_ptr_conv, val_ref); } @@ -23761,7 +23774,7 @@ int8_tArray __attribute__((export_name("TS_FundingLocked_get_next_per_commitmen this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, FundingLocked_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -23773,23 +23786,23 @@ void __attribute__((export_name("TS_FundingLocked_set_next_per_commitment_point CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); FundingLocked_set_next_per_commitment_point(&this_ptr_conv, val_ref); } uint32_t __attribute__((export_name("TS_FundingLocked_new"))) TS_FundingLocked_new(int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKPublicKey next_per_commitment_point_arg_ref; CHECK(next_per_commitment_point_arg->arr_len == 33); - memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); + memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg); LDKFundingLocked ret_var = FundingLocked_new(channel_id_arg_ref, next_per_commitment_point_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23798,22 +23811,22 @@ uint32_t __attribute__((export_name("TS_FundingLocked_new"))) TS_FundingLocked_ static inline uintptr_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg) { LDKFundingLocked ret_var = FundingLocked_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_FundingLocked_clone_ptr"))) TS_FundingLocked_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_FundingLocked_clone_ptr"))) TS_FundingLocked_clone_ptr(uint32_t arg) { LDKFundingLocked arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = FundingLocked_clone_ptr(&arg_conv); + intptr_t ret_val = FundingLocked_clone_ptr(&arg_conv); return ret_val; } @@ -23823,11 +23836,11 @@ uint32_t __attribute__((export_name("TS_FundingLocked_clone"))) TS_FundingLocke orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKFundingLocked ret_var = FundingLocked_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23847,7 +23860,7 @@ int8_tArray __attribute__((export_name("TS_Shutdown_get_channel_id"))) TS_Shutd this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *Shutdown_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -23859,7 +23872,7 @@ void __attribute__((export_name("TS_Shutdown_set_channel_id"))) TS_Shutdown_set CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); Shutdown_set_channel_id(&this_ptr_conv, val_ref); } @@ -23869,7 +23882,7 @@ int8_tArray __attribute__((export_name("TS_Shutdown_get_scriptpubkey"))) TS_Shu this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -23882,24 +23895,24 @@ void __attribute__((export_name("TS_Shutdown_set_scriptpubkey"))) TS_Shutdown_s LDKCVec_u8Z val_ref; val_ref.datalen = val->arr_len; val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref); } uint32_t __attribute__((export_name("TS_Shutdown_new"))) TS_Shutdown_new(int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKCVec_u8Z scriptpubkey_arg_ref; scriptpubkey_arg_ref.datalen = scriptpubkey_arg->arr_len; scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(scriptpubkey_arg_ref.data, scriptpubkey_arg->elems, scriptpubkey_arg_ref.datalen); + memcpy(scriptpubkey_arg_ref.data, scriptpubkey_arg->elems, scriptpubkey_arg_ref.datalen); FREE(scriptpubkey_arg); LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23908,22 +23921,22 @@ uint32_t __attribute__((export_name("TS_Shutdown_new"))) TS_Shutdown_new(int8_t static inline uintptr_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) { LDKShutdown ret_var = Shutdown_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Shutdown_clone_ptr"))) TS_Shutdown_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Shutdown_clone_ptr"))) TS_Shutdown_clone_ptr(uint32_t arg) { LDKShutdown arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Shutdown_clone_ptr(&arg_conv); + intptr_t ret_val = Shutdown_clone_ptr(&arg_conv); return ret_val; } @@ -23933,11 +23946,11 @@ uint32_t __attribute__((export_name("TS_Shutdown_clone"))) TS_Shutdown_clone(ui orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdown ret_var = Shutdown_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -23988,11 +24001,11 @@ void __attribute__((export_name("TS_ClosingSignedFeeRange_set_max_fee_satoshis" uint32_t __attribute__((export_name("TS_ClosingSignedFeeRange_new"))) TS_ClosingSignedFeeRange_new(int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) { LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24001,22 +24014,22 @@ uint32_t __attribute__((export_name("TS_ClosingSignedFeeRange_new"))) TS_Closin static inline uintptr_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) { LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone_ptr"))) TS_ClosingSignedFeeRange_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone_ptr"))) TS_ClosingSignedFeeRange_clone_ptr(uint32_t arg) { LDKClosingSignedFeeRange arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ClosingSignedFeeRange_clone_ptr(&arg_conv); + intptr_t ret_val = ClosingSignedFeeRange_clone_ptr(&arg_conv); return ret_val; } @@ -24026,11 +24039,11 @@ uint32_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone"))) TS_Clos orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24050,7 +24063,7 @@ int8_tArray __attribute__((export_name("TS_ClosingSigned_get_channel_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ClosingSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24062,7 +24075,7 @@ void __attribute__((export_name("TS_ClosingSigned_set_channel_id"))) TS_Closing CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ClosingSigned_set_channel_id(&this_ptr_conv, val_ref); } @@ -24088,7 +24101,7 @@ int8_tArray __attribute__((export_name("TS_ClosingSigned_get_signature"))) TS_C this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ClosingSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -24100,7 +24113,7 @@ void __attribute__((export_name("TS_ClosingSigned_set_signature"))) TS_ClosingS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ClosingSigned_set_signature(&this_ptr_conv, val_ref); } @@ -24110,12 +24123,12 @@ uint32_t __attribute__((export_name("TS_ClosingSigned_get_fee_range"))) TS_Clos this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24139,21 +24152,21 @@ void __attribute__((export_name("TS_ClosingSigned_set_fee_range"))) TS_ClosingS uint32_t __attribute__((export_name("TS_ClosingSigned_new"))) TS_ClosingSigned_new(int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, uint32_t fee_range_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKClosingSignedFeeRange fee_range_arg_conv; fee_range_arg_conv.inner = (void*)(fee_range_arg & (~1)); fee_range_arg_conv.is_owned = (fee_range_arg & 1) || (fee_range_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24162,22 +24175,22 @@ uint32_t __attribute__((export_name("TS_ClosingSigned_new"))) TS_ClosingSigned_ static inline uintptr_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) { LDKClosingSigned ret_var = ClosingSigned_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ClosingSigned_clone_ptr"))) TS_ClosingSigned_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ClosingSigned_clone_ptr"))) TS_ClosingSigned_clone_ptr(uint32_t arg) { LDKClosingSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ClosingSigned_clone_ptr(&arg_conv); + intptr_t ret_val = ClosingSigned_clone_ptr(&arg_conv); return ret_val; } @@ -24187,11 +24200,11 @@ uint32_t __attribute__((export_name("TS_ClosingSigned_clone"))) TS_ClosingSigne orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24211,7 +24224,7 @@ int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_channel_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateAddHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24223,7 +24236,7 @@ void __attribute__((export_name("TS_UpdateAddHTLC_set_channel_id"))) TS_UpdateA CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref); } @@ -24266,7 +24279,7 @@ int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_payment_hash"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv), 32); return ret_arr; } @@ -24278,7 +24291,7 @@ void __attribute__((export_name("TS_UpdateAddHTLC_set_payment_hash"))) TS_Updat CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref); } @@ -24301,22 +24314,22 @@ void __attribute__((export_name("TS_UpdateAddHTLC_set_cltv_expiry"))) TS_Update static inline uintptr_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) { LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UpdateAddHTLC_clone_ptr"))) TS_UpdateAddHTLC_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UpdateAddHTLC_clone_ptr"))) TS_UpdateAddHTLC_clone_ptr(uint32_t arg) { LDKUpdateAddHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UpdateAddHTLC_clone_ptr(&arg_conv); + intptr_t ret_val = UpdateAddHTLC_clone_ptr(&arg_conv); return ret_val; } @@ -24326,11 +24339,11 @@ uint32_t __attribute__((export_name("TS_UpdateAddHTLC_clone"))) TS_UpdateAddHTL orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24350,7 +24363,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_channel_id"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24362,7 +24375,7 @@ void __attribute__((export_name("TS_UpdateFulfillHTLC_set_channel_id"))) TS_Upd CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref); } @@ -24388,7 +24401,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_payment_preima this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv), 32); return ret_arr; } @@ -24400,23 +24413,23 @@ void __attribute__((export_name("TS_UpdateFulfillHTLC_set_payment_preimage"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref); } uint32_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) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKThirtyTwoBytes payment_preimage_arg_ref; CHECK(payment_preimage_arg->arr_len == 32); - memcpy(payment_preimage_arg_ref.data, payment_preimage_arg->elems, 32); + memcpy(payment_preimage_arg_ref.data, payment_preimage_arg->elems, 32); FREE(payment_preimage_arg); LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24425,22 +24438,22 @@ uint32_t __attribute__((export_name("TS_UpdateFulfillHTLC_new"))) TS_UpdateFulf static inline uintptr_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) { LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone_ptr"))) TS_UpdateFulfillHTLC_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone_ptr"))) TS_UpdateFulfillHTLC_clone_ptr(uint32_t arg) { LDKUpdateFulfillHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UpdateFulfillHTLC_clone_ptr(&arg_conv); + intptr_t ret_val = UpdateFulfillHTLC_clone_ptr(&arg_conv); return ret_val; } @@ -24450,11 +24463,11 @@ uint32_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone"))) TS_UpdateFu orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24474,7 +24487,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_get_channel_id"))) TS this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateFailHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24486,7 +24499,7 @@ void __attribute__((export_name("TS_UpdateFailHTLC_set_channel_id"))) TS_Update CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref); } @@ -24509,22 +24522,22 @@ void __attribute__((export_name("TS_UpdateFailHTLC_set_htlc_id"))) TS_UpdateFai static inline uintptr_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) { LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UpdateFailHTLC_clone_ptr"))) TS_UpdateFailHTLC_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UpdateFailHTLC_clone_ptr"))) TS_UpdateFailHTLC_clone_ptr(uint32_t arg) { LDKUpdateFailHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UpdateFailHTLC_clone_ptr(&arg_conv); + intptr_t ret_val = UpdateFailHTLC_clone_ptr(&arg_conv); return ret_val; } @@ -24534,11 +24547,11 @@ uint32_t __attribute__((export_name("TS_UpdateFailHTLC_clone"))) TS_UpdateFailH orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24558,7 +24571,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_channel_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24570,7 +24583,7 @@ void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_channel_id"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref); } @@ -24610,22 +24623,22 @@ void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_failure_code")) static inline uintptr_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) { LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone_ptr"))) TS_UpdateFailMalformedHTLC_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone_ptr"))) TS_UpdateFailMalformedHTLC_clone_ptr(uint32_t arg) { LDKUpdateFailMalformedHTLC arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); + intptr_t ret_val = UpdateFailMalformedHTLC_clone_ptr(&arg_conv); return ret_val; } @@ -24635,11 +24648,11 @@ uint32_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone"))) TS_Up orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24659,7 +24672,7 @@ int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_channel_id"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *CommitmentSigned_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24671,7 +24684,7 @@ void __attribute__((export_name("TS_CommitmentSigned_set_channel_id"))) TS_Comm CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref); } @@ -24680,7 +24693,7 @@ int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_signature"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, CommitmentSigned_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -24692,7 +24705,7 @@ void __attribute__((export_name("TS_CommitmentSigned_set_signature"))) TS_Commi CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); CommitmentSigned_set_signature(&this_ptr_conv, val_ref); } @@ -24707,12 +24720,12 @@ void __attribute__((export_name("TS_CommitmentSigned_set_htlc_signatures"))) TS val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else val_constr.data = NULL; - int8_tArray* val_vals = (void*) val->elems; + int8_tArray* val_vals = (void*) val->elems /* XXX val leaks */; for (size_t m = 0; m < val_constr.datalen; m++) { int8_tArray val_conv_12 = val_vals[m]; LDKSignature val_conv_12_ref; CHECK(val_conv_12->arr_len == 64); - memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); + memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12); val_constr.data[m] = val_conv_12_ref; } CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); @@ -24721,30 +24734,30 @@ void __attribute__((export_name("TS_CommitmentSigned_set_htlc_signatures"))) TS uint32_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKCVec_SignatureZ htlc_signatures_arg_constr; htlc_signatures_arg_constr.datalen = htlc_signatures_arg->arr_len; if (htlc_signatures_arg_constr.datalen > 0) htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else htlc_signatures_arg_constr.data = NULL; - int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems; + int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems /* XXX htlc_signatures_arg leaks */; for (size_t m = 0; m < htlc_signatures_arg_constr.datalen; m++) { int8_tArray htlc_signatures_arg_conv_12 = htlc_signatures_arg_vals[m]; LDKSignature htlc_signatures_arg_conv_12_ref; CHECK(htlc_signatures_arg_conv_12->arr_len == 64); - memcpy(htlc_signatures_arg_conv_12_ref.compact_form, htlc_signatures_arg_conv_12->elems, 64); + memcpy(htlc_signatures_arg_conv_12_ref.compact_form, htlc_signatures_arg_conv_12->elems, 64); FREE(htlc_signatures_arg_conv_12); htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref; } LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24753,22 +24766,22 @@ uint32_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentS static inline uintptr_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) { LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_CommitmentSigned_clone_ptr"))) TS_CommitmentSigned_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CommitmentSigned_clone_ptr"))) TS_CommitmentSigned_clone_ptr(uint32_t arg) { LDKCommitmentSigned arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = CommitmentSigned_clone_ptr(&arg_conv); + intptr_t ret_val = CommitmentSigned_clone_ptr(&arg_conv); return ret_val; } @@ -24778,11 +24791,11 @@ uint32_t __attribute__((export_name("TS_CommitmentSigned_clone"))) TS_Commitmen orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24802,7 +24815,7 @@ int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_channel_id"))) TS_R this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *RevokeAndACK_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24814,7 +24827,7 @@ void __attribute__((export_name("TS_RevokeAndACK_set_channel_id"))) TS_RevokeAn CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref); } @@ -24823,7 +24836,7 @@ int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_per_commitment_secr this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv), 32); return ret_arr; } @@ -24835,7 +24848,7 @@ void __attribute__((export_name("TS_RevokeAndACK_set_per_commitment_secret"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref); } @@ -24844,7 +24857,7 @@ int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_next_per_commitment this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -24856,26 +24869,26 @@ void __attribute__((export_name("TS_RevokeAndACK_set_next_per_commitment_point" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref); } uint32_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) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKThirtyTwoBytes per_commitment_secret_arg_ref; CHECK(per_commitment_secret_arg->arr_len == 32); - memcpy(per_commitment_secret_arg_ref.data, per_commitment_secret_arg->elems, 32); + memcpy(per_commitment_secret_arg_ref.data, per_commitment_secret_arg->elems, 32); FREE(per_commitment_secret_arg); LDKPublicKey next_per_commitment_point_arg_ref; CHECK(next_per_commitment_point_arg->arr_len == 33); - memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); + memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg); LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24884,22 +24897,22 @@ uint32_t __attribute__((export_name("TS_RevokeAndACK_new"))) TS_RevokeAndACK_ne static inline uintptr_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) { LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RevokeAndACK_clone_ptr"))) TS_RevokeAndACK_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RevokeAndACK_clone_ptr"))) TS_RevokeAndACK_clone_ptr(uint32_t arg) { LDKRevokeAndACK arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RevokeAndACK_clone_ptr(&arg_conv); + intptr_t ret_val = RevokeAndACK_clone_ptr(&arg_conv); return ret_val; } @@ -24909,11 +24922,11 @@ uint32_t __attribute__((export_name("TS_RevokeAndACK_clone"))) TS_RevokeAndACK_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24933,7 +24946,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFee_get_channel_id"))) TS_Upda this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UpdateFee_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -24945,7 +24958,7 @@ void __attribute__((export_name("TS_UpdateFee_set_channel_id"))) TS_UpdateFee_s CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UpdateFee_set_channel_id(&this_ptr_conv, val_ref); } @@ -24969,13 +24982,13 @@ void __attribute__((export_name("TS_UpdateFee_set_feerate_per_kw"))) TS_UpdateF uint32_t __attribute__((export_name("TS_UpdateFee_new"))) TS_UpdateFee_new(int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -24984,22 +24997,22 @@ uint32_t __attribute__((export_name("TS_UpdateFee_new"))) TS_UpdateFee_new(int8 static inline uintptr_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) { LDKUpdateFee ret_var = UpdateFee_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UpdateFee_clone_ptr"))) TS_UpdateFee_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UpdateFee_clone_ptr"))) TS_UpdateFee_clone_ptr(uint32_t arg) { LDKUpdateFee arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UpdateFee_clone_ptr(&arg_conv); + intptr_t ret_val = UpdateFee_clone_ptr(&arg_conv); return ret_val; } @@ -25009,11 +25022,11 @@ uint32_t __attribute__((export_name("TS_UpdateFee_clone"))) TS_UpdateFee_clone( orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25033,7 +25046,7 @@ int8_tArray __attribute__((export_name("TS_DataLossProtect_get_your_last_per_co this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv), 32); return ret_arr; } @@ -25045,7 +25058,7 @@ void __attribute__((export_name("TS_DataLossProtect_set_your_last_per_commitmen CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref); } @@ -25054,7 +25067,7 @@ int8_tArray __attribute__((export_name("TS_DataLossProtect_get_my_current_per_c this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25066,23 +25079,23 @@ void __attribute__((export_name("TS_DataLossProtect_set_my_current_per_commitme CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref); } uint32_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) { LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref; CHECK(your_last_per_commitment_secret_arg->arr_len == 32); - memcpy(your_last_per_commitment_secret_arg_ref.data, your_last_per_commitment_secret_arg->elems, 32); + memcpy(your_last_per_commitment_secret_arg_ref.data, your_last_per_commitment_secret_arg->elems, 32); FREE(your_last_per_commitment_secret_arg); LDKPublicKey my_current_per_commitment_point_arg_ref; CHECK(my_current_per_commitment_point_arg->arr_len == 33); - memcpy(my_current_per_commitment_point_arg_ref.compressed_form, my_current_per_commitment_point_arg->elems, 33); + 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); LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25091,22 +25104,22 @@ uint32_t __attribute__((export_name("TS_DataLossProtect_new"))) TS_DataLossProt static inline uintptr_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) { LDKDataLossProtect ret_var = DataLossProtect_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_DataLossProtect_clone_ptr"))) TS_DataLossProtect_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_DataLossProtect_clone_ptr"))) TS_DataLossProtect_clone_ptr(uint32_t arg) { LDKDataLossProtect arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = DataLossProtect_clone_ptr(&arg_conv); + intptr_t ret_val = DataLossProtect_clone_ptr(&arg_conv); return ret_val; } @@ -25116,11 +25129,11 @@ uint32_t __attribute__((export_name("TS_DataLossProtect_clone"))) TS_DataLossPr orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25140,7 +25153,7 @@ int8_tArray __attribute__((export_name("TS_ChannelReestablish_get_channel_id")) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ChannelReestablish_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -25152,7 +25165,7 @@ void __attribute__((export_name("TS_ChannelReestablish_set_channel_id"))) TS_Ch CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref); } @@ -25192,22 +25205,22 @@ void __attribute__((export_name("TS_ChannelReestablish_set_next_remote_commitme static inline uintptr_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) { LDKChannelReestablish ret_var = ChannelReestablish_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelReestablish_clone_ptr"))) TS_ChannelReestablish_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelReestablish_clone_ptr"))) TS_ChannelReestablish_clone_ptr(uint32_t arg) { LDKChannelReestablish arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelReestablish_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelReestablish_clone_ptr(&arg_conv); return ret_val; } @@ -25217,11 +25230,11 @@ uint32_t __attribute__((export_name("TS_ChannelReestablish_clone"))) TS_Channel orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25241,7 +25254,7 @@ int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_channel_i this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *AnnouncementSignatures_get_channel_id(&this_ptr_conv), 32); return ret_arr; } @@ -25253,7 +25266,7 @@ void __attribute__((export_name("TS_AnnouncementSignatures_set_channel_id"))) T CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref); } @@ -25279,7 +25292,7 @@ int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_node_sign this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -25291,7 +25304,7 @@ void __attribute__((export_name("TS_AnnouncementSignatures_set_node_signature") CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref); } @@ -25300,7 +25313,7 @@ int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_bitcoin_s this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -25312,26 +25325,26 @@ void __attribute__((export_name("TS_AnnouncementSignatures_set_bitcoin_signatur CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref); } uint32_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) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg->arr_len == 32); - memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); + memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg); LDKSignature node_signature_arg_ref; CHECK(node_signature_arg->arr_len == 64); - memcpy(node_signature_arg_ref.compact_form, node_signature_arg->elems, 64); + memcpy(node_signature_arg_ref.compact_form, node_signature_arg->elems, 64); FREE(node_signature_arg); LDKSignature bitcoin_signature_arg_ref; CHECK(bitcoin_signature_arg->arr_len == 64); - memcpy(bitcoin_signature_arg_ref.compact_form, bitcoin_signature_arg->elems, 64); + memcpy(bitcoin_signature_arg_ref.compact_form, bitcoin_signature_arg->elems, 64); FREE(bitcoin_signature_arg); LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25340,22 +25353,22 @@ uint32_t __attribute__((export_name("TS_AnnouncementSignatures_new"))) TS_Annou static inline uintptr_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) { LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_AnnouncementSignatures_clone_ptr"))) TS_AnnouncementSignatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_AnnouncementSignatures_clone_ptr"))) TS_AnnouncementSignatures_clone_ptr(uint32_t arg) { LDKAnnouncementSignatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = AnnouncementSignatures_clone_ptr(&arg_conv); + intptr_t ret_val = AnnouncementSignatures_clone_ptr(&arg_conv); return ret_val; } @@ -25365,11 +25378,11 @@ uint32_t __attribute__((export_name("TS_AnnouncementSignatures_clone"))) TS_Ann orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25378,7 +25391,7 @@ uint32_t __attribute__((export_name("TS_AnnouncementSignatures_clone"))) TS_Ann void __attribute__((export_name("TS_NetAddress_free"))) TS_NetAddress_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -25388,12 +25401,12 @@ void __attribute__((export_name("TS_NetAddress_free"))) TS_NetAddress_free(uint static inline uintptr_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) { LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_NetAddress_clone_ptr"))) TS_NetAddress_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NetAddress_clone_ptr"))) TS_NetAddress_clone_ptr(uint32_t arg) { LDKNetAddress* arg_conv = (LDKNetAddress*)arg; - int64_t ret_val = NetAddress_clone_ptr(arg_conv); + intptr_t ret_val = NetAddress_clone_ptr(arg_conv); return ret_val; } @@ -25401,54 +25414,54 @@ uint32_t __attribute__((export_name("TS_NetAddress_clone"))) TS_NetAddress_clon LDKNetAddress* orig_conv = (LDKNetAddress*)orig; LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_NetAddress_ipv4"))) TS_NetAddress_ipv4(int8_tArray addr, int16_t port) { LDKFourBytes addr_ref; CHECK(addr->arr_len == 4); - memcpy(addr_ref.data, addr->elems, 4); + memcpy(addr_ref.data, addr->elems, 4); FREE(addr); LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_ipv4(addr_ref, port); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_NetAddress_ipv6"))) TS_NetAddress_ipv6(int8_tArray addr, int16_t port) { LDKSixteenBytes addr_ref; CHECK(addr->arr_len == 16); - memcpy(addr_ref.data, addr->elems, 16); + memcpy(addr_ref.data, addr->elems, 16); FREE(addr); LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_ipv6(addr_ref, port); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_NetAddress_onion_v2"))) TS_NetAddress_onion_v2(int8_tArray a) { LDKTwelveBytes a_ref; CHECK(a->arr_len == 12); - memcpy(a_ref.data, a->elems, 12); + memcpy(a_ref.data, a->elems, 12); FREE(a); LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_onion_v2(a_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_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) { LDKThirtyTwoBytes ed25519_pubkey_ref; CHECK(ed25519_pubkey->arr_len == 32); - memcpy(ed25519_pubkey_ref.data, ed25519_pubkey->elems, 32); + memcpy(ed25519_pubkey_ref.data, ed25519_pubkey->elems, 32); FREE(ed25519_pubkey); LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress"); *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_NetAddress_write"))) TS_NetAddress_write(uint32_t obj) { LDKNetAddress* obj_conv = (LDKNetAddress*)obj; LDKCVec_u8Z ret_var = NetAddress_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -25457,10 +25470,10 @@ int8_tArray __attribute__((export_name("TS_NetAddress_write"))) TS_NetAddress_w uint32_t __attribute__((export_name("TS_NetAddress_read"))) TS_NetAddress_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ"); *ret_conv = NetAddress_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_UnsignedNodeAnnouncement_free"))) TS_UnsignedNodeAnnouncement_free(uint32_t this_obj) { @@ -25477,11 +25490,11 @@ uint32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_features") this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25523,7 +25536,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_node_id this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25535,7 +25548,7 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_node_id"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref); } @@ -25544,7 +25557,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_rgb"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(3); + int8_tArray ret_arr = init_int8_tArray(3, __LINE__); memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv), 3); return ret_arr; } @@ -25556,7 +25569,7 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_rgb"))) TS_Uns CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK(val->arr_len == 3); - memcpy(val_ref.data, val->elems, 3); + memcpy(val_ref.data, val->elems, 3); FREE(val); UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref); } @@ -25565,7 +25578,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_alias") this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv), 32); return ret_arr; } @@ -25577,7 +25590,7 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_alias"))) TS_U CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref); } @@ -25592,13 +25605,13 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_addresses"))) val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t m = 0; m < val_constr.datalen; m++) { uint32_t val_conv_12 = val_vals[m]; - void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1); + void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1); CHECK_ACCESS(val_conv_12_ptr); LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr); - val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1)); + val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1)); val_constr.data[m] = val_conv_12_conv; } UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); @@ -25606,22 +25619,22 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_addresses"))) static inline uintptr_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone_ptr"))) TS_UnsignedNodeAnnouncement_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone_ptr"))) TS_UnsignedNodeAnnouncement_clone_ptr(uint32_t arg) { LDKUnsignedNodeAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); + intptr_t ret_val = UnsignedNodeAnnouncement_clone_ptr(&arg_conv); return ret_val; } @@ -25631,11 +25644,11 @@ uint32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone"))) TS_U orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25655,7 +25668,7 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncement_get_signature"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -25667,7 +25680,7 @@ void __attribute__((export_name("TS_NodeAnnouncement_set_signature"))) TS_NodeA CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); NodeAnnouncement_set_signature(&this_ptr_conv, val_ref); } @@ -25677,11 +25690,11 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncement_get_contents"))) TS_No this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25704,18 +25717,18 @@ void __attribute__((export_name("TS_NodeAnnouncement_set_contents"))) TS_NodeAn uint32_t __attribute__((export_name("TS_NodeAnnouncement_new"))) TS_NodeAnnouncement_new(int8_tArray signature_arg, uint32_t contents_arg) { LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKUnsignedNodeAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25724,22 +25737,22 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncement_new"))) TS_NodeAnnounc static inline uintptr_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) { LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NodeAnnouncement_clone_ptr"))) TS_NodeAnnouncement_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NodeAnnouncement_clone_ptr"))) TS_NodeAnnouncement_clone_ptr(uint32_t arg) { LDKNodeAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NodeAnnouncement_clone_ptr(&arg_conv); + intptr_t ret_val = NodeAnnouncement_clone_ptr(&arg_conv); return ret_val; } @@ -25749,11 +25762,11 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncement_clone"))) TS_NodeAnnou orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25774,11 +25787,11 @@ uint32_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_feature this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25803,7 +25816,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_chai this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -25815,7 +25828,7 @@ void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_chain_hash" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref); } @@ -25841,7 +25854,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25853,7 +25866,7 @@ void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_1") CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref); } @@ -25862,7 +25875,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25874,7 +25887,7 @@ void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_2") CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref); } @@ -25883,7 +25896,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitc this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25895,7 +25908,7 @@ void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref); } @@ -25904,7 +25917,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitc this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -25916,28 +25929,28 @@ void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref); } static inline uintptr_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) { LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone_ptr"))) TS_UnsignedChannelAnnouncement_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone_ptr"))) TS_UnsignedChannelAnnouncement_clone_ptr(uint32_t arg) { LDKUnsignedChannelAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); + intptr_t ret_val = UnsignedChannelAnnouncement_clone_ptr(&arg_conv); return ret_val; } @@ -25947,11 +25960,11 @@ uint32_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone"))) T orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -25971,7 +25984,7 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signatu this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -25983,7 +25996,7 @@ void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_1")) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref); } @@ -25992,7 +26005,7 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signatu this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -26004,7 +26017,7 @@ void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_2")) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref); } @@ -26013,7 +26026,7 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_sign this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -26025,7 +26038,7 @@ void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_1 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref); } @@ -26034,7 +26047,7 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_sign this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -26046,7 +26059,7 @@ void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_2 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref); } @@ -26056,11 +26069,11 @@ uint32_t __attribute__((export_name("TS_ChannelAnnouncement_get_contents"))) TS this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26083,27 +26096,27 @@ void __attribute__((export_name("TS_ChannelAnnouncement_set_contents"))) TS_Cha uint32_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, uint32_t contents_arg) { LDKSignature node_signature_1_arg_ref; CHECK(node_signature_1_arg->arr_len == 64); - memcpy(node_signature_1_arg_ref.compact_form, node_signature_1_arg->elems, 64); + memcpy(node_signature_1_arg_ref.compact_form, node_signature_1_arg->elems, 64); FREE(node_signature_1_arg); LDKSignature node_signature_2_arg_ref; CHECK(node_signature_2_arg->arr_len == 64); - memcpy(node_signature_2_arg_ref.compact_form, node_signature_2_arg->elems, 64); + memcpy(node_signature_2_arg_ref.compact_form, node_signature_2_arg->elems, 64); FREE(node_signature_2_arg); LDKSignature bitcoin_signature_1_arg_ref; CHECK(bitcoin_signature_1_arg->arr_len == 64); - memcpy(bitcoin_signature_1_arg_ref.compact_form, bitcoin_signature_1_arg->elems, 64); + memcpy(bitcoin_signature_1_arg_ref.compact_form, bitcoin_signature_1_arg->elems, 64); FREE(bitcoin_signature_1_arg); LDKSignature bitcoin_signature_2_arg_ref; CHECK(bitcoin_signature_2_arg->arr_len == 64); - memcpy(bitcoin_signature_2_arg_ref.compact_form, bitcoin_signature_2_arg->elems, 64); + memcpy(bitcoin_signature_2_arg_ref.compact_form, bitcoin_signature_2_arg->elems, 64); FREE(bitcoin_signature_2_arg); LDKUnsignedChannelAnnouncement contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26112,22 +26125,22 @@ uint32_t __attribute__((export_name("TS_ChannelAnnouncement_new"))) TS_ChannelA static inline uintptr_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) { LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelAnnouncement_clone_ptr"))) TS_ChannelAnnouncement_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelAnnouncement_clone_ptr"))) TS_ChannelAnnouncement_clone_ptr(uint32_t arg) { LDKChannelAnnouncement arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelAnnouncement_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelAnnouncement_clone_ptr(&arg_conv); return ret_val; } @@ -26137,11 +26150,11 @@ uint32_t __attribute__((export_name("TS_ChannelAnnouncement_clone"))) TS_Channe orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26161,7 +26174,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_chain_hash this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26173,7 +26186,7 @@ void __attribute__((export_name("TS_UnsignedChannelUpdate_set_chain_hash"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref); } @@ -26298,22 +26311,22 @@ void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_proportional_ static inline uintptr_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) { LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone_ptr"))) TS_UnsignedChannelUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone_ptr"))) TS_UnsignedChannelUpdate_clone_ptr(uint32_t arg) { LDKUnsignedChannelUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = UnsignedChannelUpdate_clone_ptr(&arg_conv); + intptr_t ret_val = UnsignedChannelUpdate_clone_ptr(&arg_conv); return ret_val; } @@ -26323,11 +26336,11 @@ uint32_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone"))) TS_Unsi orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26347,7 +26360,7 @@ int8_tArray __attribute__((export_name("TS_ChannelUpdate_get_signature"))) TS_C this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -26359,7 +26372,7 @@ void __attribute__((export_name("TS_ChannelUpdate_set_signature"))) TS_ChannelU CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); ChannelUpdate_set_signature(&this_ptr_conv, val_ref); } @@ -26369,11 +26382,11 @@ uint32_t __attribute__((export_name("TS_ChannelUpdate_get_contents"))) TS_Chann this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26396,18 +26409,18 @@ void __attribute__((export_name("TS_ChannelUpdate_set_contents"))) TS_ChannelUp uint32_t __attribute__((export_name("TS_ChannelUpdate_new"))) TS_ChannelUpdate_new(int8_tArray signature_arg, uint32_t contents_arg) { LDKSignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); - memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); + memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); LDKUnsignedChannelUpdate contents_arg_conv; contents_arg_conv.inner = (void*)(contents_arg & (~1)); contents_arg_conv.is_owned = (contents_arg & 1) || (contents_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv); contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv); LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26416,22 +26429,22 @@ uint32_t __attribute__((export_name("TS_ChannelUpdate_new"))) TS_ChannelUpdate_ static inline uintptr_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) { LDKChannelUpdate ret_var = ChannelUpdate_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelUpdate_clone_ptr"))) TS_ChannelUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelUpdate_clone_ptr"))) TS_ChannelUpdate_clone_ptr(uint32_t arg) { LDKChannelUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelUpdate_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelUpdate_clone_ptr(&arg_conv); return ret_val; } @@ -26441,11 +26454,11 @@ uint32_t __attribute__((export_name("TS_ChannelUpdate_clone"))) TS_ChannelUpdat orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26465,7 +26478,7 @@ int8_tArray __attribute__((export_name("TS_QueryChannelRange_get_chain_hash"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *QueryChannelRange_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26477,7 +26490,7 @@ void __attribute__((export_name("TS_QueryChannelRange_set_chain_hash"))) TS_Que CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref); } @@ -26518,13 +26531,13 @@ void __attribute__((export_name("TS_QueryChannelRange_set_number_of_blocks"))) uint32_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) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26533,22 +26546,22 @@ uint32_t __attribute__((export_name("TS_QueryChannelRange_new"))) TS_QueryChann static inline uintptr_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) { LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_QueryChannelRange_clone_ptr"))) TS_QueryChannelRange_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_QueryChannelRange_clone_ptr"))) TS_QueryChannelRange_clone_ptr(uint32_t arg) { LDKQueryChannelRange arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = QueryChannelRange_clone_ptr(&arg_conv); + intptr_t ret_val = QueryChannelRange_clone_ptr(&arg_conv); return ret_val; } @@ -26558,11 +26571,11 @@ uint32_t __attribute__((export_name("TS_QueryChannelRange_clone"))) TS_QueryCha orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26582,7 +26595,7 @@ int8_tArray __attribute__((export_name("TS_ReplyChannelRange_get_chain_hash"))) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ReplyChannelRange_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26594,7 +26607,7 @@ void __attribute__((export_name("TS_ReplyChannelRange_set_chain_hash"))) TS_Rep CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref); } @@ -26660,7 +26673,7 @@ void __attribute__((export_name("TS_ReplyChannelRange_set_short_channel_ids"))) val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else val_constr.data = NULL; - int64_t* val_vals = val->elems; + int64_t* val_vals = val->elems /* XXX val leaks */; for (size_t i = 0; i < val_constr.datalen; i++) { int64_t val_conv_8 = val_vals[i]; val_constr.data[i] = val_conv_8; @@ -26671,24 +26684,24 @@ void __attribute__((export_name("TS_ReplyChannelRange_set_short_channel_ids"))) uint32_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) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); LDKCVec_u64Z short_channel_ids_arg_constr; short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len; if (short_channel_ids_arg_constr.datalen > 0) short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else short_channel_ids_arg_constr.data = NULL; - int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems; + int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems /* XXX short_channel_ids_arg leaks */; for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) { int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i]; short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8; } LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26697,22 +26710,22 @@ uint32_t __attribute__((export_name("TS_ReplyChannelRange_new"))) TS_ReplyChann static inline uintptr_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) { LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ReplyChannelRange_clone_ptr"))) TS_ReplyChannelRange_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ReplyChannelRange_clone_ptr"))) TS_ReplyChannelRange_clone_ptr(uint32_t arg) { LDKReplyChannelRange arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ReplyChannelRange_clone_ptr(&arg_conv); + intptr_t ret_val = ReplyChannelRange_clone_ptr(&arg_conv); return ret_val; } @@ -26722,11 +26735,11 @@ uint32_t __attribute__((export_name("TS_ReplyChannelRange_clone"))) TS_ReplyCha orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26746,7 +26759,7 @@ int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_chain_hash" this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26758,7 +26771,7 @@ void __attribute__((export_name("TS_QueryShortChannelIds_set_chain_hash"))) TS_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref); } @@ -26773,7 +26786,7 @@ void __attribute__((export_name("TS_QueryShortChannelIds_set_short_channel_ids" val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else val_constr.data = NULL; - int64_t* val_vals = val->elems; + int64_t* val_vals = val->elems /* XXX val leaks */; for (size_t i = 0; i < val_constr.datalen; i++) { int64_t val_conv_8 = val_vals[i]; val_constr.data[i] = val_conv_8; @@ -26784,24 +26797,24 @@ void __attribute__((export_name("TS_QueryShortChannelIds_set_short_channel_ids" uint32_t __attribute__((export_name("TS_QueryShortChannelIds_new"))) TS_QueryShortChannelIds_new(int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); LDKCVec_u64Z short_channel_ids_arg_constr; short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len; if (short_channel_ids_arg_constr.datalen > 0) short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else short_channel_ids_arg_constr.data = NULL; - int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems; + int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems /* XXX short_channel_ids_arg leaks */; for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) { int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i]; short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8; } LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26810,22 +26823,22 @@ uint32_t __attribute__((export_name("TS_QueryShortChannelIds_new"))) TS_QuerySh static inline uintptr_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) { LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_QueryShortChannelIds_clone_ptr"))) TS_QueryShortChannelIds_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_QueryShortChannelIds_clone_ptr"))) TS_QueryShortChannelIds_clone_ptr(uint32_t arg) { LDKQueryShortChannelIds arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = QueryShortChannelIds_clone_ptr(&arg_conv); + intptr_t ret_val = QueryShortChannelIds_clone_ptr(&arg_conv); return ret_val; } @@ -26835,11 +26848,11 @@ uint32_t __attribute__((export_name("TS_QueryShortChannelIds_clone"))) TS_Query orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26859,7 +26872,7 @@ int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_chain_ha this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26871,7 +26884,7 @@ void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_chain_hash"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref); } @@ -26895,13 +26908,13 @@ void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_full_informatio uint32_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_new"))) TS_ReplyShortChannelIdsEnd_new(int8_tArray chain_hash_arg, jboolean full_information_arg) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26910,22 +26923,22 @@ uint32_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_new"))) TS_Repl static inline uintptr_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) { LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone_ptr"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone_ptr"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint32_t arg) { LDKReplyShortChannelIdsEnd arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); + intptr_t ret_val = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv); return ret_val; } @@ -26935,11 +26948,11 @@ uint32_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone"))) TS_Re orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -26959,7 +26972,7 @@ int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_get_chain_hash this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } @@ -26971,7 +26984,7 @@ void __attribute__((export_name("TS_GossipTimestampFilter_set_chain_hash"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref); } @@ -27012,13 +27025,13 @@ void __attribute__((export_name("TS_GossipTimestampFilter_set_timestamp_range") uint32_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) { LDKThirtyTwoBytes chain_hash_arg_ref; CHECK(chain_hash_arg->arr_len == 32); - memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); + memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg); LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27027,22 +27040,22 @@ uint32_t __attribute__((export_name("TS_GossipTimestampFilter_new"))) TS_Gossip static inline uintptr_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) { LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_GossipTimestampFilter_clone_ptr"))) TS_GossipTimestampFilter_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_GossipTimestampFilter_clone_ptr"))) TS_GossipTimestampFilter_clone_ptr(uint32_t arg) { LDKGossipTimestampFilter arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = GossipTimestampFilter_clone_ptr(&arg_conv); + intptr_t ret_val = GossipTimestampFilter_clone_ptr(&arg_conv); return ret_val; } @@ -27052,11 +27065,11 @@ uint32_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_Goss orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27065,7 +27078,7 @@ uint32_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_Goss void __attribute__((export_name("TS_ErrorAction_free"))) TS_ErrorAction_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -27075,12 +27088,12 @@ void __attribute__((export_name("TS_ErrorAction_free"))) TS_ErrorAction_free(ui static inline uintptr_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) { LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_ErrorAction_clone_ptr"))) TS_ErrorAction_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ErrorAction_clone_ptr"))) TS_ErrorAction_clone_ptr(uint32_t arg) { LDKErrorAction* arg_conv = (LDKErrorAction*)arg; - int64_t ret_val = ErrorAction_clone_ptr(arg_conv); + intptr_t ret_val = ErrorAction_clone_ptr(arg_conv); return ret_val; } @@ -27088,7 +27101,7 @@ uint32_t __attribute__((export_name("TS_ErrorAction_clone"))) TS_ErrorAction_cl LDKErrorAction* orig_conv = (LDKErrorAction*)orig; LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -27100,14 +27113,14 @@ uint32_t __attribute__((export_name("TS_ErrorAction_disconnect_peer"))) TS_Erro msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_disconnect_peer(msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ErrorAction_ignore_error"))) TS_ErrorAction_ignore_error() { LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_ignore_error(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -27115,14 +27128,14 @@ uint32_t __attribute__((export_name("TS_ErrorAction_ignore_and_log"))) TS_Error LDKLevel a_conv = LDKLevel_from_js(a); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_ignore_and_log(a_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_ErrorAction_ignore_duplicate_gossip"))) TS_ErrorAction_ignore_duplicate_gossip() { LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_ignore_duplicate_gossip(); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -27134,7 +27147,7 @@ uint32_t __attribute__((export_name("TS_ErrorAction_send_error_message"))) TS_E msg_conv = ErrorMessage_clone(&msg_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = ErrorAction_send_error_message(msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -27173,7 +27186,7 @@ uint32_t __attribute__((export_name("TS_LightningError_get_action"))) TS_Lightn CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction"); *ret_copy = LightningError_get_action(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -27182,25 +27195,25 @@ void __attribute__((export_name("TS_LightningError_set_action"))) TS_LightningE this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr); - val_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)val) & ~1)); + val_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)val) & ~1)); LightningError_set_action(&this_ptr_conv, val_conv); } uint32_t __attribute__((export_name("TS_LightningError_new"))) TS_LightningError_new(jstring err_arg, uint32_t action_arg) { LDKStr err_arg_conv = str_ref_to_owned_c(err_arg); - void* action_arg_ptr = (void*)(((uint64_t)action_arg) & ~1); + void* action_arg_ptr = (void*)(((uintptr_t)action_arg) & ~1); CHECK_ACCESS(action_arg_ptr); LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr); - action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uint64_t)action_arg) & ~1)); + action_arg_conv = ErrorAction_clone((LDKErrorAction*)(((uintptr_t)action_arg) & ~1)); LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27209,22 +27222,22 @@ uint32_t __attribute__((export_name("TS_LightningError_new"))) TS_LightningErro static inline uintptr_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) { LDKLightningError ret_var = LightningError_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_LightningError_clone_ptr"))) TS_LightningError_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_LightningError_clone_ptr"))) TS_LightningError_clone_ptr(uint32_t arg) { LDKLightningError arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = LightningError_clone_ptr(&arg_conv); + intptr_t ret_val = LightningError_clone_ptr(&arg_conv); return ret_val; } @@ -27234,11 +27247,11 @@ uint32_t __attribute__((export_name("TS_LightningError_clone"))) TS_LightningEr orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKLightningError ret_var = LightningError_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27260,15 +27273,15 @@ uint32_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_add_ht CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t p = 0; p < ret_var.datalen; p++) { LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p]; - uint64_t ret_conv_15_ref = 0; - CHECK((((uint64_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_15_ref = 0; + CHECK((((uintptr_t)ret_conv_15_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_15_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var); - ret_conv_15_ref = (uint64_t)ret_conv_15_var.inner; + ret_conv_15_ref = (uintptr_t)ret_conv_15_var.inner; if (ret_conv_15_var.is_owned) { ret_conv_15_ref |= 1; } @@ -27290,7 +27303,7 @@ void __attribute__((export_name("TS_CommitmentUpdate_set_update_add_htlcs"))) T val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t p = 0; p < val_constr.datalen; p++) { uint32_t val_conv_15 = val_vals[p]; LDKUpdateAddHTLC val_conv_15_conv; @@ -27310,15 +27323,15 @@ uint32_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fulfil CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t t = 0; t < ret_var.datalen; t++) { LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t]; - uint64_t ret_conv_19_ref = 0; - CHECK((((uint64_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_19_ref = 0; + CHECK((((uintptr_t)ret_conv_19_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_19_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var); - ret_conv_19_ref = (uint64_t)ret_conv_19_var.inner; + ret_conv_19_ref = (uintptr_t)ret_conv_19_var.inner; if (ret_conv_19_var.is_owned) { ret_conv_19_ref |= 1; } @@ -27340,7 +27353,7 @@ void __attribute__((export_name("TS_CommitmentUpdate_set_update_fulfill_htlcs") val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t t = 0; t < val_constr.datalen; t++) { uint32_t val_conv_19 = val_vals[t]; LDKUpdateFulfillHTLC val_conv_19_conv; @@ -27360,15 +27373,15 @@ uint32_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_h CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t q = 0; q < ret_var.datalen; q++) { LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q]; - uint64_t ret_conv_16_ref = 0; - CHECK((((uint64_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_16_ref = 0; + CHECK((((uintptr_t)ret_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_16_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = (uint64_t)ret_conv_16_var.inner; + ret_conv_16_ref = (uintptr_t)ret_conv_16_var.inner; if (ret_conv_16_var.is_owned) { ret_conv_16_ref |= 1; } @@ -27390,7 +27403,7 @@ void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_htlcs"))) val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t q = 0; q < val_constr.datalen; q++) { uint32_t val_conv_16 = val_vals[q]; LDKUpdateFailHTLC val_conv_16_conv; @@ -27410,15 +27423,15 @@ uint32_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_m CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t z = 0; z < ret_var.datalen; z++) { LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z]; - uint64_t ret_conv_25_ref = 0; - CHECK((((uint64_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_25_ref = 0; + CHECK((((uintptr_t)ret_conv_25_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_25_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var); - ret_conv_25_ref = (uint64_t)ret_conv_25_var.inner; + ret_conv_25_ref = (uintptr_t)ret_conv_25_var.inner; if (ret_conv_25_var.is_owned) { ret_conv_25_ref |= 1; } @@ -27440,7 +27453,7 @@ void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_malformed_ val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t z = 0; z < val_constr.datalen; z++) { uint32_t val_conv_25 = val_vals[z]; LDKUpdateFailMalformedHTLC val_conv_25_conv; @@ -27459,12 +27472,12 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_get_update_fee"))) TS_ this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27491,11 +27504,11 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_get_commitment_signed" this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27522,7 +27535,7 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements"); else update_add_htlcs_arg_constr.data = NULL; - uint32_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems; + uint32_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems /* XXX update_add_htlcs_arg leaks */; for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) { uint32_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p]; LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv; @@ -27538,7 +27551,7 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements"); else update_fulfill_htlcs_arg_constr.data = NULL; - uint32_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems; + uint32_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems /* XXX update_fulfill_htlcs_arg leaks */; for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) { uint32_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t]; LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv; @@ -27554,7 +27567,7 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements"); else update_fail_htlcs_arg_constr.data = NULL; - uint32_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems; + uint32_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems /* XXX update_fail_htlcs_arg leaks */; for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) { uint32_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q]; LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv; @@ -27570,7 +27583,7 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements"); else update_fail_malformed_htlcs_arg_constr.data = NULL; - uint32_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems; + uint32_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems /* XXX update_fail_malformed_htlcs_arg leaks */; for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) { uint32_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z]; LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv; @@ -27591,11 +27604,11 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv); commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27604,22 +27617,22 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_new"))) TS_CommitmentU static inline uintptr_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) { LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_CommitmentUpdate_clone_ptr"))) TS_CommitmentUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CommitmentUpdate_clone_ptr"))) TS_CommitmentUpdate_clone_ptr(uint32_t arg) { LDKCommitmentUpdate arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = CommitmentUpdate_clone_ptr(&arg_conv); + intptr_t ret_val = CommitmentUpdate_clone_ptr(&arg_conv); return ret_val; } @@ -27629,11 +27642,11 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_Commitmen orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -27642,7 +27655,7 @@ uint32_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_Commitmen void __attribute__((export_name("TS_ChannelMessageHandler_free"))) TS_ChannelMessageHandler_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -27651,7 +27664,7 @@ void __attribute__((export_name("TS_ChannelMessageHandler_free"))) TS_ChannelMe void __attribute__((export_name("TS_RoutingMessageHandler_free"))) TS_RoutingMessageHandler_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -27664,7 +27677,7 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_write"))) TS_AcceptCha obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27673,10 +27686,10 @@ int8_tArray __attribute__((export_name("TS_AcceptChannel_write"))) TS_AcceptCha uint32_t __attribute__((export_name("TS_AcceptChannel_read"))) TS_AcceptChannel_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ"); *ret_conv = AcceptChannel_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_AnnouncementSignatures_write(uint32_t obj) { @@ -27685,7 +27698,7 @@ int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27694,10 +27707,10 @@ int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_ uint32_t __attribute__((export_name("TS_AnnouncementSignatures_read"))) TS_AnnouncementSignatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ"); *ret_conv = AnnouncementSignatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_ChannelReestablish_write(uint32_t obj) { @@ -27706,7 +27719,7 @@ int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_Chan obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27715,10 +27728,10 @@ int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_Chan uint32_t __attribute__((export_name("TS_ChannelReestablish_read"))) TS_ChannelReestablish_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ"); *ret_conv = ChannelReestablish_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSigned_write(uint32_t obj) { @@ -27727,7 +27740,7 @@ int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSi obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27736,10 +27749,10 @@ int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSi uint32_t __attribute__((export_name("TS_ClosingSigned_read"))) TS_ClosingSigned_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ"); *ret_conv = ClosingSigned_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_ClosingSignedFeeRange_write(uint32_t obj) { @@ -27748,7 +27761,7 @@ int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_C obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27757,10 +27770,10 @@ int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_C uint32_t __attribute__((export_name("TS_ClosingSignedFeeRange_read"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ"); *ret_conv = ClosingSignedFeeRange_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_CommitmentSigned_write(uint32_t obj) { @@ -27769,7 +27782,7 @@ int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_Commit obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27778,10 +27791,10 @@ int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_Commit uint32_t __attribute__((export_name("TS_CommitmentSigned_read"))) TS_CommitmentSigned_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ"); *ret_conv = CommitmentSigned_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingCreated_write(uint32_t obj) { @@ -27790,7 +27803,7 @@ int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingC obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27799,10 +27812,10 @@ int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingC uint32_t __attribute__((export_name("TS_FundingCreated_read"))) TS_FundingCreated_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ"); *ret_conv = FundingCreated_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSigned_write(uint32_t obj) { @@ -27811,7 +27824,7 @@ int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSi obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27820,10 +27833,10 @@ int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSi uint32_t __attribute__((export_name("TS_FundingSigned_read"))) TS_FundingSigned_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ"); *ret_conv = FundingSigned_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_FundingLocked_write"))) TS_FundingLocked_write(uint32_t obj) { @@ -27832,7 +27845,7 @@ int8_tArray __attribute__((export_name("TS_FundingLocked_write"))) TS_FundingLo obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = FundingLocked_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27841,10 +27854,10 @@ int8_tArray __attribute__((export_name("TS_FundingLocked_write"))) TS_FundingLo uint32_t __attribute__((export_name("TS_FundingLocked_read"))) TS_FundingLocked_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_FundingLockedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingLockedDecodeErrorZ), "LDKCResult_FundingLockedDecodeErrorZ"); *ret_conv = FundingLocked_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint32_t obj) { @@ -27853,7 +27866,7 @@ int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint32_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Init_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27862,10 +27875,10 @@ int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint32_ uint32_t __attribute__((export_name("TS_Init_read"))) TS_Init_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ"); *ret_conv = Init_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel_write(uint32_t obj) { @@ -27874,7 +27887,7 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27883,10 +27896,10 @@ int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel uint32_t __attribute__((export_name("TS_OpenChannel_read"))) TS_OpenChannel_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ"); *ret_conv = OpenChannel_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndACK_write(uint32_t obj) { @@ -27895,7 +27908,7 @@ int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndA obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27904,10 +27917,10 @@ int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndA uint32_t __attribute__((export_name("TS_RevokeAndACK_read"))) TS_RevokeAndACK_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ"); *ret_conv = RevokeAndACK_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write(uint32_t obj) { @@ -27916,7 +27929,7 @@ int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27925,10 +27938,10 @@ int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write uint32_t __attribute__((export_name("TS_Shutdown_read"))) TS_Shutdown_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ"); *ret_conv = Shutdown_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFailHTLC_write(uint32_t obj) { @@ -27937,7 +27950,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFa obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27946,10 +27959,10 @@ int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFa uint32_t __attribute__((export_name("TS_UpdateFailHTLC_read"))) TS_UpdateFailHTLC_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ"); *ret_conv = UpdateFailHTLC_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS_UpdateFailMalformedHTLC_write(uint32_t obj) { @@ -27958,7 +27971,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27967,10 +27980,10 @@ int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS uint32_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_read"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ"); *ret_conv = UpdateFailMalformedHTLC_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_write(uint32_t obj) { @@ -27979,7 +27992,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_wri obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -27988,10 +28001,10 @@ int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_wri uint32_t __attribute__((export_name("TS_UpdateFee_read"))) TS_UpdateFee_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ"); *ret_conv = UpdateFee_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_UpdateFulfillHTLC_write(uint32_t obj) { @@ -28000,7 +28013,7 @@ int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_Updat obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28009,10 +28022,10 @@ int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_Updat uint32_t __attribute__((export_name("TS_UpdateFulfillHTLC_read"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ"); *ret_conv = UpdateFulfillHTLC_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAddHTLC_write(uint32_t obj) { @@ -28021,7 +28034,7 @@ int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAdd obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28030,10 +28043,10 @@ int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAdd uint32_t __attribute__((export_name("TS_UpdateAddHTLC_read"))) TS_UpdateAddHTLC_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ"); *ret_conv = UpdateAddHTLC_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint32_t obj) { @@ -28042,7 +28055,7 @@ int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint32_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Ping_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28051,10 +28064,10 @@ int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint32_ uint32_t __attribute__((export_name("TS_Ping_read"))) TS_Ping_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ"); *ret_conv = Ping_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint32_t obj) { @@ -28063,7 +28076,7 @@ int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint32_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Pong_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28072,10 +28085,10 @@ int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint32_ uint32_t __attribute__((export_name("TS_Pong_read"))) TS_Pong_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ"); *ret_conv = Pong_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write"))) TS_UnsignedChannelAnnouncement_write(uint32_t obj) { @@ -28084,7 +28097,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write")) obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28093,10 +28106,10 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write")) uint32_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_read"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ"); *ret_conv = UnsignedChannelAnnouncement_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_ChannelAnnouncement_write(uint32_t obj) { @@ -28105,7 +28118,7 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_Cha obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28114,10 +28127,10 @@ int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_Cha uint32_t __attribute__((export_name("TS_ChannelAnnouncement_read"))) TS_ChannelAnnouncement_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ"); *ret_conv = ChannelAnnouncement_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_UnsignedChannelUpdate_write(uint32_t obj) { @@ -28126,7 +28139,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_U obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28135,10 +28148,10 @@ int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_U uint32_t __attribute__((export_name("TS_UnsignedChannelUpdate_read"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ"); *ret_conv = UnsignedChannelUpdate_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUpdate_write(uint32_t obj) { @@ -28147,7 +28160,7 @@ int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUp obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28156,10 +28169,10 @@ int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUp uint32_t __attribute__((export_name("TS_ChannelUpdate_read"))) TS_ChannelUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ"); *ret_conv = ChannelUpdate_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessage_write(uint32_t obj) { @@ -28168,7 +28181,7 @@ int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessa obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28177,10 +28190,10 @@ int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessa uint32_t __attribute__((export_name("TS_ErrorMessage_read"))) TS_ErrorMessage_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ"); *ret_conv = ErrorMessage_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) TS_UnsignedNodeAnnouncement_write(uint32_t obj) { @@ -28189,7 +28202,7 @@ int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) T obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28198,10 +28211,10 @@ int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) T uint32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_read"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ"); *ret_conv = UnsignedNodeAnnouncement_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAnnouncement_write(uint32_t obj) { @@ -28210,7 +28223,7 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAn obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28219,19 +28232,19 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAn uint32_t __attribute__((export_name("TS_NodeAnnouncement_read"))) TS_NodeAnnouncement_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ"); *ret_conv = NodeAnnouncement_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_QueryShortChannelIds_read"))) TS_QueryShortChannelIds_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ"); *ret_conv = QueryShortChannelIds_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_write"))) TS_QueryShortChannelIds_write(uint32_t obj) { @@ -28240,7 +28253,7 @@ int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_write"))) TS_Qu obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28252,7 +28265,7 @@ int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_write"))) TS obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28261,10 +28274,10 @@ int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_write"))) TS uint32_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_read"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ"); *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int32_t __attribute__((export_name("TS_QueryChannelRange_end_blocknum"))) TS_QueryChannelRange_end_blocknum(uint32_t this_arg) { @@ -28282,7 +28295,7 @@ int8_tArray __attribute__((export_name("TS_QueryChannelRange_write"))) TS_Query obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28291,19 +28304,19 @@ int8_tArray __attribute__((export_name("TS_QueryChannelRange_write"))) TS_Query uint32_t __attribute__((export_name("TS_QueryChannelRange_read"))) TS_QueryChannelRange_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ"); *ret_conv = QueryChannelRange_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ReplyChannelRange_read"))) TS_ReplyChannelRange_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ"); *ret_conv = ReplyChannelRange_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ReplyChannelRange_write"))) TS_ReplyChannelRange_write(uint32_t obj) { @@ -28312,7 +28325,7 @@ int8_tArray __attribute__((export_name("TS_ReplyChannelRange_write"))) TS_Reply obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28324,7 +28337,7 @@ int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_write"))) TS_G obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -28333,15 +28346,15 @@ int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_write"))) TS_G uint32_t __attribute__((export_name("TS_GossipTimestampFilter_read"))) TS_GossipTimestampFilter_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ"); *ret_conv = GossipTimestampFilter_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_CustomMessageHandler_free"))) TS_CustomMessageHandler_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -28358,11 +28371,11 @@ void __attribute__((export_name("TS_IgnoringMessageHandler_free"))) TS_Ignoring uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_new"))) TS_IgnoringMessageHandler_new() { LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28376,7 +28389,7 @@ uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_MessageSendEv CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_RoutingMessageHandler"))) TS_IgnoringMessageHandler_as_RoutingMessageHandler(uint32_t this_arg) { @@ -28386,7 +28399,7 @@ uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_RoutingMessag CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageReader"))) TS_IgnoringMessageHandler_as_CustomMessageReader(uint32_t this_arg) { @@ -28396,7 +28409,7 @@ uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessage CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader"); *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageHandler"))) TS_IgnoringMessageHandler_as_CustomMessageHandler(uint32_t this_arg) { @@ -28406,7 +28419,7 @@ uint32_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessage CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler"); *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_ErroringMessageHandler_free"))) TS_ErroringMessageHandler_free(uint32_t this_obj) { @@ -28419,11 +28432,11 @@ void __attribute__((export_name("TS_ErroringMessageHandler_free"))) TS_Erroring uint32_t __attribute__((export_name("TS_ErroringMessageHandler_new"))) TS_ErroringMessageHandler_new() { LDKErroringMessageHandler ret_var = ErroringMessageHandler_new(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28437,7 +28450,7 @@ uint32_t __attribute__((export_name("TS_ErroringMessageHandler_as_MessageSendEv CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_ErroringMessageHandler_as_ChannelMessageHandler"))) TS_ErroringMessageHandler_as_ChannelMessageHandler(uint32_t this_arg) { @@ -28447,7 +28460,7 @@ uint32_t __attribute__((export_name("TS_ErroringMessageHandler_as_ChannelMessag CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_MessageHandler_free"))) TS_MessageHandler_free(uint32_t this_obj) { @@ -28464,7 +28477,7 @@ uint32_t __attribute__((export_name("TS_MessageHandler_get_chan_handler"))) TS_ this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)MessageHandler_get_chan_handler(&this_ptr_conv)) | 1; return ret_ret; } @@ -28473,7 +28486,7 @@ void __attribute__((export_name("TS_MessageHandler_set_chan_handler"))) TS_Mess this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr); MessageHandler_set_chan_handler(&this_ptr_conv, val_conv); @@ -28485,7 +28498,7 @@ uint32_t __attribute__((export_name("TS_MessageHandler_get_route_handler"))) TS this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = ((uint64_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; + uintptr_t ret_ret = ((uintptr_t)MessageHandler_get_route_handler(&this_ptr_conv)) | 1; return ret_ret; } @@ -28494,25 +28507,25 @@ void __attribute__((export_name("TS_MessageHandler_set_route_handler"))) TS_Mes this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr); MessageHandler_set_route_handler(&this_ptr_conv, val_conv); } uint32_t __attribute__((export_name("TS_MessageHandler_new"))) TS_MessageHandler_new(uint32_t chan_handler_arg, uint32_t route_handler_arg) { - void* chan_handler_arg_ptr = (void*)(((uint64_t)chan_handler_arg) & ~1); + void* chan_handler_arg_ptr = (void*)(((uintptr_t)chan_handler_arg) & ~1); CHECK_ACCESS(chan_handler_arg_ptr); LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr); - void* route_handler_arg_ptr = (void*)(((uint64_t)route_handler_arg) & ~1); + void* route_handler_arg_ptr = (void*)(((uintptr_t)route_handler_arg) & ~1); CHECK_ACCESS(route_handler_arg_ptr); LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr); LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28522,28 +28535,28 @@ uint32_t __attribute__((export_name("TS_MessageHandler_new"))) TS_MessageHandle static inline uintptr_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) { LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); *ret_ret = SocketDescriptor_clone(arg); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } -int64_t __attribute__((export_name("TS_SocketDescriptor_clone_ptr"))) TS_SocketDescriptor_clone_ptr(uint32_t arg) { - void* arg_ptr = (void*)(((uint64_t)arg) & ~1); +intptr_t __attribute__((export_name("TS_SocketDescriptor_clone_ptr"))) TS_SocketDescriptor_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr; - int64_t ret_val = SocketDescriptor_clone_ptr(arg_conv); + intptr_t ret_val = SocketDescriptor_clone_ptr(arg_conv); return ret_val; } uint32_t __attribute__((export_name("TS_SocketDescriptor_clone"))) TS_SocketDescriptor_clone(uint32_t orig) { - void* orig_ptr = (void*)(((uint64_t)orig) & ~1); + void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr; LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); *ret_ret = SocketDescriptor_clone(orig_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_SocketDescriptor_free"))) TS_SocketDescriptor_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -28577,11 +28590,11 @@ void __attribute__((export_name("TS_PeerHandleError_set_no_connection_possible" uint32_t __attribute__((export_name("TS_PeerHandleError_new"))) TS_PeerHandleError_new(jboolean no_connection_possible_arg) { LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28590,22 +28603,22 @@ uint32_t __attribute__((export_name("TS_PeerHandleError_new"))) TS_PeerHandleEr static inline uintptr_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) { LDKPeerHandleError ret_var = PeerHandleError_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_PeerHandleError_clone_ptr"))) TS_PeerHandleError_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_PeerHandleError_clone_ptr"))) TS_PeerHandleError_clone_ptr(uint32_t arg) { LDKPeerHandleError arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = PeerHandleError_clone_ptr(&arg_conv); + intptr_t ret_val = PeerHandleError_clone_ptr(&arg_conv); return ret_val; } @@ -28615,11 +28628,11 @@ uint32_t __attribute__((export_name("TS_PeerHandleError_clone"))) TS_PeerHandle orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28642,23 +28655,23 @@ uint32_t __attribute__((export_name("TS_PeerManager_new"))) TS_PeerManager_new( // Warning: we need a move here but no clone is available for LDKMessageHandler LDKSecretKey our_node_secret_ref; CHECK(our_node_secret->arr_len == 32); - memcpy(our_node_secret_ref.bytes, our_node_secret->elems, 32); + memcpy(our_node_secret_ref.bytes, our_node_secret->elems, 32); FREE(our_node_secret); unsigned char ephemeral_random_data_arr[32]; CHECK(ephemeral_random_data->arr_len == 32); - memcpy(ephemeral_random_data_arr, ephemeral_random_data->elems, 32); + memcpy(ephemeral_random_data_arr, ephemeral_random_data->elems, 32); FREE(ephemeral_random_data); unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr; - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - void* custom_message_handler_ptr = (void*)(((uint64_t)custom_message_handler) & ~1); + void* custom_message_handler_ptr = (void*)(((uintptr_t)custom_message_handler) & ~1); CHECK_ACCESS(custom_message_handler_ptr); LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr); LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -28672,10 +28685,10 @@ ptrArray __attribute__((export_name("TS_PeerManager_get_peer_node_ids"))) TS_Pe CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { - int8_tArray ret_conv_12_arr = init_int8_tArray(33); + int8_tArray ret_conv_12_arr = init_int8_tArray(33, __LINE__); memcpy(ret_conv_12_arr->elems, ret_var.data[m].compressed_form, 33); ret_arr_ptr[m] = ret_conv_12_arr; } @@ -28691,13 +28704,13 @@ uint32_t __attribute__((export_name("TS_PeerManager_new_outbound_connection"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey their_node_id_ref; CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); - void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); + memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); CHECK_ACCESS(descriptor_ptr); LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_PeerManager_new_inbound_connection"))) TS_PeerManager_new_inbound_connection(uint32_t this_arg, uint32_t descriptor) { @@ -28705,12 +28718,12 @@ uint32_t __attribute__((export_name("TS_PeerManager_new_inbound_connection"))) this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); CHECK_ACCESS(descriptor_ptr); LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr); LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_PeerManager_write_buffer_space_avail"))) TS_PeerManager_write_buffer_space_avail(uint32_t this_arg, uint32_t descriptor) { @@ -28718,12 +28731,12 @@ uint32_t __attribute__((export_name("TS_PeerManager_write_buffer_space_avail")) this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_PeerManager_read_event"))) TS_PeerManager_read_event(uint32_t this_arg, uint32_t peer_descriptor, int8_tArray data) { @@ -28731,15 +28744,15 @@ uint32_t __attribute__((export_name("TS_PeerManager_read_event"))) TS_PeerManag this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* peer_descriptor_ptr = (void*)(((uint64_t)peer_descriptor) & ~1); + void* peer_descriptor_ptr = (void*)(((uintptr_t)peer_descriptor) & ~1); if (!(peer_descriptor & 1)) { CHECK_ACCESS(peer_descriptor_ptr); } LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr; LDKu8slice data_ref; data_ref.datalen = data->arr_len; - data_ref.data = data->elems; + data_ref.data = data->elems /* XXX data leaks */; LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_PeerManager_process_events"))) TS_PeerManager_process_events(uint32_t this_arg) { @@ -28755,7 +28768,7 @@ void __attribute__((export_name("TS_PeerManager_socket_disconnected"))) TS_Peer this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* descriptor_ptr = (void*)(((uint64_t)descriptor) & ~1); + void* descriptor_ptr = (void*)(((uintptr_t)descriptor) & ~1); if (!(descriptor & 1)) { CHECK_ACCESS(descriptor_ptr); } LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr; PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv); @@ -28768,7 +28781,7 @@ void __attribute__((export_name("TS_PeerManager_disconnect_by_node_id"))) TS_Pe CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible); } @@ -28801,9 +28814,9 @@ int64_t __attribute__((export_name("TS_htlc_timeout_tx_weight"))) TS_htlc_timeo int8_tArray __attribute__((export_name("TS_build_commitment_secret"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) { unsigned char commitment_seed_arr[32]; CHECK(commitment_seed->arr_len == 32); - memcpy(commitment_seed_arr, commitment_seed->elems, 32); + memcpy(commitment_seed_arr, commitment_seed->elems, 32); FREE(commitment_seed); unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr; - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, build_commitment_secret(commitment_seed_ref, idx).data, 32); return ret_arr; } @@ -28812,18 +28825,18 @@ int8_tArray __attribute__((export_name("TS_build_closing_transaction"))) TS_bui LDKCVec_u8Z to_holder_script_ref; to_holder_script_ref.datalen = to_holder_script->arr_len; to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); + memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script); LDKCVec_u8Z to_counterparty_script_ref; to_counterparty_script_ref.datalen = to_counterparty_script->arr_len; to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); + memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script); LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); 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); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); Transaction_free(ret_var); return ret_arr; @@ -28832,52 +28845,52 @@ int8_tArray __attribute__((export_name("TS_build_closing_transaction"))) TS_bui uint32_t __attribute__((export_name("TS_derive_private_key"))) TS_derive_private_key(int8_tArray per_commitment_point, int8_tArray base_secret) { LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); unsigned char base_secret_arr[32]; CHECK(base_secret->arr_len == 32); - memcpy(base_secret_arr, base_secret->elems, 32); + memcpy(base_secret_arr, base_secret->elems, 32); FREE(base_secret); unsigned char (*base_secret_ref)[32] = &base_secret_arr; LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_derive_public_key"))) TS_derive_public_key(int8_tArray per_commitment_point, int8_tArray base_point) { LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); LDKPublicKey base_point_ref; CHECK(base_point->arr_len == 33); - memcpy(base_point_ref.compressed_form, base_point->elems, 33); + memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_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) { unsigned char per_commitment_secret_arr[32]; CHECK(per_commitment_secret->arr_len == 32); - memcpy(per_commitment_secret_arr, per_commitment_secret->elems, 32); + memcpy(per_commitment_secret_arr, per_commitment_secret->elems, 32); FREE(per_commitment_secret); unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr; unsigned char countersignatory_revocation_base_secret_arr[32]; CHECK(countersignatory_revocation_base_secret->arr_len == 32); - memcpy(countersignatory_revocation_base_secret_arr, countersignatory_revocation_base_secret->elems, 32); + memcpy(countersignatory_revocation_base_secret_arr, countersignatory_revocation_base_secret->elems, 32); FREE(countersignatory_revocation_base_secret); unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr; LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_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) { LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); LDKPublicKey countersignatory_revocation_base_point_ref; CHECK(countersignatory_revocation_base_point->arr_len == 33); - memcpy(countersignatory_revocation_base_point_ref.compressed_form, countersignatory_revocation_base_point->elems, 33); + memcpy(countersignatory_revocation_base_point_ref.compressed_form, countersignatory_revocation_base_point->elems, 33); FREE(countersignatory_revocation_base_point); LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_TxCreationKeys_free"))) TS_TxCreationKeys_free(uint32_t this_obj) { @@ -28893,7 +28906,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_per_commitment_po this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -28905,7 +28918,7 @@ void __attribute__((export_name("TS_TxCreationKeys_set_per_commitment_point"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref); } @@ -28914,7 +28927,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_revocation_key")) this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -28926,7 +28939,7 @@ void __attribute__((export_name("TS_TxCreationKeys_set_revocation_key"))) TS_Tx CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref); } @@ -28935,7 +28948,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_htlc_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -28947,7 +28960,7 @@ void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_htlc_key"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref); } @@ -28956,7 +28969,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_countersignatory_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -28968,7 +28981,7 @@ void __attribute__((export_name("TS_TxCreationKeys_set_countersignatory_htlc_ke CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref); } @@ -28977,7 +28990,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_delay this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -28989,32 +29002,32 @@ void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_delayed_paym CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref); } uint32_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) { LDKPublicKey per_commitment_point_arg_ref; CHECK(per_commitment_point_arg->arr_len == 33); - memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); + memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg); LDKPublicKey revocation_key_arg_ref; CHECK(revocation_key_arg->arr_len == 33); - memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); + memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); FREE(revocation_key_arg); LDKPublicKey broadcaster_htlc_key_arg_ref; CHECK(broadcaster_htlc_key_arg->arr_len == 33); - memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); + memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); FREE(broadcaster_htlc_key_arg); LDKPublicKey countersignatory_htlc_key_arg_ref; CHECK(countersignatory_htlc_key_arg->arr_len == 33); - memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); + memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); FREE(countersignatory_htlc_key_arg); LDKPublicKey broadcaster_delayed_payment_key_arg_ref; CHECK(broadcaster_delayed_payment_key_arg->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); + memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); FREE(broadcaster_delayed_payment_key_arg); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29023,22 +29036,22 @@ uint32_t __attribute__((export_name("TS_TxCreationKeys_new"))) TS_TxCreationKey static inline uintptr_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) { LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_TxCreationKeys_clone_ptr"))) TS_TxCreationKeys_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_TxCreationKeys_clone_ptr"))) TS_TxCreationKeys_clone_ptr(uint32_t arg) { LDKTxCreationKeys arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = TxCreationKeys_clone_ptr(&arg_conv); + intptr_t ret_val = TxCreationKeys_clone_ptr(&arg_conv); return ret_val; } @@ -29048,11 +29061,11 @@ uint32_t __attribute__((export_name("TS_TxCreationKeys_clone"))) TS_TxCreationK orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29065,7 +29078,7 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_write"))) TS_TxCreati obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29074,10 +29087,10 @@ int8_tArray __attribute__((export_name("TS_TxCreationKeys_write"))) TS_TxCreati uint32_t __attribute__((export_name("TS_TxCreationKeys_read"))) TS_TxCreationKeys_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); *ret_conv = TxCreationKeys_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ChannelPublicKeys_free"))) TS_ChannelPublicKeys_free(uint32_t this_obj) { @@ -29093,7 +29106,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_funding_pubkey this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -29105,7 +29118,7 @@ void __attribute__((export_name("TS_ChannelPublicKeys_set_funding_pubkey"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref); } @@ -29114,7 +29127,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_revocation_bas this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -29126,7 +29139,7 @@ void __attribute__((export_name("TS_ChannelPublicKeys_set_revocation_basepoint" CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref); } @@ -29135,7 +29148,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_payment_point" this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -29147,7 +29160,7 @@ void __attribute__((export_name("TS_ChannelPublicKeys_set_payment_point"))) TS_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref); } @@ -29156,7 +29169,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_delayed_paymen this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -29168,7 +29181,7 @@ void __attribute__((export_name("TS_ChannelPublicKeys_set_delayed_payment_basep CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } @@ -29177,7 +29190,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_htlc_basepoint this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -29189,32 +29202,32 @@ void __attribute__((export_name("TS_ChannelPublicKeys_set_htlc_basepoint"))) TS CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref); } uint32_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) { LDKPublicKey funding_pubkey_arg_ref; CHECK(funding_pubkey_arg->arr_len == 33); - memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); + memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg); LDKPublicKey revocation_basepoint_arg_ref; CHECK(revocation_basepoint_arg->arr_len == 33); - memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); + memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg); LDKPublicKey payment_point_arg_ref; CHECK(payment_point_arg->arr_len == 33); - memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); + memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg); LDKPublicKey delayed_payment_basepoint_arg_ref; CHECK(delayed_payment_basepoint_arg->arr_len == 33); - memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); + memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg); LDKPublicKey htlc_basepoint_arg_ref; CHECK(htlc_basepoint_arg->arr_len == 33); - memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); + memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29223,22 +29236,22 @@ uint32_t __attribute__((export_name("TS_ChannelPublicKeys_new"))) TS_ChannelPub static inline uintptr_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) { LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelPublicKeys_clone_ptr"))) TS_ChannelPublicKeys_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelPublicKeys_clone_ptr"))) TS_ChannelPublicKeys_clone_ptr(uint32_t arg) { LDKChannelPublicKeys arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelPublicKeys_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelPublicKeys_clone_ptr(&arg_conv); return ret_val; } @@ -29248,11 +29261,11 @@ uint32_t __attribute__((export_name("TS_ChannelPublicKeys_clone"))) TS_ChannelP orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29265,7 +29278,7 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_Chann obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29274,37 +29287,37 @@ int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_Chann uint32_t __attribute__((export_name("TS_ChannelPublicKeys_read"))) TS_ChannelPublicKeys_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); *ret_conv = ChannelPublicKeys_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_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) { LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); LDKPublicKey broadcaster_delayed_payment_base_ref; CHECK(broadcaster_delayed_payment_base->arr_len == 33); - memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); + memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); FREE(broadcaster_delayed_payment_base); LDKPublicKey broadcaster_htlc_base_ref; CHECK(broadcaster_htlc_base->arr_len == 33); - memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); + memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); FREE(broadcaster_htlc_base); LDKPublicKey countersignatory_revocation_base_ref; CHECK(countersignatory_revocation_base->arr_len == 33); - memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); + memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); FREE(countersignatory_revocation_base); LDKPublicKey countersignatory_htlc_base_ref; CHECK(countersignatory_htlc_base->arr_len == 33); - memcpy(countersignatory_htlc_base_ref.compressed_form, countersignatory_htlc_base->elems, 33); + memcpy(countersignatory_htlc_base_ref.compressed_form, countersignatory_htlc_base->elems, 33); FREE(countersignatory_htlc_base); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *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); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_TxCreationKeys_from_channel_static_keys"))) TS_TxCreationKeys_from_channel_static_keys(int8_tArray per_commitment_point, uint32_t broadcaster_keys, uint32_t countersignatory_keys) { LDKPublicKey per_commitment_point_ref; CHECK(per_commitment_point->arr_len == 33); - memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); + memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point); LDKChannelPublicKeys broadcaster_keys_conv; broadcaster_keys_conv.inner = (void*)(broadcaster_keys & (~1)); broadcaster_keys_conv.is_owned = false; @@ -29315,18 +29328,18 @@ uint32_t __attribute__((export_name("TS_TxCreationKeys_from_channel_static_keys CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } 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) { LDKPublicKey revocation_key_ref; CHECK(revocation_key->arr_len == 33); - memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); + memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key); LDKPublicKey broadcaster_delayed_payment_key_ref; CHECK(broadcaster_delayed_payment_key->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); + memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key); LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29396,7 +29409,7 @@ int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_get_payment_h this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv), 32); return ret_arr; } @@ -29408,7 +29421,7 @@ void __attribute__((export_name("TS_HTLCOutputInCommitment_set_payment_hash"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref); } @@ -29419,7 +29432,7 @@ uint32_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_transaction_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -29428,27 +29441,27 @@ void __attribute__((export_name("TS_HTLCOutputInCommitment_set_transaction_outp this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)val) & ~1)); HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv); } uint32_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, uint32_t transaction_output_index_arg) { LDKThirtyTwoBytes payment_hash_arg_ref; CHECK(payment_hash_arg->arr_len == 32); - memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); - void* transaction_output_index_arg_ptr = (void*)(((uint64_t)transaction_output_index_arg) & ~1); + memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg); + void* transaction_output_index_arg_ptr = (void*)(((uintptr_t)transaction_output_index_arg) & ~1); CHECK_ACCESS(transaction_output_index_arg_ptr); LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr); - transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uint64_t)transaction_output_index_arg) & ~1)); + transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)(((uintptr_t)transaction_output_index_arg) & ~1)); LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29457,22 +29470,22 @@ uint32_t __attribute__((export_name("TS_HTLCOutputInCommitment_new"))) TS_HTLCO static inline uintptr_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) { LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone_ptr"))) TS_HTLCOutputInCommitment_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone_ptr"))) TS_HTLCOutputInCommitment_clone_ptr(uint32_t arg) { LDKHTLCOutputInCommitment arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = HTLCOutputInCommitment_clone_ptr(&arg_conv); + intptr_t ret_val = HTLCOutputInCommitment_clone_ptr(&arg_conv); return ret_val; } @@ -29482,11 +29495,11 @@ uint32_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone"))) TS_HTL orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29499,7 +29512,7 @@ int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29508,10 +29521,10 @@ int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_ uint32_t __attribute__((export_name("TS_HTLCOutputInCommitment_read"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); *ret_conv = HTLCOutputInCommitment_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htlc_redeemscript(uint32_t htlc, jboolean opt_anchors, uint32_t keys) { @@ -29524,7 +29537,7 @@ int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htl keys_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29533,12 +29546,12 @@ int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htl int8_tArray __attribute__((export_name("TS_make_funding_redeemscript"))) TS_make_funding_redeemscript(int8_tArray broadcaster, int8_tArray countersignatory) { LDKPublicKey broadcaster_ref; CHECK(broadcaster->arr_len == 33); - memcpy(broadcaster_ref.compressed_form, broadcaster->elems, 33); + memcpy(broadcaster_ref.compressed_form, broadcaster->elems, 33); FREE(broadcaster); LDKPublicKey countersignatory_ref; CHECK(countersignatory->arr_len == 33); - memcpy(countersignatory_ref.compressed_form, countersignatory->elems, 33); + memcpy(countersignatory_ref.compressed_form, countersignatory->elems, 33); FREE(countersignatory); LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29547,7 +29560,7 @@ int8_tArray __attribute__((export_name("TS_make_funding_redeemscript"))) TS_mak 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, uint32_t htlc, jboolean opt_anchors, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) { unsigned char commitment_txid_arr[32]; CHECK(commitment_txid->arr_len == 32); - memcpy(commitment_txid_arr, commitment_txid->elems, 32); + memcpy(commitment_txid_arr, commitment_txid->elems, 32); FREE(commitment_txid); unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr; LDKHTLCOutputInCommitment htlc_conv; htlc_conv.inner = (void*)(htlc & (~1)); @@ -29555,12 +29568,12 @@ int8_tArray __attribute__((export_name("TS_build_htlc_transaction"))) TS_build_ CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv); LDKPublicKey broadcaster_delayed_payment_key_ref; CHECK(broadcaster_delayed_payment_key->arr_len == 33); - memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); + memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key); LDKPublicKey revocation_key_ref; CHECK(revocation_key->arr_len == 33); - memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); + memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key); 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); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); Transaction_free(ret_var); return ret_arr; @@ -29569,9 +29582,9 @@ int8_tArray __attribute__((export_name("TS_build_htlc_transaction"))) TS_build_ int8_tArray __attribute__((export_name("TS_get_anchor_redeemscript"))) TS_get_anchor_redeemscript(int8_tArray funding_pubkey) { LDKPublicKey funding_pubkey_ref; CHECK(funding_pubkey->arr_len == 33); - memcpy(funding_pubkey_ref.compressed_form, funding_pubkey->elems, 33); + memcpy(funding_pubkey_ref.compressed_form, funding_pubkey->elems, 33); FREE(funding_pubkey); LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29591,11 +29604,11 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29655,12 +29668,12 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_counte this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29687,12 +29700,12 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_fundin this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29749,11 +29762,11 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_new"))) TS funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv); LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_js(opt_anchors_arg); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29762,22 +29775,22 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_new"))) TS static inline uintptr_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) { LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone_ptr"))) TS_ChannelTransactionParameters_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelTransactionParameters_clone_ptr"))) TS_ChannelTransactionParameters_clone_ptr(uint32_t arg) { LDKChannelTransactionParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelTransactionParameters_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelTransactionParameters_clone_ptr(&arg_conv); return ret_val; } @@ -29787,11 +29800,11 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_clone"))) orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29812,11 +29825,11 @@ uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameter this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29860,11 +29873,11 @@ uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameter CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv); pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29873,22 +29886,22 @@ uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameter static inline uintptr_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) { LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone_ptr"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone_ptr"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint32_t arg) { LDKCounterpartyChannelTransactionParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); + intptr_t ret_val = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv); return ret_val; } @@ -29898,11 +29911,11 @@ uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameter orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29924,11 +29937,11 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_as_holder_ this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29941,11 +29954,11 @@ uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_as_counter this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -29958,7 +29971,7 @@ int8_tArray __attribute__((export_name("TS_CounterpartyChannelTransactionParame obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29967,10 +29980,10 @@ int8_tArray __attribute__((export_name("TS_CounterpartyChannelTransactionParame uint32_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_read"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write"))) TS_ChannelTransactionParameters_write(uint32_t obj) { @@ -29979,7 +29992,7 @@ int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write") obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -29988,10 +30001,10 @@ int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write") uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_read"))) TS_ChannelTransactionParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); *ret_conv = ChannelTransactionParameters_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_DirectedChannelTransactionParameters_free"))) TS_DirectedChannelTransactionParameters_free(uint32_t this_obj) { @@ -30008,11 +30021,11 @@ uint32_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_br this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30025,11 +30038,11 @@ uint32_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_co this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30060,11 +30073,11 @@ uint32_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_fu this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30093,7 +30106,7 @@ int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_coun this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(64); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64); return ret_arr; } @@ -30105,7 +30118,7 @@ void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterpart CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKSignature val_ref; CHECK(val->arr_len == 64); - memcpy(val_ref.compact_form, val->elems, 64); + memcpy(val_ref.compact_form, val->elems, 64); FREE(val); HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref); } @@ -30120,12 +30133,12 @@ void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterpart val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else val_constr.data = NULL; - int8_tArray* val_vals = (void*) val->elems; + int8_tArray* val_vals = (void*) val->elems /* XXX val leaks */; for (size_t m = 0; m < val_constr.datalen; m++) { int8_tArray val_conv_12 = val_vals[m]; LDKSignature val_conv_12_ref; CHECK(val_conv_12->arr_len == 64); - memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); + memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12); val_constr.data[m] = val_conv_12_ref; } HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); @@ -30133,22 +30146,22 @@ void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterpart static inline uintptr_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) { LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone_ptr"))) TS_HolderCommitmentTransaction_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone_ptr"))) TS_HolderCommitmentTransaction_clone_ptr(uint32_t arg) { LDKHolderCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = HolderCommitmentTransaction_clone_ptr(&arg_conv); + intptr_t ret_val = HolderCommitmentTransaction_clone_ptr(&arg_conv); return ret_val; } @@ -30158,11 +30171,11 @@ uint32_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone"))) T orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30175,7 +30188,7 @@ int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_write")) obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -30184,10 +30197,10 @@ int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_write")) uint32_t __attribute__((export_name("TS_HolderCommitmentTransaction_read"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); *ret_conv = HolderCommitmentTransaction_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_HolderCommitmentTransaction_new"))) TS_HolderCommitmentTransaction_new(uint32_t commitment_tx, int8_tArray counterparty_sig, ptrArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) { @@ -30198,33 +30211,33 @@ uint32_t __attribute__((export_name("TS_HolderCommitmentTransaction_new"))) TS_ commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv); LDKSignature counterparty_sig_ref; CHECK(counterparty_sig->arr_len == 64); - memcpy(counterparty_sig_ref.compact_form, counterparty_sig->elems, 64); + memcpy(counterparty_sig_ref.compact_form, counterparty_sig->elems, 64); FREE(counterparty_sig); LDKCVec_SignatureZ counterparty_htlc_sigs_constr; counterparty_htlc_sigs_constr.datalen = counterparty_htlc_sigs->arr_len; if (counterparty_htlc_sigs_constr.datalen > 0) counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements"); else counterparty_htlc_sigs_constr.data = NULL; - int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems; + int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems /* XXX counterparty_htlc_sigs leaks */; for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) { int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m]; LDKSignature counterparty_htlc_sigs_conv_12_ref; CHECK(counterparty_htlc_sigs_conv_12->arr_len == 64); - memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); + memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); FREE(counterparty_htlc_sigs_conv_12); counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref; } LDKPublicKey holder_funding_key_ref; CHECK(holder_funding_key->arr_len == 33); - memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); + memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); FREE(holder_funding_key); LDKPublicKey counterparty_funding_key_ref; CHECK(counterparty_funding_key->arr_len == 33); - memcpy(counterparty_funding_key_ref.compressed_form, counterparty_funding_key->elems, 33); + memcpy(counterparty_funding_key_ref.compressed_form, counterparty_funding_key->elems, 33); FREE(counterparty_funding_key); LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30245,7 +30258,7 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_trans this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); Transaction_free(ret_var); return ret_arr; @@ -30259,7 +30272,7 @@ void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_transaction" LDKTransaction val_ref; val_ref.datalen = val->arr_len; val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); val_ref.data_is_owned = true; BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref); } @@ -30269,7 +30282,7 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_txid" this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv), 32); return ret_arr; } @@ -30281,7 +30294,7 @@ void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_txid"))) TS_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref); } @@ -30289,17 +30302,17 @@ uint32_t __attribute__((export_name("TS_BuiltCommitmentTransaction_new"))) TS_B LDKTransaction transaction_arg_ref; transaction_arg_ref.datalen = transaction_arg->arr_len; transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes"); - memcpy(transaction_arg_ref.data, transaction_arg->elems, transaction_arg_ref.datalen); + memcpy(transaction_arg_ref.data, transaction_arg->elems, transaction_arg_ref.datalen); FREE(transaction_arg); transaction_arg_ref.data_is_owned = true; LDKThirtyTwoBytes txid_arg_ref; CHECK(txid_arg->arr_len == 32); - memcpy(txid_arg_ref.data, txid_arg->elems, 32); + memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30308,22 +30321,22 @@ uint32_t __attribute__((export_name("TS_BuiltCommitmentTransaction_new"))) TS_B static inline uintptr_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) { LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone_ptr"))) TS_BuiltCommitmentTransaction_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone_ptr"))) TS_BuiltCommitmentTransaction_clone_ptr(uint32_t arg) { LDKBuiltCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = BuiltCommitmentTransaction_clone_ptr(&arg_conv); + intptr_t ret_val = BuiltCommitmentTransaction_clone_ptr(&arg_conv); return ret_val; } @@ -30333,11 +30346,11 @@ uint32_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone"))) TS orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30350,7 +30363,7 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_write"))) obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -30359,10 +30372,10 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_write"))) uint32_t __attribute__((export_name("TS_BuiltCommitmentTransaction_read"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); *ret_conv = BuiltCommitmentTransaction_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_sighash_all"))) TS_BuiltCommitmentTransaction_get_sighash_all(uint32_t this_arg, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) { @@ -30372,8 +30385,8 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_sigha CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; - funding_redeemscript_ref.data = funding_redeemscript->elems; - int8_tArray ret_arr = init_int8_tArray(32); + funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32); return ret_arr; } @@ -30385,12 +30398,12 @@ int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_sign"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK(funding_key->arr_len == 32); - memcpy(funding_key_arr, funding_key->elems, 32); + memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key); unsigned char (*funding_key_ref)[32] = &funding_key_arr; LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; - funding_redeemscript_ref.data = funding_redeemscript->elems; - int8_tArray ret_arr = init_int8_tArray(64); + funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */; + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64); return ret_arr; } @@ -30405,22 +30418,22 @@ void __attribute__((export_name("TS_ClosingTransaction_free"))) TS_ClosingTrans static inline uintptr_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) { LDKClosingTransaction ret_var = ClosingTransaction_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ClosingTransaction_clone_ptr"))) TS_ClosingTransaction_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ClosingTransaction_clone_ptr"))) TS_ClosingTransaction_clone_ptr(uint32_t arg) { LDKClosingTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ClosingTransaction_clone_ptr(&arg_conv); + intptr_t ret_val = ClosingTransaction_clone_ptr(&arg_conv); return ret_val; } @@ -30430,11 +30443,11 @@ uint32_t __attribute__((export_name("TS_ClosingTransaction_clone"))) TS_Closing orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30454,22 +30467,22 @@ uint32_t __attribute__((export_name("TS_ClosingTransaction_new"))) TS_ClosingTr LDKCVec_u8Z to_holder_script_ref; to_holder_script_ref.datalen = to_holder_script->arr_len; to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); + memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script); LDKCVec_u8Z to_counterparty_script_ref; to_counterparty_script_ref.datalen = to_counterparty_script->arr_len; to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); + memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script); LDKOutPoint funding_outpoint_conv; funding_outpoint_conv.inner = (void*)(funding_outpoint & (~1)); funding_outpoint_conv.is_owned = (funding_outpoint & 1) || (funding_outpoint == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv); funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30482,11 +30495,11 @@ uint32_t __attribute__((export_name("TS_ClosingTransaction_trust"))) TS_Closing this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30505,7 +30518,7 @@ uint32_t __attribute__((export_name("TS_ClosingTransaction_verify"))) TS_Closin funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv); LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int64_t __attribute__((export_name("TS_ClosingTransaction_to_holder_value_sat"))) TS_ClosingTransaction_to_holder_value_sat(uint32_t this_arg) { @@ -30532,7 +30545,7 @@ int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_holder_script" this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -30543,7 +30556,7 @@ int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_counterparty_s this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -30562,7 +30575,7 @@ int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_built_tran this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); Transaction_free(ret_var); return ret_arr; @@ -30575,8 +30588,8 @@ int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_get_sighas CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; - funding_redeemscript_ref.data = funding_redeemscript->elems; - int8_tArray ret_arr = init_int8_tArray(32); + funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32); return ret_arr; } @@ -30588,12 +30601,12 @@ int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_sign"))) T CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char funding_key_arr[32]; CHECK(funding_key->arr_len == 32); - memcpy(funding_key_arr, funding_key->elems, 32); + memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key); unsigned char (*funding_key_ref)[32] = &funding_key_arr; LDKu8slice funding_redeemscript_ref; funding_redeemscript_ref.datalen = funding_redeemscript->arr_len; - funding_redeemscript_ref.data = funding_redeemscript->elems; - int8_tArray ret_arr = init_int8_tArray(64); + funding_redeemscript_ref.data = funding_redeemscript->elems /* XXX funding_redeemscript leaks */; + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); memcpy(ret_arr->elems, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64); return ret_arr; } @@ -30608,22 +30621,22 @@ void __attribute__((export_name("TS_CommitmentTransaction_free"))) TS_Commitmen static inline uintptr_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) { LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_CommitmentTransaction_clone_ptr"))) TS_CommitmentTransaction_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_CommitmentTransaction_clone_ptr"))) TS_CommitmentTransaction_clone_ptr(uint32_t arg) { LDKCommitmentTransaction arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = CommitmentTransaction_clone_ptr(&arg_conv); + intptr_t ret_val = CommitmentTransaction_clone_ptr(&arg_conv); return ret_val; } @@ -30633,11 +30646,11 @@ uint32_t __attribute__((export_name("TS_CommitmentTransaction_clone"))) TS_Comm orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30650,7 +30663,7 @@ int8_tArray __attribute__((export_name("TS_CommitmentTransaction_write"))) TS_C obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -30659,10 +30672,10 @@ int8_tArray __attribute__((export_name("TS_CommitmentTransaction_write"))) TS_C uint32_t __attribute__((export_name("TS_CommitmentTransaction_read"))) TS_CommitmentTransaction_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); *ret_conv = CommitmentTransaction_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int64_t __attribute__((export_name("TS_CommitmentTransaction_commitment_number"))) TS_CommitmentTransaction_commitment_number(uint32_t this_arg) { @@ -30707,11 +30720,11 @@ uint32_t __attribute__((export_name("TS_CommitmentTransaction_trust"))) TS_Comm this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30737,7 +30750,7 @@ uint32_t __attribute__((export_name("TS_CommitmentTransaction_verify"))) TS_Com CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_TrustedCommitmentTransaction_free"))) TS_TrustedCommitmentTransaction_free(uint32_t this_obj) { @@ -30753,7 +30766,7 @@ int8_tArray __attribute__((export_name("TS_TrustedCommitmentTransaction_txid")) this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32); return ret_arr; } @@ -30764,11 +30777,11 @@ uint32_t __attribute__((export_name("TS_TrustedCommitmentTransaction_built_tran this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30781,11 +30794,11 @@ uint32_t __attribute__((export_name("TS_TrustedCommitmentTransaction_keys"))) T this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30808,7 +30821,7 @@ uint32_t __attribute__((export_name("TS_TrustedCommitmentTransaction_get_htlc_s CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); unsigned char htlc_base_key_arr[32]; CHECK(htlc_base_key->arr_len == 32); - memcpy(htlc_base_key_arr, htlc_base_key->elems, 32); + memcpy(htlc_base_key_arr, htlc_base_key->elems, 32); FREE(htlc_base_key); unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr; LDKDirectedChannelTransactionParameters channel_parameters_conv; channel_parameters_conv.inner = (void*)(channel_parameters & (~1)); @@ -30816,16 +30829,16 @@ uint32_t __attribute__((export_name("TS_TrustedCommitmentTransaction_get_htlc_s CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } 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) { LDKPublicKey broadcaster_payment_basepoint_ref; CHECK(broadcaster_payment_basepoint->arr_len == 33); - memcpy(broadcaster_payment_basepoint_ref.compressed_form, broadcaster_payment_basepoint->elems, 33); + memcpy(broadcaster_payment_basepoint_ref.compressed_form, broadcaster_payment_basepoint->elems, 33); FREE(broadcaster_payment_basepoint); LDKPublicKey countersignatory_payment_basepoint_ref; CHECK(countersignatory_payment_basepoint->arr_len == 33); - memcpy(countersignatory_payment_basepoint_ref.compressed_form, countersignatory_payment_basepoint->elems, 33); + memcpy(countersignatory_payment_basepoint_ref.compressed_form, countersignatory_payment_basepoint->elems, 33); FREE(countersignatory_payment_basepoint); int64_t ret_val = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster); return ret_val; } @@ -30897,22 +30910,22 @@ jboolean __attribute__((export_name("TS_ChannelTypeFeatures_eq"))) TS_ChannelTy static inline uintptr_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) { LDKInitFeatures ret_var = InitFeatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_InitFeatures_clone_ptr"))) TS_InitFeatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_InitFeatures_clone_ptr"))) TS_InitFeatures_clone_ptr(uint32_t arg) { LDKInitFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = InitFeatures_clone_ptr(&arg_conv); + intptr_t ret_val = InitFeatures_clone_ptr(&arg_conv); return ret_val; } @@ -30922,11 +30935,11 @@ uint32_t __attribute__((export_name("TS_InitFeatures_clone"))) TS_InitFeatures_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30935,22 +30948,22 @@ uint32_t __attribute__((export_name("TS_InitFeatures_clone"))) TS_InitFeatures_ static inline uintptr_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) { LDKNodeFeatures ret_var = NodeFeatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NodeFeatures_clone_ptr"))) TS_NodeFeatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NodeFeatures_clone_ptr"))) TS_NodeFeatures_clone_ptr(uint32_t arg) { LDKNodeFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NodeFeatures_clone_ptr(&arg_conv); + intptr_t ret_val = NodeFeatures_clone_ptr(&arg_conv); return ret_val; } @@ -30960,11 +30973,11 @@ uint32_t __attribute__((export_name("TS_NodeFeatures_clone"))) TS_NodeFeatures_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -30973,22 +30986,22 @@ uint32_t __attribute__((export_name("TS_NodeFeatures_clone"))) TS_NodeFeatures_ static inline uintptr_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) { LDKChannelFeatures ret_var = ChannelFeatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelFeatures_clone_ptr"))) TS_ChannelFeatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelFeatures_clone_ptr"))) TS_ChannelFeatures_clone_ptr(uint32_t arg) { LDKChannelFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelFeatures_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelFeatures_clone_ptr(&arg_conv); return ret_val; } @@ -30998,11 +31011,11 @@ uint32_t __attribute__((export_name("TS_ChannelFeatures_clone"))) TS_ChannelFea orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31011,22 +31024,22 @@ uint32_t __attribute__((export_name("TS_ChannelFeatures_clone"))) TS_ChannelFea static inline uintptr_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) { LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_InvoiceFeatures_clone_ptr"))) TS_InvoiceFeatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_InvoiceFeatures_clone_ptr"))) TS_InvoiceFeatures_clone_ptr(uint32_t arg) { LDKInvoiceFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = InvoiceFeatures_clone_ptr(&arg_conv); + intptr_t ret_val = InvoiceFeatures_clone_ptr(&arg_conv); return ret_val; } @@ -31036,11 +31049,11 @@ uint32_t __attribute__((export_name("TS_InvoiceFeatures_clone"))) TS_InvoiceFea orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31049,22 +31062,22 @@ uint32_t __attribute__((export_name("TS_InvoiceFeatures_clone"))) TS_InvoiceFea static inline uintptr_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone_ptr"))) TS_ChannelTypeFeatures_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelTypeFeatures_clone_ptr"))) TS_ChannelTypeFeatures_clone_ptr(uint32_t arg) { LDKChannelTypeFeatures arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelTypeFeatures_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelTypeFeatures_clone_ptr(&arg_conv); return ret_val; } @@ -31074,11 +31087,11 @@ uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_clone"))) TS_Channe orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31127,11 +31140,11 @@ void __attribute__((export_name("TS_ChannelTypeFeatures_free"))) TS_ChannelType uint32_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_empty() { LDKInitFeatures ret_var = InitFeatures_empty(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31140,11 +31153,11 @@ uint32_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_ uint32_t __attribute__((export_name("TS_InitFeatures_known"))) TS_InitFeatures_known() { LDKInitFeatures ret_var = InitFeatures_known(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31162,11 +31175,11 @@ jboolean __attribute__((export_name("TS_InitFeatures_requires_unknown_bits"))) uint32_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_empty() { LDKNodeFeatures ret_var = NodeFeatures_empty(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31175,11 +31188,11 @@ uint32_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_ uint32_t __attribute__((export_name("TS_NodeFeatures_known"))) TS_NodeFeatures_known() { LDKNodeFeatures ret_var = NodeFeatures_known(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31197,11 +31210,11 @@ jboolean __attribute__((export_name("TS_NodeFeatures_requires_unknown_bits"))) uint32_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFeatures_empty() { LDKChannelFeatures ret_var = ChannelFeatures_empty(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31210,11 +31223,11 @@ uint32_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFea uint32_t __attribute__((export_name("TS_ChannelFeatures_known"))) TS_ChannelFeatures_known() { LDKChannelFeatures ret_var = ChannelFeatures_known(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31232,11 +31245,11 @@ jboolean __attribute__((export_name("TS_ChannelFeatures_requires_unknown_bits") uint32_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFeatures_empty() { LDKInvoiceFeatures ret_var = InvoiceFeatures_empty(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31245,11 +31258,11 @@ uint32_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFea uint32_t __attribute__((export_name("TS_InvoiceFeatures_known"))) TS_InvoiceFeatures_known() { LDKInvoiceFeatures ret_var = InvoiceFeatures_known(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31267,11 +31280,11 @@ jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_unknown_bits") uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_ChannelTypeFeatures_empty() { LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31280,11 +31293,11 @@ uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_Channe uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_known"))) TS_ChannelTypeFeatures_known() { LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31306,7 +31319,7 @@ int8_tArray __attribute__((export_name("TS_InitFeatures_write"))) TS_InitFeatur obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31315,10 +31328,10 @@ int8_tArray __attribute__((export_name("TS_InitFeatures_write"))) TS_InitFeatur uint32_t __attribute__((export_name("TS_InitFeatures_read"))) TS_InitFeatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ"); *ret_conv = InitFeatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_ChannelFeatures_write(uint32_t obj) { @@ -31327,7 +31340,7 @@ int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_Channel obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31336,10 +31349,10 @@ int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_Channel uint32_t __attribute__((export_name("TS_ChannelFeatures_read"))) TS_ChannelFeatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ"); *ret_conv = ChannelFeatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatures_write(uint32_t obj) { @@ -31348,7 +31361,7 @@ int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatur obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31357,10 +31370,10 @@ int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatur uint32_t __attribute__((export_name("TS_NodeFeatures_read"))) TS_NodeFeatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ"); *ret_conv = NodeFeatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_InvoiceFeatures_write(uint32_t obj) { @@ -31369,7 +31382,7 @@ int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_Invoice obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31378,10 +31391,10 @@ int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_Invoice uint32_t __attribute__((export_name("TS_InvoiceFeatures_read"))) TS_InvoiceFeatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ"); *ret_conv = InvoiceFeatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_ChannelTypeFeatures_write(uint32_t obj) { @@ -31390,7 +31403,7 @@ int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_Cha obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31399,10 +31412,10 @@ int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_Cha uint32_t __attribute__((export_name("TS_ChannelTypeFeatures_read"))) TS_ChannelTypeFeatures_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ"); *ret_conv = ChannelTypeFeatures_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ShutdownScript_free"))) TS_ShutdownScript_free(uint32_t this_obj) { @@ -31415,22 +31428,22 @@ void __attribute__((export_name("TS_ShutdownScript_free"))) TS_ShutdownScript_f static inline uintptr_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) { LDKShutdownScript ret_var = ShutdownScript_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ShutdownScript_clone_ptr"))) TS_ShutdownScript_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ShutdownScript_clone_ptr"))) TS_ShutdownScript_clone_ptr(uint32_t arg) { LDKShutdownScript arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ShutdownScript_clone_ptr(&arg_conv); + intptr_t ret_val = ShutdownScript_clone_ptr(&arg_conv); return ret_val; } @@ -31440,11 +31453,11 @@ uint32_t __attribute__((export_name("TS_ShutdownScript_clone"))) TS_ShutdownScr orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31465,7 +31478,7 @@ int8_tArray __attribute__((export_name("TS_InvalidShutdownScript_get_script"))) this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -31478,7 +31491,7 @@ void __attribute__((export_name("TS_InvalidShutdownScript_set_script"))) TS_Inv LDKCVec_u8Z val_ref; val_ref.datalen = val->arr_len; val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(val_ref.data, val->elems, val_ref.datalen); + memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val); InvalidShutdownScript_set_script(&this_ptr_conv, val_ref); } @@ -31486,13 +31499,13 @@ uint32_t __attribute__((export_name("TS_InvalidShutdownScript_new"))) TS_Invali LDKCVec_u8Z script_arg_ref; script_arg_ref.datalen = script_arg->arr_len; script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); + memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg); LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31501,22 +31514,22 @@ uint32_t __attribute__((export_name("TS_InvalidShutdownScript_new"))) TS_Invali static inline uintptr_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) { LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_InvalidShutdownScript_clone_ptr"))) TS_InvalidShutdownScript_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_InvalidShutdownScript_clone_ptr"))) TS_InvalidShutdownScript_clone_ptr(uint32_t arg) { LDKInvalidShutdownScript arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = InvalidShutdownScript_clone_ptr(&arg_conv); + intptr_t ret_val = InvalidShutdownScript_clone_ptr(&arg_conv); return ret_val; } @@ -31526,11 +31539,11 @@ uint32_t __attribute__((export_name("TS_InvalidShutdownScript_clone"))) TS_Inva orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31543,7 +31556,7 @@ int8_tArray __attribute__((export_name("TS_ShutdownScript_write"))) TS_Shutdown obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31552,23 +31565,23 @@ int8_tArray __attribute__((export_name("TS_ShutdownScript_write"))) TS_Shutdown uint32_t __attribute__((export_name("TS_ShutdownScript_read"))) TS_ShutdownScript_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); *ret_conv = ShutdownScript_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) { unsigned char pubkey_hash_arr[20]; CHECK(pubkey_hash->arr_len == 20); - memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); + memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash); unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr; LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31578,14 +31591,14 @@ uint32_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_Shutdo uint32_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_ShutdownScript_new_p2wsh(int8_tArray script_hash) { unsigned char script_hash_arr[32]; CHECK(script_hash->arr_len == 32); - memcpy(script_hash_arr, script_hash->elems, 32); + memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash); unsigned char (*script_hash_ref)[32] = &script_hash_arr; LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31595,10 +31608,10 @@ uint32_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_Shutdow uint32_t __attribute__((export_name("TS_ShutdownScript_new_witness_program"))) TS_ShutdownScript_new_witness_program(int8_t version, int8_tArray program) { LDKu8slice program_ref; program_ref.datalen = program->arr_len; - program_ref.data = program->elems; + program_ref.data = program->elems /* XXX program leaks */; LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); *ret_conv = ShutdownScript_new_witness_program(version, program_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_ShutdownScript_into_inner"))) TS_ShutdownScript_into_inner(uint32_t this_arg) { @@ -31608,7 +31621,7 @@ int8_tArray __attribute__((export_name("TS_ShutdownScript_into_inner"))) TS_Shu CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv = ShutdownScript_clone(&this_arg_conv); LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31619,7 +31632,7 @@ int8_tArray __attribute__((export_name("TS_ShutdownScript_as_legacy_pubkey"))) this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33); return ret_arr; } @@ -31639,7 +31652,7 @@ jboolean __attribute__((export_name("TS_ShutdownScript_is_compatible"))) TS_Shu void __attribute__((export_name("TS_CustomMessageReader_free"))) TS_CustomMessageReader_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -31649,28 +31662,28 @@ void __attribute__((export_name("TS_CustomMessageReader_free"))) TS_CustomMessa static inline uintptr_t Type_clone_ptr(LDKType *NONNULL_PTR arg) { LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); *ret_ret = Type_clone(arg); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } -int64_t __attribute__((export_name("TS_Type_clone_ptr"))) TS_Type_clone_ptr(uint32_t arg) { - void* arg_ptr = (void*)(((uint64_t)arg) & ~1); +intptr_t __attribute__((export_name("TS_Type_clone_ptr"))) TS_Type_clone_ptr(uint32_t arg) { + void* arg_ptr = (void*)(((uintptr_t)arg) & ~1); if (!(arg & 1)) { CHECK_ACCESS(arg_ptr); } LDKType* arg_conv = (LDKType*)arg_ptr; - int64_t ret_val = Type_clone_ptr(arg_conv); + intptr_t ret_val = Type_clone_ptr(arg_conv); return ret_val; } uint32_t __attribute__((export_name("TS_Type_clone"))) TS_Type_clone(uint32_t orig) { - void* orig_ptr = (void*)(((uint64_t)orig) & ~1); + void* orig_ptr = (void*)(((uintptr_t)orig) & ~1); if (!(orig & 1)) { CHECK_ACCESS(orig_ptr); } LDKType* orig_conv = (LDKType*)orig_ptr; LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType"); *ret_ret = Type_clone(orig_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_Type_free"))) TS_Type_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -31687,22 +31700,22 @@ void __attribute__((export_name("TS_NodeId_free"))) TS_NodeId_free(uint32_t thi static inline uintptr_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) { LDKNodeId ret_var = NodeId_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NodeId_clone_ptr"))) TS_NodeId_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NodeId_clone_ptr"))) TS_NodeId_clone_ptr(uint32_t arg) { LDKNodeId arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NodeId_clone_ptr(&arg_conv); + intptr_t ret_val = NodeId_clone_ptr(&arg_conv); return ret_val; } @@ -31712,11 +31725,11 @@ uint32_t __attribute__((export_name("TS_NodeId_clone"))) TS_NodeId_clone(uint32 orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeId ret_var = NodeId_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31726,13 +31739,13 @@ uint32_t __attribute__((export_name("TS_NodeId_clone"))) TS_NodeId_clone(uint32 uint32_t __attribute__((export_name("TS_NodeId_from_pubkey"))) TS_NodeId_from_pubkey(int8_tArray pubkey) { LDKPublicKey pubkey_ref; CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31745,7 +31758,7 @@ int8_tArray __attribute__((export_name("TS_NodeId_as_slice"))) TS_NodeId_as_sli this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); return ret_arr; } @@ -31765,7 +31778,7 @@ int8_tArray __attribute__((export_name("TS_NodeId_write"))) TS_NodeId_write(uin obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeId_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31774,10 +31787,10 @@ int8_tArray __attribute__((export_name("TS_NodeId_write"))) TS_NodeId_write(uin uint32_t __attribute__((export_name("TS_NodeId_read"))) TS_NodeId_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); *ret_conv = NodeId_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_NetworkGraph_free"))) TS_NetworkGraph_free(uint32_t this_obj) { @@ -31790,22 +31803,22 @@ void __attribute__((export_name("TS_NetworkGraph_free"))) TS_NetworkGraph_free( static inline uintptr_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg) { LDKNetworkGraph ret_var = NetworkGraph_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NetworkGraph_clone_ptr"))) TS_NetworkGraph_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NetworkGraph_clone_ptr"))) TS_NetworkGraph_clone_ptr(uint32_t arg) { LDKNetworkGraph arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NetworkGraph_clone_ptr(&arg_conv); + intptr_t ret_val = NetworkGraph_clone_ptr(&arg_conv); return ret_val; } @@ -31815,11 +31828,11 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_clone"))) TS_NetworkGraph_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNetworkGraph ret_var = NetworkGraph_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31836,7 +31849,7 @@ void __attribute__((export_name("TS_ReadOnlyNetworkGraph_free"))) TS_ReadOnlyNe void __attribute__((export_name("TS_NetworkUpdate_free"))) TS_NetworkUpdate_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -31846,12 +31859,12 @@ void __attribute__((export_name("TS_NetworkUpdate_free"))) TS_NetworkUpdate_fre static inline uintptr_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) { LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_clone(arg); -uint64_t ret_ref = (uint64_t)ret_copy; +uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } -int64_t __attribute__((export_name("TS_NetworkUpdate_clone_ptr"))) TS_NetworkUpdate_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NetworkUpdate_clone_ptr"))) TS_NetworkUpdate_clone_ptr(uint32_t arg) { LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)arg; - int64_t ret_val = NetworkUpdate_clone_ptr(arg_conv); + intptr_t ret_val = NetworkUpdate_clone_ptr(arg_conv); return ret_val; } @@ -31859,7 +31872,7 @@ uint32_t __attribute__((export_name("TS_NetworkUpdate_clone"))) TS_NetworkUpdat LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)orig; LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_clone(orig_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -31871,31 +31884,31 @@ uint32_t __attribute__((export_name("TS_NetworkUpdate_channel_update_message")) msg_conv = ChannelUpdate_clone(&msg_conv); LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_channel_update_message(msg_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_NetworkUpdate_channel_closed"))) TS_NetworkUpdate_channel_closed(int64_t short_channel_id, jboolean is_permanent) { LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_channel_closed(short_channel_id, is_permanent); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } uint32_t __attribute__((export_name("TS_NetworkUpdate_node_failure"))) TS_NetworkUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) { LDKPublicKey node_id_ref; CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate"); *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } int8_tArray __attribute__((export_name("TS_NetworkUpdate_write"))) TS_NetworkUpdate_write(uint32_t obj) { LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)obj; LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -31904,10 +31917,10 @@ int8_tArray __attribute__((export_name("TS_NetworkUpdate_write"))) TS_NetworkUp uint32_t __attribute__((export_name("TS_NetworkUpdate_read"))) TS_NetworkUpdate_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ"); *ret_conv = NetworkUpdate_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_as_EventHandler"))) TS_NetGraphMsgHandler_as_EventHandler(uint32_t this_arg) { @@ -31917,7 +31930,7 @@ uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_as_EventHandler"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); *ret_ret = NetGraphMsgHandler_as_EventHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_NetGraphMsgHandler_free"))) TS_NetGraphMsgHandler_free(uint32_t this_obj) { @@ -31933,22 +31946,22 @@ uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_new"))) TS_NetGraphM network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); + void* chain_access_ptr = (void*)(((uintptr_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); // Warning: we may need a move here but no clone is available for LDKCOption_AccessZ if (chain_access_conv.tag == LDKCOption_AccessZ_Some) { // Manually implement clone for Java trait instances } - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(&network_graph_conv, chain_access_conv, logger_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -31960,7 +31973,7 @@ void __attribute__((export_name("TS_NetGraphMsgHandler_add_chain_access"))) TS_ this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); + void* chain_access_ptr = (void*)(((uintptr_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); // Warning: we may need a move here but no clone is available for LDKCOption_AccessZ @@ -31977,7 +31990,7 @@ uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_as_RoutingMessageHan CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); *ret_ret = NetGraphMsgHandler_as_RoutingMessageHandler(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_as_MessageSendEventsProvider"))) TS_NetGraphMsgHandler_as_MessageSendEventsProvider(uint32_t this_arg) { @@ -31987,7 +32000,7 @@ uint32_t __attribute__((export_name("TS_NetGraphMsgHandler_as_MessageSendEvents CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); *ret_ret = NetGraphMsgHandler_as_MessageSendEventsProvider(&this_arg_conv); - return (uint64_t)ret_ret; + return (uintptr_t)ret_ret; } void __attribute__((export_name("TS_DirectionalChannelInfo_free"))) TS_DirectionalChannelInfo_free(uint32_t this_obj) { @@ -32073,7 +32086,7 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_get_htlc_maximum CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = DirectionalChannelInfo_get_htlc_maximum_msat(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -32082,10 +32095,10 @@ void __attribute__((export_name("TS_DirectionalChannelInfo_set_htlc_maximum_msa this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); DirectionalChannelInfo_set_htlc_maximum_msat(&this_ptr_conv, val_conv); } @@ -32095,11 +32108,11 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_get_fees"))) TS_ this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = DirectionalChannelInfo_get_fees(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32125,12 +32138,12 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_get_last_update_ this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelUpdate ret_var = DirectionalChannelInfo_get_last_update_message(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32152,10 +32165,10 @@ void __attribute__((export_name("TS_DirectionalChannelInfo_set_last_update_mess } uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_new"))) TS_DirectionalChannelInfo_new(int32_t last_update_arg, jboolean enabled_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, uint32_t htlc_maximum_msat_arg, uint32_t fees_arg, uint32_t last_update_message_arg) { - void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1); + void* htlc_maximum_msat_arg_ptr = (void*)(((uintptr_t)htlc_maximum_msat_arg) & ~1); CHECK_ACCESS(htlc_maximum_msat_arg_ptr); LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); - htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1)); + htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)htlc_maximum_msat_arg) & ~1)); LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); @@ -32167,11 +32180,11 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_new"))) TS_Direc CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv); last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg_conv, fees_arg_conv, last_update_message_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32180,22 +32193,22 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_new"))) TS_Direc static inline uintptr_t DirectionalChannelInfo_clone_ptr(LDKDirectionalChannelInfo *NONNULL_PTR arg) { LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_DirectionalChannelInfo_clone_ptr"))) TS_DirectionalChannelInfo_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_DirectionalChannelInfo_clone_ptr"))) TS_DirectionalChannelInfo_clone_ptr(uint32_t arg) { LDKDirectionalChannelInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = DirectionalChannelInfo_clone_ptr(&arg_conv); + intptr_t ret_val = DirectionalChannelInfo_clone_ptr(&arg_conv); return ret_val; } @@ -32205,11 +32218,11 @@ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_clone"))) TS_Dir orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKDirectionalChannelInfo ret_var = DirectionalChannelInfo_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32222,7 +32235,7 @@ int8_tArray __attribute__((export_name("TS_DirectionalChannelInfo_write"))) TS_ obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = DirectionalChannelInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -32231,10 +32244,10 @@ int8_tArray __attribute__((export_name("TS_DirectionalChannelInfo_write"))) TS_ uint32_t __attribute__((export_name("TS_DirectionalChannelInfo_read"))) TS_DirectionalChannelInfo_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_DirectionalChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DirectionalChannelInfoDecodeErrorZ), "LDKCResult_DirectionalChannelInfoDecodeErrorZ"); *ret_conv = DirectionalChannelInfo_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_ChannelInfo_free"))) TS_ChannelInfo_free(uint32_t this_obj) { @@ -32251,11 +32264,11 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_features"))) TS_Channel this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32281,11 +32294,11 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_node_one"))) TS_Channel this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32311,12 +32324,12 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_one_to_two"))) TS_Chann this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32343,11 +32356,11 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_node_two"))) TS_Channel this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32373,12 +32386,12 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_two_to_one"))) TS_Chann this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKDirectionalChannelInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32406,7 +32419,7 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_capacity_sats"))) TS_Ch CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -32415,10 +32428,10 @@ void __attribute__((export_name("TS_ChannelInfo_set_capacity_sats"))) TS_Channe this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv); } @@ -32428,12 +32441,12 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_get_announcement_message")) this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32456,22 +32469,22 @@ void __attribute__((export_name("TS_ChannelInfo_set_announcement_message"))) TS static inline uintptr_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) { LDKChannelInfo ret_var = ChannelInfo_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelInfo_clone_ptr"))) TS_ChannelInfo_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_ChannelInfo_clone_ptr"))) TS_ChannelInfo_clone_ptr(uint32_t arg) { LDKChannelInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = ChannelInfo_clone_ptr(&arg_conv); + intptr_t ret_val = ChannelInfo_clone_ptr(&arg_conv); return ret_val; } @@ -32481,11 +32494,11 @@ uint32_t __attribute__((export_name("TS_ChannelInfo_clone"))) TS_ChannelInfo_cl orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32498,7 +32511,7 @@ int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -32507,10 +32520,10 @@ int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo uint32_t __attribute__((export_name("TS_ChannelInfo_read"))) TS_ChannelInfo_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ"); *ret_conv = ChannelInfo_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_RoutingFees_free"))) TS_RoutingFees_free(uint32_t this_obj) { @@ -32557,11 +32570,11 @@ void __attribute__((export_name("TS_RoutingFees_set_proportional_millionths"))) uint32_t __attribute__((export_name("TS_RoutingFees_new"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) { LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32583,22 +32596,22 @@ jboolean __attribute__((export_name("TS_RoutingFees_eq"))) TS_RoutingFees_eq(ui static inline uintptr_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) { LDKRoutingFees ret_var = RoutingFees_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RoutingFees_clone_ptr"))) TS_RoutingFees_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RoutingFees_clone_ptr"))) TS_RoutingFees_clone_ptr(uint32_t arg) { LDKRoutingFees arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RoutingFees_clone_ptr(&arg_conv); + intptr_t ret_val = RoutingFees_clone_ptr(&arg_conv); return ret_val; } @@ -32608,11 +32621,11 @@ uint32_t __attribute__((export_name("TS_RoutingFees_clone"))) TS_RoutingFees_cl orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32634,7 +32647,7 @@ int8_tArray __attribute__((export_name("TS_RoutingFees_write"))) TS_RoutingFees obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -32643,10 +32656,10 @@ int8_tArray __attribute__((export_name("TS_RoutingFees_write"))) TS_RoutingFees uint32_t __attribute__((export_name("TS_RoutingFees_read"))) TS_RoutingFees_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ"); *ret_conv = RoutingFees_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_NodeAnnouncementInfo_free"))) TS_NodeAnnouncementInfo_free(uint32_t this_obj) { @@ -32663,11 +32676,11 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_features"))) T this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32709,7 +32722,7 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_rgb"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(3); + int8_tArray ret_arr = init_int8_tArray(3, __LINE__); memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3); return ret_arr; } @@ -32721,7 +32734,7 @@ void __attribute__((export_name("TS_NodeAnnouncementInfo_set_rgb"))) TS_NodeAnn CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThreeBytes val_ref; CHECK(val->arr_len == 3); - memcpy(val_ref.data, val->elems, 3); + memcpy(val_ref.data, val->elems, 3); FREE(val); NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref); } @@ -32730,7 +32743,7 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_alias"))) T this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(32); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_alias(&this_ptr_conv), 32); return ret_arr; } @@ -32742,7 +32755,7 @@ void __attribute__((export_name("TS_NodeAnnouncementInfo_set_alias"))) TS_NodeA CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKThirtyTwoBytes val_ref; CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_ref); } @@ -32757,13 +32770,13 @@ void __attribute__((export_name("TS_NodeAnnouncementInfo_set_addresses"))) TS_N val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t m = 0; m < val_constr.datalen; m++) { uint32_t val_conv_12 = val_vals[m]; - void* val_conv_12_ptr = (void*)(((uint64_t)val_conv_12) & ~1); + void* val_conv_12_ptr = (void*)(((uintptr_t)val_conv_12) & ~1); CHECK_ACCESS(val_conv_12_ptr); LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr); - val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uint64_t)val_conv_12) & ~1)); + val_conv_12_conv = NetAddress_clone((LDKNetAddress*)(((uintptr_t)val_conv_12) & ~1)); val_constr.data[m] = val_conv_12_conv; } NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr); @@ -32775,12 +32788,12 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_announcement_m this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32809,20 +32822,20 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_new"))) TS_NodeAnn features_arg_conv = NodeFeatures_clone(&features_arg_conv); LDKThreeBytes rgb_arg_ref; CHECK(rgb_arg->arr_len == 3); - memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); + memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg); LDKThirtyTwoBytes alias_arg_ref; CHECK(alias_arg->arr_len == 32); - memcpy(alias_arg_ref.data, alias_arg->elems, 32); + memcpy(alias_arg_ref.data, alias_arg->elems, 32); FREE(alias_arg); LDKCVec_NetAddressZ addresses_arg_constr; addresses_arg_constr.datalen = addresses_arg->arr_len; if (addresses_arg_constr.datalen > 0) addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements"); else addresses_arg_constr.data = NULL; - uint32_t* addresses_arg_vals = addresses_arg->elems; + uint32_t* addresses_arg_vals = addresses_arg->elems /* XXX addresses_arg leaks */; for (size_t m = 0; m < addresses_arg_constr.datalen; m++) { uint32_t addresses_arg_conv_12 = addresses_arg_vals[m]; - void* addresses_arg_conv_12_ptr = (void*)(((uint64_t)addresses_arg_conv_12) & ~1); + void* addresses_arg_conv_12_ptr = (void*)(((uintptr_t)addresses_arg_conv_12) & ~1); CHECK_ACCESS(addresses_arg_conv_12_ptr); LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr); addresses_arg_constr.data[m] = addresses_arg_conv_12_conv; @@ -32833,11 +32846,11 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_new"))) TS_NodeAnn CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv); announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_ref, addresses_arg_constr, announcement_message_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32846,22 +32859,22 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_new"))) TS_NodeAnn static inline uintptr_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) { LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone_ptr"))) TS_NodeAnnouncementInfo_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone_ptr"))) TS_NodeAnnouncementInfo_clone_ptr(uint32_t arg) { LDKNodeAnnouncementInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NodeAnnouncementInfo_clone_ptr(&arg_conv); + intptr_t ret_val = NodeAnnouncementInfo_clone_ptr(&arg_conv); return ret_val; } @@ -32871,11 +32884,11 @@ uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone"))) TS_NodeA orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32888,7 +32901,7 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_No obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -32897,10 +32910,10 @@ int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_No uint32_t __attribute__((export_name("TS_NodeAnnouncementInfo_read"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ"); *ret_conv = NodeAnnouncementInfo_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_NodeInfo_free"))) TS_NodeInfo_free(uint32_t this_obj) { @@ -32922,7 +32935,7 @@ void __attribute__((export_name("TS_NodeInfo_set_channels"))) TS_NodeInfo_set_c val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else val_constr.data = NULL; - int64_t* val_vals = val->elems; + int64_t* val_vals = val->elems /* XXX val leaks */; for (size_t i = 0; i < val_constr.datalen; i++) { int64_t val_conv_8 = val_vals[i]; val_constr.data[i] = val_conv_8; @@ -32936,12 +32949,12 @@ uint32_t __attribute__((export_name("TS_NodeInfo_get_lowest_inbound_channel_fee this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -32968,12 +32981,12 @@ uint32_t __attribute__((export_name("TS_NodeInfo_get_announcement_info"))) TS_N this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33001,7 +33014,7 @@ uint32_t __attribute__((export_name("TS_NodeInfo_new"))) TS_NodeInfo_new(int64_ channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements"); else channels_arg_constr.data = NULL; - int64_t* channels_arg_vals = channels_arg->elems; + int64_t* channels_arg_vals = channels_arg->elems /* XXX channels_arg leaks */; for (size_t i = 0; i < channels_arg_constr.datalen; i++) { int64_t channels_arg_conv_8 = channels_arg_vals[i]; channels_arg_constr.data[i] = channels_arg_conv_8; @@ -33017,11 +33030,11 @@ uint32_t __attribute__((export_name("TS_NodeInfo_new"))) TS_NodeInfo_new(int64_ CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv); announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv); LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33030,22 +33043,22 @@ uint32_t __attribute__((export_name("TS_NodeInfo_new"))) TS_NodeInfo_new(int64_ static inline uintptr_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) { LDKNodeInfo ret_var = NodeInfo_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_NodeInfo_clone_ptr"))) TS_NodeInfo_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_NodeInfo_clone_ptr"))) TS_NodeInfo_clone_ptr(uint32_t arg) { LDKNodeInfo arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = NodeInfo_clone_ptr(&arg_conv); + intptr_t ret_val = NodeInfo_clone_ptr(&arg_conv); return ret_val; } @@ -33055,11 +33068,11 @@ uint32_t __attribute__((export_name("TS_NodeInfo_clone"))) TS_NodeInfo_clone(ui orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33072,7 +33085,7 @@ int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -33081,10 +33094,10 @@ int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write uint32_t __attribute__((export_name("TS_NodeInfo_read"))) TS_NodeInfo_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ"); *ret_conv = NodeInfo_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGraph_write(uint32_t obj) { @@ -33093,7 +33106,7 @@ int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGra obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -33102,22 +33115,22 @@ int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGra uint32_t __attribute__((export_name("TS_NetworkGraph_read"))) TS_NetworkGraph_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ"); *ret_conv = NetworkGraph_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetworkGraph_new"))) TS_NetworkGraph_new(int8_tArray genesis_hash) { LDKThirtyTwoBytes genesis_hash_ref; CHECK(genesis_hash->arr_len == 32); - memcpy(genesis_hash_ref.data, genesis_hash->elems, 32); + memcpy(genesis_hash_ref.data, genesis_hash->elems, 32); FREE(genesis_hash); LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33130,11 +33143,11 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_read_only"))) TS_NetworkGr this_arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33152,7 +33165,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_node_from_announcem CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetworkGraph_update_node_from_unsigned_announcement"))) TS_NetworkGraph_update_node_from_unsigned_announcement(uint32_t this_arg, uint32_t msg) { @@ -33166,7 +33179,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_node_from_unsigned_ CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_announcement"))) TS_NetworkGraph_update_channel_from_announcement(uint32_t this_arg, uint32_t msg, uint32_t chain_access) { @@ -33178,7 +33191,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_announ msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); + void* chain_access_ptr = (void*)(((uintptr_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); // Warning: we may need a move here but no clone is available for LDKCOption_AccessZ @@ -33187,7 +33200,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_announ } LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_unsigned_announcement"))) TS_NetworkGraph_update_channel_from_unsigned_announcement(uint32_t this_arg, uint32_t msg, uint32_t chain_access) { @@ -33199,7 +33212,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_unsign msg_conv.inner = (void*)(msg & (~1)); msg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - void* chain_access_ptr = (void*)(((uint64_t)chain_access) & ~1); + void* chain_access_ptr = (void*)(((uintptr_t)chain_access) & ~1); CHECK_ACCESS(chain_access_ptr); LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr); // Warning: we may need a move here but no clone is available for LDKCOption_AccessZ @@ -33208,7 +33221,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_from_unsign } LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_NetworkGraph_close_channel_from_update"))) TS_NetworkGraph_close_channel_from_update(uint32_t this_arg, int64_t short_channel_id, jboolean is_permanent) { @@ -33226,7 +33239,7 @@ void __attribute__((export_name("TS_NetworkGraph_fail_node"))) TS_NetworkGraph_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey _node_id_ref; CHECK(_node_id->arr_len == 33); - memcpy(_node_id_ref.compressed_form, _node_id->elems, 33); + memcpy(_node_id_ref.compressed_form, _node_id->elems, 33); FREE(_node_id); NetworkGraph_fail_node(&this_arg_conv, _node_id_ref, is_permanent); } @@ -33249,7 +33262,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel"))) TS_Netw CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_unsigned"))) TS_NetworkGraph_update_channel_unsigned(uint32_t this_arg, uint32_t msg) { @@ -33263,7 +33276,7 @@ uint32_t __attribute__((export_name("TS_NetworkGraph_update_channel_unsigned")) CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ"); *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_get_addresses"))) TS_ReadOnlyNetworkGraph_get_addresses(uint32_t this_arg, int8_tArray pubkey) { @@ -33273,10 +33286,10 @@ uint32_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_get_addresses"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); LDKPublicKey pubkey_ref; CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ"); *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -33293,7 +33306,7 @@ int8_tArray __attribute__((export_name("TS_RouteHop_get_pubkey"))) TS_RouteHop_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -33305,7 +33318,7 @@ void __attribute__((export_name("TS_RouteHop_set_pubkey"))) TS_RouteHop_set_pub CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); RouteHop_set_pubkey(&this_ptr_conv, val_ref); } @@ -33315,11 +33328,11 @@ uint32_t __attribute__((export_name("TS_RouteHop_get_node_features"))) TS_Route this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33362,11 +33375,11 @@ uint32_t __attribute__((export_name("TS_RouteHop_get_channel_features"))) TS_Ro this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33423,7 +33436,7 @@ void __attribute__((export_name("TS_RouteHop_set_cltv_expiry_delta"))) TS_Route uint32_t __attribute__((export_name("TS_RouteHop_new"))) TS_RouteHop_new(int8_tArray pubkey_arg, uint32_t node_features_arg, int64_t short_channel_id_arg, uint32_t channel_features_arg, int64_t fee_msat_arg, int32_t cltv_expiry_delta_arg) { LDKPublicKey pubkey_arg_ref; CHECK(pubkey_arg->arr_len == 33); - memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); + memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg); LDKNodeFeatures node_features_arg_conv; node_features_arg_conv.inner = (void*)(node_features_arg & (~1)); node_features_arg_conv.is_owned = (node_features_arg & 1) || (node_features_arg == 0); @@ -33435,11 +33448,11 @@ uint32_t __attribute__((export_name("TS_RouteHop_new"))) TS_RouteHop_new(int8_t CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv); channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33448,22 +33461,22 @@ uint32_t __attribute__((export_name("TS_RouteHop_new"))) TS_RouteHop_new(int8_t static inline uintptr_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) { LDKRouteHop ret_var = RouteHop_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RouteHop_clone_ptr"))) TS_RouteHop_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RouteHop_clone_ptr"))) TS_RouteHop_clone_ptr(uint32_t arg) { LDKRouteHop arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RouteHop_clone_ptr(&arg_conv); + intptr_t ret_val = RouteHop_clone_ptr(&arg_conv); return ret_val; } @@ -33473,11 +33486,11 @@ uint32_t __attribute__((export_name("TS_RouteHop_clone"))) TS_RouteHop_clone(ui orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHop ret_var = RouteHop_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33512,7 +33525,7 @@ int8_tArray __attribute__((export_name("TS_RouteHop_write"))) TS_RouteHop_write obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -33521,10 +33534,10 @@ int8_tArray __attribute__((export_name("TS_RouteHop_write"))) TS_RouteHop_write uint32_t __attribute__((export_name("TS_RouteHop_read"))) TS_RouteHop_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ"); *ret_conv = RouteHop_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_Route_free"))) TS_Route_free(uint32_t this_obj) { @@ -33542,20 +33555,20 @@ ptrArray __attribute__((export_name("TS_Route_get_paths"))) TS_Route_get_paths( CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv); ptrArray ret_arr = NULL; - ret_arr = init_ptrArray(ret_var.datalen); + ret_arr = init_ptrArray(ret_var.datalen, __LINE__); uint32_tArray *ret_arr_ptr = (uint32_tArray*)(((uint8_t*)ret_arr) + 4); for (size_t m = 0; m < ret_var.datalen; m++) { LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m]; uint32_tArray ret_conv_12_arr = NULL; - ret_conv_12_arr = init_uint32_tArray(ret_conv_12_var.datalen); + ret_conv_12_arr = init_uint32_tArray(ret_conv_12_var.datalen, __LINE__); uint32_t *ret_conv_12_arr_ptr = (uint32_t*)(((uint8_t*)ret_conv_12_arr) + 4); for (size_t k = 0; k < ret_conv_12_var.datalen; k++) { LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k]; - uint64_t ret_conv_12_conv_10_ref = 0; - CHECK((((uint64_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_12_conv_10_ref = 0; + CHECK((((uintptr_t)ret_conv_12_conv_10_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_12_conv_10_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var); - ret_conv_12_conv_10_ref = (uint64_t)ret_conv_12_conv_10_var.inner; + ret_conv_12_conv_10_ref = (uintptr_t)ret_conv_12_conv_10_var.inner; if (ret_conv_12_conv_10_var.is_owned) { ret_conv_12_conv_10_ref |= 1; } @@ -33581,7 +33594,7 @@ void __attribute__((export_name("TS_Route_set_paths"))) TS_Route_set_paths(uint val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements"); else val_constr.data = NULL; - uint32_tArray* val_vals = (void*) val->elems; + uint32_tArray* val_vals = (void*) val->elems /* XXX val leaks */; for (size_t m = 0; m < val_constr.datalen; m++) { uint32_tArray val_conv_12 = val_vals[m]; LDKCVec_RouteHopZ val_conv_12_constr; @@ -33590,7 +33603,7 @@ void __attribute__((export_name("TS_Route_set_paths"))) TS_Route_set_paths(uint val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else val_conv_12_constr.data = NULL; - uint32_t* val_conv_12_vals = val_conv_12->elems; + uint32_t* val_conv_12_vals = val_conv_12->elems /* XXX val_conv_12 leaks */; for (size_t k = 0; k < val_conv_12_constr.datalen; k++) { uint32_t val_conv_12_conv_10 = val_conv_12_vals[k]; LDKRouteHop val_conv_12_conv_10_conv; @@ -33611,12 +33624,12 @@ uint32_t __attribute__((export_name("TS_Route_get_payee"))) TS_Route_get_payee( this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = Route_get_payee(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33644,7 +33657,7 @@ uint32_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray pat paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements"); else paths_arg_constr.data = NULL; - uint32_tArray* paths_arg_vals = (void*) paths_arg->elems; + uint32_tArray* paths_arg_vals = (void*) paths_arg->elems /* XXX paths_arg leaks */; for (size_t m = 0; m < paths_arg_constr.datalen; m++) { uint32_tArray paths_arg_conv_12 = paths_arg_vals[m]; LDKCVec_RouteHopZ paths_arg_conv_12_constr; @@ -33653,7 +33666,7 @@ uint32_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray pat paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements"); else paths_arg_conv_12_constr.data = NULL; - uint32_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems; + uint32_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems /* XXX paths_arg_conv_12 leaks */; for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) { uint32_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k]; LDKRouteHop paths_arg_conv_12_conv_10_conv; @@ -33671,11 +33684,11 @@ uint32_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray pat CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRoute ret_var = Route_new(paths_arg_constr, payee_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33684,22 +33697,22 @@ uint32_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray pat static inline uintptr_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) { LDKRoute ret_var = Route_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Route_clone_ptr"))) TS_Route_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Route_clone_ptr"))) TS_Route_clone_ptr(uint32_t arg) { LDKRoute arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Route_clone_ptr(&arg_conv); + intptr_t ret_val = Route_clone_ptr(&arg_conv); return ret_val; } @@ -33709,11 +33722,11 @@ uint32_t __attribute__((export_name("TS_Route_clone"))) TS_Route_clone(uint32_t orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRoute ret_var = Route_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33766,7 +33779,7 @@ int8_tArray __attribute__((export_name("TS_Route_write"))) TS_Route_write(uint3 obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Route_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -33775,10 +33788,10 @@ int8_tArray __attribute__((export_name("TS_Route_write"))) TS_Route_write(uint3 uint32_t __attribute__((export_name("TS_Route_read"))) TS_Route_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ"); *ret_conv = Route_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_RouteParameters_free"))) TS_RouteParameters_free(uint32_t this_obj) { @@ -33795,11 +33808,11 @@ uint32_t __attribute__((export_name("TS_RouteParameters_get_payee"))) TS_RouteP this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPayee ret_var = RouteParameters_get_payee(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33860,11 +33873,11 @@ uint32_t __attribute__((export_name("TS_RouteParameters_new"))) TS_RouteParamet CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_arg_conv); payee_arg_conv = Payee_clone(&payee_arg_conv); LDKRouteParameters ret_var = RouteParameters_new(payee_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33873,22 +33886,22 @@ uint32_t __attribute__((export_name("TS_RouteParameters_new"))) TS_RouteParamet static inline uintptr_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) { LDKRouteParameters ret_var = RouteParameters_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RouteParameters_clone_ptr"))) TS_RouteParameters_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RouteParameters_clone_ptr"))) TS_RouteParameters_clone_ptr(uint32_t arg) { LDKRouteParameters arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RouteParameters_clone_ptr(&arg_conv); + intptr_t ret_val = RouteParameters_clone_ptr(&arg_conv); return ret_val; } @@ -33898,11 +33911,11 @@ uint32_t __attribute__((export_name("TS_RouteParameters_clone"))) TS_RouteParam orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33915,7 +33928,7 @@ int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RoutePa obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -33924,10 +33937,10 @@ int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RoutePa uint32_t __attribute__((export_name("TS_RouteParameters_read"))) TS_RouteParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ"); *ret_conv = RouteParameters_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_Payee_free"))) TS_Payee_free(uint32_t this_obj) { @@ -33943,7 +33956,7 @@ int8_tArray __attribute__((export_name("TS_Payee_get_pubkey"))) TS_Payee_get_pu this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, Payee_get_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -33955,7 +33968,7 @@ void __attribute__((export_name("TS_Payee_set_pubkey"))) TS_Payee_set_pubkey(ui CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); Payee_set_pubkey(&this_ptr_conv, val_ref); } @@ -33965,12 +33978,12 @@ uint32_t __attribute__((export_name("TS_Payee_get_features"))) TS_Payee_get_fea this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKInvoiceFeatures ret_var = Payee_get_features(&this_ptr_conv); - uint64_t ret_ref = 0; - if ((uint64_t)ret_var.inner > 4096) { - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + if ((uintptr_t)ret_var.inner > 4096) { + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -33998,15 +34011,15 @@ uint32_tArray __attribute__((export_name("TS_Payee_get_route_hints"))) TS_Payee CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintZ ret_var = Payee_get_route_hints(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t l = 0; l < ret_var.datalen; l++) { LDKRouteHint ret_conv_11_var = ret_var.data[l]; - uint64_t ret_conv_11_ref = 0; - CHECK((((uint64_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_11_ref = 0; + CHECK((((uintptr_t)ret_conv_11_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_11_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var); - ret_conv_11_ref = (uint64_t)ret_conv_11_var.inner; + ret_conv_11_ref = (uintptr_t)ret_conv_11_var.inner; if (ret_conv_11_var.is_owned) { ret_conv_11_ref |= 1; } @@ -34028,7 +34041,7 @@ void __attribute__((export_name("TS_Payee_set_route_hints"))) TS_Payee_set_rout val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t l = 0; l < val_constr.datalen; l++) { uint32_t val_conv_11 = val_vals[l]; LDKRouteHint val_conv_11_conv; @@ -34048,7 +34061,7 @@ uint32_t __attribute__((export_name("TS_Payee_get_expiry_time"))) TS_Payee_get_ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = Payee_get_expiry_time(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -34057,17 +34070,17 @@ void __attribute__((export_name("TS_Payee_set_expiry_time"))) TS_Payee_set_expi this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); Payee_set_expiry_time(&this_ptr_conv, val_conv); } uint32_t __attribute__((export_name("TS_Payee_new"))) TS_Payee_new(int8_tArray pubkey_arg, uint32_t features_arg, uint32_tArray route_hints_arg, uint32_t expiry_time_arg) { LDKPublicKey pubkey_arg_ref; CHECK(pubkey_arg->arr_len == 33); - memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); + memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg); LDKInvoiceFeatures features_arg_conv; features_arg_conv.inner = (void*)(features_arg & (~1)); features_arg_conv.is_owned = (features_arg & 1) || (features_arg == 0); @@ -34079,7 +34092,7 @@ uint32_t __attribute__((export_name("TS_Payee_new"))) TS_Payee_new(int8_tArray route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements"); else route_hints_arg_constr.data = NULL; - uint32_t* route_hints_arg_vals = route_hints_arg->elems; + uint32_t* route_hints_arg_vals = route_hints_arg->elems /* XXX route_hints_arg leaks */; for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) { uint32_t route_hints_arg_conv_11 = route_hints_arg_vals[l]; LDKRouteHint route_hints_arg_conv_11_conv; @@ -34089,16 +34102,16 @@ uint32_t __attribute__((export_name("TS_Payee_new"))) TS_Payee_new(int8_tArray route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv); route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv; } - void* expiry_time_arg_ptr = (void*)(((uint64_t)expiry_time_arg) & ~1); + void* expiry_time_arg_ptr = (void*)(((uintptr_t)expiry_time_arg) & ~1); CHECK_ACCESS(expiry_time_arg_ptr); LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr); - expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)expiry_time_arg) & ~1)); + expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)expiry_time_arg) & ~1)); LDKPayee ret_var = Payee_new(pubkey_arg_ref, features_arg_conv, route_hints_arg_constr, expiry_time_arg_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34107,22 +34120,22 @@ uint32_t __attribute__((export_name("TS_Payee_new"))) TS_Payee_new(int8_tArray static inline uintptr_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg) { LDKPayee ret_var = Payee_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_Payee_clone_ptr"))) TS_Payee_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_Payee_clone_ptr"))) TS_Payee_clone_ptr(uint32_t arg) { LDKPayee arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = Payee_clone_ptr(&arg_conv); + intptr_t ret_val = Payee_clone_ptr(&arg_conv); return ret_val; } @@ -34132,11 +34145,11 @@ uint32_t __attribute__((export_name("TS_Payee_clone"))) TS_Payee_clone(uint32_t orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKPayee ret_var = Payee_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34171,7 +34184,7 @@ int8_tArray __attribute__((export_name("TS_Payee_write"))) TS_Payee_write(uint3 obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = Payee_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -34180,22 +34193,22 @@ int8_tArray __attribute__((export_name("TS_Payee_write"))) TS_Payee_write(uint3 uint32_t __attribute__((export_name("TS_Payee_read"))) TS_Payee_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_PayeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeeDecodeErrorZ), "LDKCResult_PayeeDecodeErrorZ"); *ret_conv = Payee_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_Payee_from_node_id"))) TS_Payee_from_node_id(int8_tArray pubkey) { LDKPublicKey pubkey_ref; CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); LDKPayee ret_var = Payee_from_node_id(pubkey_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34205,13 +34218,13 @@ uint32_t __attribute__((export_name("TS_Payee_from_node_id"))) TS_Payee_from_no uint32_t __attribute__((export_name("TS_Payee_for_keysend"))) TS_Payee_for_keysend(int8_tArray pubkey) { LDKPublicKey pubkey_ref; CHECK(pubkey->arr_len == 33); - memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); + memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey); LDKPayee ret_var = Payee_for_keysend(pubkey_ref); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34233,15 +34246,15 @@ uint32_tArray __attribute__((export_name("TS_RouteHint_get_a"))) TS_RouteHint_g CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv); uint32_tArray ret_arr = NULL; - ret_arr = init_uint32_tArray(ret_var.datalen); + ret_arr = init_uint32_tArray(ret_var.datalen, __LINE__); uint32_t *ret_arr_ptr = (uint32_t*)(((uint8_t*)ret_arr) + 4); for (size_t o = 0; o < ret_var.datalen; o++) { LDKRouteHintHop ret_conv_14_var = ret_var.data[o]; - uint64_t ret_conv_14_ref = 0; - CHECK((((uint64_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_conv_14_ref = 0; + CHECK((((uintptr_t)ret_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_conv_14_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var); - ret_conv_14_ref = (uint64_t)ret_conv_14_var.inner; + ret_conv_14_ref = (uintptr_t)ret_conv_14_var.inner; if (ret_conv_14_var.is_owned) { ret_conv_14_ref |= 1; } @@ -34263,7 +34276,7 @@ void __attribute__((export_name("TS_RouteHint_set_a"))) TS_RouteHint_set_a(uint val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); else val_constr.data = NULL; - uint32_t* val_vals = val->elems; + uint32_t* val_vals = val->elems /* XXX val leaks */; for (size_t o = 0; o < val_constr.datalen; o++) { uint32_t val_conv_14 = val_vals[o]; LDKRouteHintHop val_conv_14_conv; @@ -34283,7 +34296,7 @@ uint32_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements"); else a_arg_constr.data = NULL; - uint32_t* a_arg_vals = a_arg->elems; + uint32_t* a_arg_vals = a_arg->elems /* XXX a_arg leaks */; for (size_t o = 0; o < a_arg_constr.datalen; o++) { uint32_t a_arg_conv_14 = a_arg_vals[o]; LDKRouteHintHop a_arg_conv_14_conv; @@ -34294,11 +34307,11 @@ uint32_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint a_arg_constr.data[o] = a_arg_conv_14_conv; } LDKRouteHint ret_var = RouteHint_new(a_arg_constr); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34307,22 +34320,22 @@ uint32_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint static inline uintptr_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) { LDKRouteHint ret_var = RouteHint_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RouteHint_clone_ptr"))) TS_RouteHint_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RouteHint_clone_ptr"))) TS_RouteHint_clone_ptr(uint32_t arg) { LDKRouteHint arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RouteHint_clone_ptr(&arg_conv); + intptr_t ret_val = RouteHint_clone_ptr(&arg_conv); return ret_val; } @@ -34332,11 +34345,11 @@ uint32_t __attribute__((export_name("TS_RouteHint_clone"))) TS_RouteHint_clone( orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHint ret_var = RouteHint_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34371,7 +34384,7 @@ int8_tArray __attribute__((export_name("TS_RouteHint_write"))) TS_RouteHint_wri obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -34380,10 +34393,10 @@ int8_tArray __attribute__((export_name("TS_RouteHint_write"))) TS_RouteHint_wri uint32_t __attribute__((export_name("TS_RouteHint_read"))) TS_RouteHint_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ"); *ret_conv = RouteHint_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_RouteHintHop_free"))) TS_RouteHintHop_free(uint32_t this_obj) { @@ -34399,7 +34412,7 @@ int8_tArray __attribute__((export_name("TS_RouteHintHop_get_src_node_id"))) TS_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - int8_tArray ret_arr = init_int8_tArray(33); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); memcpy(ret_arr->elems, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; } @@ -34411,7 +34424,7 @@ void __attribute__((export_name("TS_RouteHintHop_set_src_node_id"))) TS_RouteHi CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKPublicKey val_ref; CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); + memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref); } @@ -34438,11 +34451,11 @@ uint32_t __attribute__((export_name("TS_RouteHintHop_get_fees"))) TS_RouteHintH this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34486,7 +34499,7 @@ uint32_t __attribute__((export_name("TS_RouteHintHop_get_htlc_minimum_msat"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -34495,10 +34508,10 @@ void __attribute__((export_name("TS_RouteHintHop_set_htlc_minimum_msat"))) TS_R this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv); } @@ -34509,7 +34522,7 @@ uint32_t __attribute__((export_name("TS_RouteHintHop_get_htlc_maximum_msat"))) CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv); - uint64_t ret_ref = (uint64_t)ret_copy; + uintptr_t ret_ref = (uintptr_t)ret_copy; return ret_ref; } @@ -34518,36 +34531,36 @@ void __attribute__((export_name("TS_RouteHintHop_set_htlc_maximum_msat"))) TS_R this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - void* val_ptr = (void*)(((uint64_t)val) & ~1); + void* val_ptr = (void*)(((uintptr_t)val) & ~1); CHECK_ACCESS(val_ptr); LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)val) & ~1)); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)val) & ~1)); RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv); } uint32_t __attribute__((export_name("TS_RouteHintHop_new"))) TS_RouteHintHop_new(int8_tArray src_node_id_arg, int64_t short_channel_id_arg, uint32_t fees_arg, int16_t cltv_expiry_delta_arg, uint32_t htlc_minimum_msat_arg, uint32_t htlc_maximum_msat_arg) { LDKPublicKey src_node_id_arg_ref; CHECK(src_node_id_arg->arr_len == 33); - memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); + memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg); LDKRoutingFees fees_arg_conv; fees_arg_conv.inner = (void*)(fees_arg & (~1)); fees_arg_conv.is_owned = (fees_arg & 1) || (fees_arg == 0); CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv); fees_arg_conv = RoutingFees_clone(&fees_arg_conv); - void* htlc_minimum_msat_arg_ptr = (void*)(((uint64_t)htlc_minimum_msat_arg) & ~1); + void* htlc_minimum_msat_arg_ptr = (void*)(((uintptr_t)htlc_minimum_msat_arg) & ~1); CHECK_ACCESS(htlc_minimum_msat_arg_ptr); LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr); - htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_minimum_msat_arg) & ~1)); - void* htlc_maximum_msat_arg_ptr = (void*)(((uint64_t)htlc_maximum_msat_arg) & ~1); + htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)htlc_minimum_msat_arg) & ~1)); + void* htlc_maximum_msat_arg_ptr = (void*)(((uintptr_t)htlc_maximum_msat_arg) & ~1); CHECK_ACCESS(htlc_maximum_msat_arg_ptr); LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr); - htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uint64_t)htlc_maximum_msat_arg) & ~1)); + htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)(((uintptr_t)htlc_maximum_msat_arg) & ~1)); 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); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34556,22 +34569,22 @@ uint32_t __attribute__((export_name("TS_RouteHintHop_new"))) TS_RouteHintHop_ne static inline uintptr_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) { LDKRouteHintHop ret_var = RouteHintHop_clone(arg); -uint64_t ret_ref = 0; -CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. -CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. +uintptr_t ret_ref = 0; +CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. +CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); -ret_ref = (uint64_t)ret_var.inner; +ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } return ret_ref; } -int64_t __attribute__((export_name("TS_RouteHintHop_clone_ptr"))) TS_RouteHintHop_clone_ptr(uint32_t arg) { +intptr_t __attribute__((export_name("TS_RouteHintHop_clone_ptr"))) TS_RouteHintHop_clone_ptr(uint32_t arg) { LDKRouteHintHop arg_conv; arg_conv.inner = (void*)(arg & (~1)); arg_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - int64_t ret_val = RouteHintHop_clone_ptr(&arg_conv); + intptr_t ret_val = RouteHintHop_clone_ptr(&arg_conv); return ret_val; } @@ -34581,11 +34594,11 @@ uint32_t __attribute__((export_name("TS_RouteHintHop_clone"))) TS_RouteHintHop_ orig_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34620,7 +34633,7 @@ int8_tArray __attribute__((export_name("TS_RouteHintHop_write"))) TS_RouteHintH obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -34629,16 +34642,16 @@ int8_tArray __attribute__((export_name("TS_RouteHintHop_write"))) TS_RouteHintH uint32_t __attribute__((export_name("TS_RouteHintHop_read"))) TS_RouteHintHop_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ"); *ret_conv = RouteHintHop_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_find_route"))) TS_find_route(int8_tArray our_node_pubkey, uint32_t params, uint32_t network, uint32_tArray first_hops, uint32_t logger, uint32_t scorer) { LDKPublicKey our_node_pubkey_ref; CHECK(our_node_pubkey->arr_len == 33); - memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); + memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey); LDKRouteParameters params_conv; params_conv.inner = (void*)(params & (~1)); params_conv.is_owned = false; @@ -34655,7 +34668,7 @@ uint32_t __attribute__((export_name("TS_find_route"))) TS_find_route(int8_tArra first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); else first_hops_constr.data = NULL; - uint32_t* first_hops_vals = first_hops->elems; + uint32_t* first_hops_vals = first_hops->elems /* XXX first_hops leaks */; for (size_t q = 0; q < first_hops_constr.datalen; q++) { uint32_t first_hops_conv_16 = first_hops_vals[q]; LDKChannelDetails first_hops_conv_16_conv; @@ -34666,21 +34679,21 @@ uint32_t __attribute__((export_name("TS_find_route"))) TS_find_route(int8_tArra } first_hops_ptr = &first_hops_constr; } - void* logger_ptr = (void*)(((uint64_t)logger) & ~1); + void* logger_ptr = (void*)(((uintptr_t)logger) & ~1); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - void* scorer_ptr = (void*)(((uint64_t)scorer) & ~1); + void* scorer_ptr = (void*)(((uintptr_t)scorer) & ~1); if (!(scorer & 1)) { CHECK_ACCESS(scorer_ptr); } LDKScore* scorer_conv = (LDKScore*)scorer_ptr; LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = find_route(our_node_pubkey_ref, ¶ms_conv, &network_conv, first_hops_ptr, logger_conv, scorer_conv); if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } void __attribute__((export_name("TS_Score_free"))) TS_Score_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -34689,7 +34702,7 @@ void __attribute__((export_name("TS_Score_free"))) TS_Score_free(uint32_t this_ void __attribute__((export_name("TS_LockableScore_free"))) TS_LockableScore_free(uint32_t this_ptr) { if ((this_ptr & 1) != 0) return; - void* this_ptr_ptr = (void*)(((uint64_t)this_ptr) & ~1); + void* this_ptr_ptr = (void*)(((uintptr_t)this_ptr) & ~1); CHECK_ACCESS(this_ptr_ptr); LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr); FREE((void*)this_ptr); @@ -34705,15 +34718,15 @@ void __attribute__((export_name("TS_MultiThreadedLockableScore_free"))) TS_Mult } uint32_t __attribute__((export_name("TS_MultiThreadedLockableScore_new"))) TS_MultiThreadedLockableScore_new(uint32_t score) { - void* score_ptr = (void*)(((uint64_t)score) & ~1); + void* score_ptr = (void*)(((uintptr_t)score) & ~1); CHECK_ACCESS(score_ptr); LDKScore score_conv = *(LDKScore*)(score_ptr); LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34815,11 +34828,11 @@ void __attribute__((export_name("TS_ScoringParameters_set_failure_penalty_half_ uint32_t __attribute__((export_name("TS_ScoringParameters_new"))) TS_ScoringParameters_new(int64_t base_penalty_msat_arg, int64_t failure_penalty_msat_arg, int16_t overuse_penalty_start_1024th_arg, int64_t overuse_penalty_msat_per_1024th_arg, int64_t failure_penalty_half_life_arg) { LDKScoringParameters ret_var = ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } @@ -34832,7 +34845,7 @@ int8_tArray __attribute__((export_name("TS_ScoringParameters_write"))) TS_Scori obj_conv.is_owned = false; CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); LDKCVec_u8Z ret_var = ScoringParameters_write(&obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen); + int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; @@ -34841,19 +34854,19 @@ int8_tArray __attribute__((export_name("TS_ScoringParameters_write"))) TS_Scori uint32_t __attribute__((export_name("TS_ScoringParameters_read"))) TS_ScoringParameters_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; + ser_ref.data = ser->elems /* XXX ser leaks */; LDKCResult_ScoringParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ScoringParametersDecodeErrorZ), "LDKCResult_ScoringParametersDecodeErrorZ"); *ret_conv = ScoringParameters_read(ser_ref); - return (uint64_t)ret_conv; + return (uintptr_t)ret_conv; } uint32_t __attribute__((export_name("TS_ScoringParameters_default"))) TS_ScoringParameters_default() { LDKScoringParameters ret_var = ScoringParameters_default(); - uint64_t ret_ref = 0; - CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. - CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + uintptr_t ret_ref = 0; + CHECK((((uintptr_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((uintptr_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = (uint64_t)ret_var.inner; + ret_ref = (uintptr_t)ret_var.inner; if (ret_var.is_owned) { ret_ref |= 1; } diff --git a/ts/bindings.mts b/ts/bindings.mts index 6e4d0ca4..af8cbfbe 100644 --- a/ts/bindings.mts +++ b/ts/bindings.mts @@ -1,4 +1,6 @@ +import * as version from './version.mjs'; + const imports: any = {}; imports.env = {}; @@ -16,6 +18,16 @@ imports.wasi_snapshot_preview1 = { } return 0; }, + "fd_close": (_fd: number) => { + // This is not generally called, but may be referenced in debug builds + console.log("wasi_snapshot_preview1:fd_close"); + return 58; // Not Supported + }, + "fd_seek": (_fd: number, _offset: bigint, _whence: number, _new_offset: number) => { + // This is not generally called, but may be referenced in debug builds + console.log("wasi_snapshot_preview1:fd_seek"); + return 58; // Not Supported + }, "random_get": (buf_ptr: number, buf_len: number) => { const buf = new Uint8Array(wasm.memory.buffer, buf_ptr, buf_len); crypto.getRandomValues(buf); @@ -25,21 +37,15 @@ imports.wasi_snapshot_preview1 = { // This is called before fd_write to format + print panic messages console.log("wasi_snapshot_preview1:environ_sizes_get"); const out_count_view = new Uint32Array(wasm.memory.buffer, environ_var_count_ptr, 1); - out_count_view[0] = 1; + out_count_view[0] = 0; const out_len_view = new Uint32Array(wasm.memory.buffer, environ_len_ptr, 1); - out_len_view[0] = "RUST_BACKTRACE=1".length + 1; // Note that string must be NULL-terminated + out_len_view[0] = 0; return 0; }, "environ_get": (environ_ptr: number, environ_buf_ptr: number) => { // This is called before fd_write to format + print panic messages console.log("wasi_snapshot_preview1:environ_get"); - const out_ptrs = new Uint32Array(wasm.memory.buffer, environ_ptr, 2); - out_ptrs[0] = environ_buf_ptr; - out_ptrs[1] = "RUST_BACKTRACE=1".length; - const out_environ = new Uint8Array(wasm.memory.buffer, environ_buf_ptr, out_ptrs[1]); - for (var i = 0; i < out_ptrs[1]; i++) { out_environ[i] = "RUST_BACKTRACE=1".codePointAt(i); } - out_environ[out_ptrs[1]] = 0; - return 0; + return 58; // Note supported - we said there were 0 environment entries! }, "proc_exit" : () => { console.log("wasi_snapshot_preview1:proc_exit"); @@ -49,6 +55,7 @@ imports.wasi_snapshot_preview1 = { var wasm: any = null; let isWasmInitialized: boolean = false; +/* @internal */ export async function initializeWasm(uri: string) { const stream = fetch(uri); imports.env["js_invoke_function"] = js_invoke; @@ -57,11 +64,22 @@ export async function initializeWasm(uri: string) { if (!wasm.test_bigint_pass_deadbeef0badf00d(BigInt("0xdeadbeef0badf00d"))) { throw new Error("Currently need BigInt-as-u64 support, try ----experimental-wasm-bigint"); } - isWasmInitialized = true; -}; - + if (decodeString(wasm.TS_get_lib_version_string()) !== version.get_ldk_java_bindings_version()) + throw new Error("Compiled LDK library and LDK class failes do not match"); + // Fetching the LDK versions from C also checks that the header and binaries match + const c_bindings_ver: number = wasm.TS_get_ldk_c_bindings_version(); + const ldk_ver: number = wasm.TS_get_ldk_version(); + if (c_bindings_ver == 0) + throw new Error("LDK version did not match the header we built against"); + if (ldk_ver == 0) + throw new Error("LDK C bindings version did not match the header we built against"); + const c_bindings_version: string = decodeString(c_bindings_ver) + const ldk_version: string = decodeString(ldk_ver); + console.log("Loaded LDK-Java Bindings with LDK " + ldk_version + " and LDK-C-Bindings " + c_bindings_version); + isWasmInitialized = true; +}; // WASM CODEC @@ -69,6 +87,7 @@ const nextMultipleOfFour = (value: number) => { return Math.ceil(value / 4) * 4; } +/* @internal */ export function encodeUint8Array (inputArray: Uint8Array): number { const cArrayPointer = wasm.TS_malloc(inputArray.length + 4); const arrayLengthView = new Uint32Array(wasm.memory.buffer, cArrayPointer, 1); @@ -77,6 +96,7 @@ export function encodeUint8Array (inputArray: Uint8Array): number { arrayMemoryView.set(inputArray); return cArrayPointer; } +/* @internal */ export function encodeUint32Array (inputArray: Uint32Array|Array): number { const cArrayPointer = wasm.TS_malloc((inputArray.length + 1) * 4); const arrayMemoryView = new Uint32Array(wasm.memory.buffer, cArrayPointer, inputArray.length); @@ -84,6 +104,7 @@ export function encodeUint32Array (inputArray: Uint32Array|Array): numbe arrayMemoryView[0] = inputArray.length; return cArrayPointer; } +/* @internal */ export function encodeUint64Array (inputArray: BigUint64Array|Array): number { const cArrayPointer = wasm.TS_malloc(inputArray.length * 8 + 1); const arrayLengthView = new Uint32Array(wasm.memory.buffer, cArrayPointer, 1); @@ -93,15 +114,18 @@ export function encodeUint64Array (inputArray: BigUint64Array|Array): nu return cArrayPointer; } +/* @internal */ export function check_arr_len(arr: Uint8Array, len: number): Uint8Array { if (arr.length != len) { throw new Error("Expected array of length " + len + "got " + arr.length); } return arr; } +/* @internal */ export function getArrayLength(arrayPointer: number): number { const arraySizeViewer = new Uint32Array(wasm.memory.buffer, arrayPointer, 1); return arraySizeViewer[0]; } +/* @internal */ export function decodeUint8Array (arrayPointer: number, free = true): Uint8Array { const arraySize = getArrayLength(arrayPointer); const actualArrayViewer = new Uint8Array(wasm.memory.buffer, arrayPointer + 4, arraySize); @@ -130,16 +154,22 @@ const decodeUint32Array = (arrayPointer: number, free = true) => { return actualArray; } + +export function freeWasmMemory(pointer: number) { wasm.TS_free(pointer); } + +/* @internal */ export function getU32ArrayElem(arrayPointer: number, idx: number): number { const actualArrayViewer = new Uint32Array(wasm.memory.buffer, arrayPointer + 4, idx + 1); return actualArrayViewer[idx]; } +/* @internal */ export function encodeString(str: string): number { const charArray = new TextEncoder().encode(str); return encodeUint8Array(charArray); } +/* @internal */ export function decodeString(stringPointer: number, free = true): string { const arraySize = getArrayLength(stringPointer); const memoryView = new Uint8Array(wasm.memory.buffer, stringPointer + 4, arraySize); @@ -152,202 +182,213 @@ export function decodeString(stringPointer: number, free = true): string { return result; } - export enum AccessError { - /** - * The requested chain is unknown. - */ -LDKAccessError_UnknownChain, - /** - * The requested transaction doesn't exist or hasn't confirmed. - */ -LDKAccessError_UnknownTx, - - } - - export enum COption_NoneZ { - /** - * When we're in this state, this COption_NoneZ contains a - */ -LDKCOption_NoneZ_Some, - /** - * When we're in this state, this COption_NoneZ contains nothing - */ -LDKCOption_NoneZ_None, - - } +/* @internal */ export function getRemainingAllocationCount(): number { return 0; } +/* @internal */ export function debugPrintRemainingAllocs() { } - export enum ChannelMonitorUpdateErr { - /** - * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of -our state failed, but is expected to succeed at some point in the future). - -Such a failure will \"freeze\" a channel, preventing us from revoking old states or -submitting new commitment transactions to the counterparty. Once the update(s) that failed -have been successfully applied, a [`MonitorEvent::UpdateCompleted`] event should be returned -via [`Watch::release_pending_monitor_events`] which will then restore the channel to an -operational state. - -Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If -you return a TemporaryFailure you must ensure that it is written to disk safely before -writing out the latest ChannelManager state. - -Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur -(eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting -to claim it on this channel) and those updates must be applied wherever they can be. At -least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should -be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to -the channel which would invalidate previous ChannelMonitors are not made when a channel has -been \"frozen\". - -Note that even if updates made after TemporaryFailure succeed you must still provide a -[`MonitorEvent::UpdateCompleted`] to ensure you have the latest monitor and re-enable -normal channel operation. Note that this is normally generated through a call to -[`ChainMonitor::channel_monitor_updated`]. - -Note that the update being processed here will not be replayed for you when you return a -[`MonitorEvent::UpdateCompleted`] event via [`Watch::release_pending_monitor_events`], so -you must store the update itself on your own local disk prior to returning a -TemporaryFailure. You may, of course, employ a journaling approach, storing only the -ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at -reload-time. - -For deployments where a copy of ChannelMonitors and other local state are backed up in a -remote location (with local copies persisted immediately), it is anticipated that all -updates will return TemporaryFailure until the remote copies could be updated. - -[`ChainMonitor::channel_monitor_updated`]: chainmonitor::ChainMonitor::channel_monitor_updated - */ -LDKChannelMonitorUpdateErr_TemporaryFailure, - /** - * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a -different watchtower and cannot update with all watchtowers that were previously informed -of this channel). - -At reception of this error, ChannelManager will force-close the channel and return at -least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at -least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel -update must be rejected. - -This failure may also signal a failure to update the local persisted copy of one of -the channel monitor instance. +/* @internal */ +export enum AccessError { + /** + * The requested chain is unknown. + */ + LDKAccessError_UnknownChain, + /** + * The requested transaction doesn't exist or hasn't confirmed. + */ + LDKAccessError_UnknownTx, + +} -Note that even when you fail a holder commitment transaction update, you must store the -update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor -broadcasts it (e.g distributed channel-monitor deployment) +/* @internal */ +export enum COption_NoneZ { + /** + * When we're in this state, this COption_NoneZ contains a + */ + LDKCOption_NoneZ_Some, + /** + * When we're in this state, this COption_NoneZ contains nothing + */ + LDKCOption_NoneZ_None, + +} -In case of distributed watchtowers deployment, the new version must be written to disk, as -state may have been stored but rejected due to a block forcing a commitment broadcast. This -storage is used to claim outputs of rejected state confirmed onchain by another watchtower, -lagging behind on block processing. - */ -LDKChannelMonitorUpdateErr_PermanentFailure, - - } +/* @internal */ +export enum ChannelMonitorUpdateErr { + /** + * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of + our state failed, but is expected to succeed at some point in the future). + + Such a failure will \"freeze\" a channel, preventing us from revoking old states or + submitting new commitment transactions to the counterparty. Once the update(s) that failed + have been successfully applied, a [`MonitorEvent::UpdateCompleted`] event should be returned + via [`Watch::release_pending_monitor_events`] which will then restore the channel to an + operational state. + + Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If + you return a TemporaryFailure you must ensure that it is written to disk safely before + writing out the latest ChannelManager state. + + Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur + (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting + to claim it on this channel) and those updates must be applied wherever they can be. At + least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should + be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to + the channel which would invalidate previous ChannelMonitors are not made when a channel has + been \"frozen\". + + Note that even if updates made after TemporaryFailure succeed you must still provide a + [`MonitorEvent::UpdateCompleted`] to ensure you have the latest monitor and re-enable + normal channel operation. Note that this is normally generated through a call to + [`ChainMonitor::channel_monitor_updated`]. + + Note that the update being processed here will not be replayed for you when you return a + [`MonitorEvent::UpdateCompleted`] event via [`Watch::release_pending_monitor_events`], so + you must store the update itself on your own local disk prior to returning a + TemporaryFailure. You may, of course, employ a journaling approach, storing only the + ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at + reload-time. + + For deployments where a copy of ChannelMonitors and other local state are backed up in a + remote location (with local copies persisted immediately), it is anticipated that all + updates will return TemporaryFailure until the remote copies could be updated. + + [`ChainMonitor::channel_monitor_updated`]: chainmonitor::ChainMonitor::channel_monitor_updated + */ + LDKChannelMonitorUpdateErr_TemporaryFailure, + /** + * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a + different watchtower and cannot update with all watchtowers that were previously informed + of this channel). + + At reception of this error, ChannelManager will force-close the channel and return at + least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at + least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel + update must be rejected. + + This failure may also signal a failure to update the local persisted copy of one of + the channel monitor instance. + + Note that even when you fail a holder commitment transaction update, you must store the + update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor + broadcasts it (e.g distributed channel-monitor deployment) + + In case of distributed watchtowers deployment, the new version must be written to disk, as + state may have been stored but rejected due to a block forcing a commitment broadcast. This + storage is used to claim outputs of rejected state confirmed onchain by another watchtower, + lagging behind on block processing. + */ + LDKChannelMonitorUpdateErr_PermanentFailure, + +} - export enum ConfirmationTarget { - /** - * We are happy with this transaction confirming slowly when feerate drops some. - */ -LDKConfirmationTarget_Background, - /** - * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine. - */ -LDKConfirmationTarget_Normal, - /** - * We'd like this transaction to confirm in the next few blocks. - */ -LDKConfirmationTarget_HighPriority, - - } +/* @internal */ +export enum ConfirmationTarget { + /** + * We are happy with this transaction confirming slowly when feerate drops some. + */ + LDKConfirmationTarget_Background, + /** + * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine. + */ + LDKConfirmationTarget_Normal, + /** + * We'd like this transaction to confirm in the next few blocks. + */ + LDKConfirmationTarget_HighPriority, + +} - export enum Level { - /** - * Designates extremely verbose information, including gossip-induced messages - */ -LDKLevel_Gossip, - /** - * Designates very low priority, often extremely verbose, information - */ -LDKLevel_Trace, - /** - * Designates lower priority information - */ -LDKLevel_Debug, - /** - * Designates useful information - */ -LDKLevel_Info, - /** - * Designates hazardous situations - */ -LDKLevel_Warn, - /** - * Designates very serious errors - */ -LDKLevel_Error, - - } +/* @internal */ +export enum Level { + /** + * Designates extremely verbose information, including gossip-induced messages + */ + LDKLevel_Gossip, + /** + * Designates very low priority, often extremely verbose, information + */ + LDKLevel_Trace, + /** + * Designates lower priority information + */ + LDKLevel_Debug, + /** + * Designates useful information + */ + LDKLevel_Info, + /** + * Designates hazardous situations + */ + LDKLevel_Warn, + /** + * Designates very serious errors + */ + LDKLevel_Error, + +} - export enum Network { - /** - * The main Bitcoin blockchain. - */ -LDKNetwork_Bitcoin, - /** - * The testnet3 blockchain. - */ -LDKNetwork_Testnet, - /** - * A local test blockchain. - */ -LDKNetwork_Regtest, - /** - * A blockchain on which blocks are signed instead of mined. - */ -LDKNetwork_Signet, - - } +/* @internal */ +export enum Network { + /** + * The main Bitcoin blockchain. + */ + LDKNetwork_Bitcoin, + /** + * The testnet3 blockchain. + */ + LDKNetwork_Testnet, + /** + * A local test blockchain. + */ + LDKNetwork_Regtest, + /** + * A blockchain on which blocks are signed instead of mined. + */ + LDKNetwork_Signet, + +} - export enum Secp256k1Error { - /** - * Signature failed verification - */ -LDKSecp256k1Error_IncorrectSignature, - /** - * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant) - */ -LDKSecp256k1Error_InvalidMessage, - /** - * Bad public key - */ -LDKSecp256k1Error_InvalidPublicKey, - /** - * Bad signature - */ -LDKSecp256k1Error_InvalidSignature, - /** - * Bad secret key - */ -LDKSecp256k1Error_InvalidSecretKey, - /** - * Bad recovery id - */ -LDKSecp256k1Error_InvalidRecoveryId, - /** - * Invalid tweak for add_assign or mul_assign - */ -LDKSecp256k1Error_InvalidTweak, - /** - * tweak_add_check failed on an xonly public key - */ -LDKSecp256k1Error_TweakCheckFailed, - /** - * Didn't pass enough memory to context creation with preallocated memory - */ -LDKSecp256k1Error_NotEnoughMemory, - - } +/* @internal */ +export enum Secp256k1Error { + /** + * Signature failed verification + */ + LDKSecp256k1Error_IncorrectSignature, + /** + * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant) + */ + LDKSecp256k1Error_InvalidMessage, + /** + * Bad public key + */ + LDKSecp256k1Error_InvalidPublicKey, + /** + * Bad signature + */ + LDKSecp256k1Error_InvalidSignature, + /** + * Bad secret key + */ + LDKSecp256k1Error_InvalidSecretKey, + /** + * Bad recovery id + */ + LDKSecp256k1Error_InvalidRecoveryId, + /** + * Invalid tweak for add_assign or mul_assign + */ + LDKSecp256k1Error_InvalidTweak, + /** + * tweak_add_check failed on an xonly public key + */ + LDKSecp256k1Error_TweakCheckFailed, + /** + * Didn't pass enough memory to context creation with preallocated memory + */ + LDKSecp256k1Error_NotEnoughMemory, + +} // struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) +/* @internal */ export function TxOut_get_script_pubkey(thing: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -356,6 +397,7 @@ export function TxOut_get_script_pubkey(thing: number): number { return nativeResponseValue; } // uint64_t TxOut_get_value (struct LDKTxOut* thing) +/* @internal */ export function TxOut_get_value(thing: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -364,6 +406,7 @@ export function TxOut_get_value(thing: number): bigint { return nativeResponseValue; } // struct LDKChannelConfig CResult_ChannelConfigDecodeErrorZ_get_ok(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelConfigDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -372,6 +415,7 @@ export function CResult_ChannelConfigDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelConfigDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -380,6 +424,7 @@ export function CResult_ChannelConfigDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_OutPointDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -388,6 +433,7 @@ export function CResult_OutPointDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_OutPointDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -396,6 +442,7 @@ export function CResult_OutPointDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_SecretKeyErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -404,6 +451,7 @@ export function CResult_SecretKeyErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_SecretKeyErrorZ_get_err(owner: number): Secp256k1Error { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -412,6 +460,7 @@ export function CResult_SecretKeyErrorZ_get_err(owner: number): Secp256k1Error { return nativeResponseValue; } // struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PublicKeyErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -420,6 +469,7 @@ export function CResult_PublicKeyErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PublicKeyErrorZ_get_err(owner: number): Secp256k1Error { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -428,6 +478,7 @@ export function CResult_PublicKeyErrorZ_get_err(owner: number): Secp256k1Error { return nativeResponseValue; } // struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TxCreationKeysDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -436,6 +487,7 @@ export function CResult_TxCreationKeysDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TxCreationKeysDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -444,6 +496,7 @@ export function CResult_TxCreationKeysDecodeErrorZ_get_err(owner: number): numbe return nativeResponseValue; } // struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -452,6 +505,7 @@ export function CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner: number): num return nativeResponseValue; } // struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -460,6 +514,7 @@ export function CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner: number): nu return nativeResponseValue; } // struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TxCreationKeysErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -468,6 +523,7 @@ export function CResult_TxCreationKeysErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TxCreationKeysErrorZ_get_err(owner: number): Secp256k1Error { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -475,9 +531,11 @@ export function CResult_TxCreationKeysErrorZ_get_err(owner: number): Secp256k1Er const nativeResponseValue = wasm.TS_CResult_TxCreationKeysErrorZ_get_err(owner); return nativeResponseValue; } +/* @internal */ export class LDKCOption_u32Z { protected constructor() {} } +/* @internal */ export function LDKCOption_u32Z_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -485,6 +543,7 @@ export function LDKCOption_u32Z_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_u32Z_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_u32Z_Some_get_some(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -493,6 +552,7 @@ export function LDKCOption_u32Z_Some_get_some(ptr: number): number { return nativeResponseValue; } // struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -501,6 +561,7 @@ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner: number) return nativeResponseValue; } // struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -509,6 +570,7 @@ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner: number return nativeResponseValue; } // struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -517,6 +579,7 @@ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get return nativeResponseValue; } // struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -525,6 +588,7 @@ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get return nativeResponseValue; } // struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -533,6 +597,7 @@ export function CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner: n return nativeResponseValue; } // struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -541,6 +606,7 @@ export function CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner: return nativeResponseValue; } // struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -549,6 +615,7 @@ export function CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(owner: nu return nativeResponseValue; } // struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -557,6 +624,7 @@ export function CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner: n return nativeResponseValue; } // struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -565,6 +633,7 @@ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner: num return nativeResponseValue; } // struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -573,6 +642,7 @@ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner: nu return nativeResponseValue; } // struct LDKTrustedClosingTransaction *CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TrustedClosingTransactionNoneZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -581,6 +651,7 @@ export function CResult_TrustedClosingTransactionNoneZ_get_ok(owner: number): nu return nativeResponseValue; } // void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TrustedClosingTransactionNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -589,6 +660,7 @@ export function CResult_TrustedClosingTransactionNoneZ_get_err(owner: number): v // debug statements here } // struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -597,6 +669,7 @@ export function CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner: number): return nativeResponseValue; } // struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CommitmentTransactionDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -605,6 +678,7 @@ export function CResult_CommitmentTransactionDecodeErrorZ_get_err(owner: number) return nativeResponseValue; } // struct LDKTrustedCommitmentTransaction *CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -613,6 +687,7 @@ export function CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner: number): return nativeResponseValue; } // void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TrustedCommitmentTransactionNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -621,6 +696,7 @@ export function CResult_TrustedCommitmentTransactionNoneZ_get_err(owner: number) // debug statements here } // struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CVec_SignatureZNoneZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -629,6 +705,7 @@ export function CResult_CVec_SignatureZNoneZ_get_ok(owner: number): number { return nativeResponseValue; } // void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CVec_SignatureZNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -637,6 +714,7 @@ export function CResult_CVec_SignatureZNoneZ_get_err(owner: number): void { // debug statements here } // struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ShutdownScriptDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -645,6 +723,7 @@ export function CResult_ShutdownScriptDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ShutdownScriptDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -653,6 +732,7 @@ export function CResult_ShutdownScriptDecodeErrorZ_get_err(owner: number): numbe return nativeResponseValue; } // struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -661,6 +741,7 @@ export function CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner: numbe return nativeResponseValue; } // struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -668,17 +749,14 @@ export function CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner: numb const nativeResponseValue = wasm.TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKType { type_id (): number; debug_str (): number; write (): number; } +/* @internal */ export function LDKType_new(impl: LDKType): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -690,11 +768,8 @@ export function LDKType_new(impl: LDKType): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKType_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // uint16_t Type_type_id LDKType *NONNULL_PTR this_arg +/* @internal */ export function Type_type_id(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -703,6 +778,7 @@ export function Type_type_id(this_arg: number): number { return nativeResponseValue; } // LDKStr Type_debug_str LDKType *NONNULL_PTR this_arg +/* @internal */ export function Type_debug_str(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -711,6 +787,7 @@ export function Type_debug_str(this_arg: number): number { return nativeResponseValue; } // LDKCVec_u8Z Type_write LDKType *NONNULL_PTR this_arg +/* @internal */ export function Type_write(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -718,9 +795,11 @@ export function Type_write(this_arg: number): number { const nativeResponseValue = wasm.TS_Type_write(this_arg); return nativeResponseValue; } +/* @internal */ export class LDKCOption_TypeZ { protected constructor() {} } +/* @internal */ export function LDKCOption_TypeZ_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -728,6 +807,7 @@ export function LDKCOption_TypeZ_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_TypeZ_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_TypeZ_Some_get_some(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -736,6 +816,7 @@ export function LDKCOption_TypeZ_Some_get_some(ptr: number): number { return nativeResponseValue; } // struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_COption_TypeZDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -744,6 +825,7 @@ export function CResult_COption_TypeZDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_COption_TypeZDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -752,6 +834,7 @@ export function CResult_COption_TypeZDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_StringErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -760,6 +843,7 @@ export function CResult_StringErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_StringErrorZ_get_err(owner: number): Secp256k1Error { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -768,6 +852,7 @@ export function CResult_StringErrorZ_get_err(owner: number): Secp256k1Error { return nativeResponseValue; } // struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -776,6 +861,7 @@ export function CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner: number): return nativeResponseValue; } // struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -783,9 +869,11 @@ export function CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner: number): const nativeResponseValue = wasm.TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner); return nativeResponseValue; } +/* @internal */ export class LDKMonitorEvent { protected constructor() {} } +/* @internal */ export function LDKMonitorEvent_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -793,6 +881,7 @@ export function LDKMonitorEvent_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKMonitorEvent_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMonitorEvent_HTLCEvent_get_htlc_event(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -800,6 +889,7 @@ export function LDKMonitorEvent_HTLCEvent_get_htlc_event(ptr: number): number { const nativeResponseValue = wasm.TS_LDKMonitorEvent_HTLCEvent_get_htlc_event(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -807,6 +897,7 @@ export function LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirme const nativeResponseValue = wasm.TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMonitorEvent_UpdateCompleted_get_funding_txo(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -814,6 +905,7 @@ export function LDKMonitorEvent_UpdateCompleted_get_funding_txo(ptr: number): nu const nativeResponseValue = wasm.TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -821,6 +913,7 @@ export function LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(ptr: numbe const nativeResponseValue = wasm.TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMonitorEvent_UpdateFailed_get_update_failed(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -828,9 +921,11 @@ export function LDKMonitorEvent_UpdateFailed_get_update_failed(ptr: number): num const nativeResponseValue = wasm.TS_LDKMonitorEvent_UpdateFailed_get_update_failed(ptr); return nativeResponseValue; } +/* @internal */ export class LDKCOption_MonitorEventZ { protected constructor() {} } +/* @internal */ export function LDKCOption_MonitorEventZ_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -838,6 +933,7 @@ export function LDKCOption_MonitorEventZ_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_MonitorEventZ_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_MonitorEventZ_Some_get_some(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -846,6 +942,7 @@ export function LDKCOption_MonitorEventZ_Some_get_some(ptr: number): number { return nativeResponseValue; } // struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -854,6 +951,7 @@ export function CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner: number): return nativeResponseValue; } // struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -862,6 +960,7 @@ export function CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner: number) return nativeResponseValue; } // struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_HTLCUpdateDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -870,6 +969,7 @@ export function CResult_HTLCUpdateDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_HTLCUpdateDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -878,6 +978,7 @@ export function CResult_HTLCUpdateDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NoneNoneZ_get_ok(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -886,6 +987,7 @@ export function CResult_NoneNoneZ_get_ok(owner: number): void { // debug statements here } // void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NoneNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -894,6 +996,7 @@ export function CResult_NoneNoneZ_get_err(owner: number): void { // debug statements here } // struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_OutPointScriptZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -902,6 +1005,7 @@ export function C2Tuple_OutPointScriptZ_get_a(owner: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_OutPointScriptZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -910,6 +1014,7 @@ export function C2Tuple_OutPointScriptZ_get_b(owner: number): number { return nativeResponseValue; } // uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_u32ScriptZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -918,6 +1023,7 @@ export function C2Tuple_u32ScriptZ_get_a(owner: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_u32ScriptZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -926,6 +1032,7 @@ export function C2Tuple_u32ScriptZ_get_b(owner: number): number { return nativeResponseValue; } // struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -934,6 +1041,7 @@ export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner: number): numb return nativeResponseValue; } // struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -941,9 +1049,11 @@ export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner: number): numb const nativeResponseValue = wasm.TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner); return nativeResponseValue; } +/* @internal */ export class LDKPaymentPurpose { protected constructor() {} } +/* @internal */ export function LDKPaymentPurpose_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -951,6 +1061,7 @@ export function LDKPaymentPurpose_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKPaymentPurpose_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKPaymentPurpose_InvoicePayment_get_payment_preimage(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -958,6 +1069,7 @@ export function LDKPaymentPurpose_InvoicePayment_get_payment_preimage(ptr: numbe const nativeResponseValue = wasm.TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(ptr); return nativeResponseValue; } +/* @internal */ export function LDKPaymentPurpose_InvoicePayment_get_payment_secret(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -965,6 +1077,7 @@ export function LDKPaymentPurpose_InvoicePayment_get_payment_secret(ptr: number) const nativeResponseValue = wasm.TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret(ptr); return nativeResponseValue; } +/* @internal */ export function LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -972,9 +1085,11 @@ export function LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(ptr const nativeResponseValue = wasm.TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(ptr); return nativeResponseValue; } +/* @internal */ export class LDKCOption_u64Z { protected constructor() {} } +/* @internal */ export function LDKCOption_u64Z_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -982,6 +1097,7 @@ export function LDKCOption_u64Z_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_u64Z_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_u64Z_Some_get_some(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -989,9 +1105,11 @@ export function LDKCOption_u64Z_Some_get_some(ptr: number): bigint { const nativeResponseValue = wasm.TS_LDKCOption_u64Z_Some_get_some(ptr); return nativeResponseValue; } +/* @internal */ export class LDKNetworkUpdate { protected constructor() {} } +/* @internal */ export function LDKNetworkUpdate_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -999,6 +1117,7 @@ export function LDKNetworkUpdate_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKNetworkUpdate_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetworkUpdate_ChannelUpdateMessage_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1006,6 +1125,7 @@ export function LDKNetworkUpdate_ChannelUpdateMessage_get_msg(ptr: number): numb const nativeResponseValue = wasm.TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetworkUpdate_ChannelClosed_get_short_channel_id(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1013,6 +1133,7 @@ export function LDKNetworkUpdate_ChannelClosed_get_short_channel_id(ptr: number) const nativeResponseValue = wasm.TS_LDKNetworkUpdate_ChannelClosed_get_short_channel_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetworkUpdate_ChannelClosed_get_is_permanent(ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1020,6 +1141,7 @@ export function LDKNetworkUpdate_ChannelClosed_get_is_permanent(ptr: number): bo const nativeResponseValue = wasm.TS_LDKNetworkUpdate_ChannelClosed_get_is_permanent(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetworkUpdate_NodeFailure_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1027,6 +1149,7 @@ export function LDKNetworkUpdate_NodeFailure_get_node_id(ptr: number): number { const nativeResponseValue = wasm.TS_LDKNetworkUpdate_NodeFailure_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetworkUpdate_NodeFailure_get_is_permanent(ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1034,9 +1157,11 @@ export function LDKNetworkUpdate_NodeFailure_get_is_permanent(ptr: number): bool const nativeResponseValue = wasm.TS_LDKNetworkUpdate_NodeFailure_get_is_permanent(ptr); return nativeResponseValue; } +/* @internal */ export class LDKCOption_NetworkUpdateZ { protected constructor() {} } +/* @internal */ export function LDKCOption_NetworkUpdateZ_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1044,6 +1169,7 @@ export function LDKCOption_NetworkUpdateZ_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_NetworkUpdateZ_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_NetworkUpdateZ_Some_get_some(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1051,9 +1177,11 @@ export function LDKCOption_NetworkUpdateZ_Some_get_some(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_NetworkUpdateZ_Some_get_some(ptr); return nativeResponseValue; } +/* @internal */ export class LDKSpendableOutputDescriptor { protected constructor() {} } +/* @internal */ export function LDKSpendableOutputDescriptor_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1061,6 +1189,7 @@ export function LDKSpendableOutputDescriptor_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKSpendableOutputDescriptor_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKSpendableOutputDescriptor_StaticOutput_get_outpoint(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1068,6 +1197,7 @@ export function LDKSpendableOutputDescriptor_StaticOutput_get_outpoint(ptr: numb const nativeResponseValue = wasm.TS_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint(ptr); return nativeResponseValue; } +/* @internal */ export function LDKSpendableOutputDescriptor_StaticOutput_get_output(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1075,6 +1205,7 @@ export function LDKSpendableOutputDescriptor_StaticOutput_get_output(ptr: number const nativeResponseValue = wasm.TS_LDKSpendableOutputDescriptor_StaticOutput_get_output(ptr); return nativeResponseValue; } +/* @internal */ export function LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1082,6 +1213,7 @@ export function LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_pa const nativeResponseValue = wasm.TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(ptr); return nativeResponseValue; } +/* @internal */ export function LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1089,9 +1221,11 @@ export function LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_paym const nativeResponseValue = wasm.TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output(ptr); return nativeResponseValue; } +/* @internal */ export class LDKClosureReason { protected constructor() {} } +/* @internal */ export function LDKClosureReason_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1099,6 +1233,7 @@ export function LDKClosureReason_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKClosureReason_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKClosureReason_CounterpartyForceClosed_get_peer_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1106,6 +1241,7 @@ export function LDKClosureReason_CounterpartyForceClosed_get_peer_msg(ptr: numbe const nativeResponseValue = wasm.TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKClosureReason_ProcessingError_get_err(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1113,9 +1249,11 @@ export function LDKClosureReason_ProcessingError_get_err(ptr: number): number { const nativeResponseValue = wasm.TS_LDKClosureReason_ProcessingError_get_err(ptr); return nativeResponseValue; } +/* @internal */ export class LDKEvent { protected constructor() {} } +/* @internal */ export function LDKEvent_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1123,6 +1261,7 @@ export function LDKEvent_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_FundingGenerationReady_get_temporary_channel_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1130,6 +1269,7 @@ export function LDKEvent_FundingGenerationReady_get_temporary_channel_id(ptr: nu const nativeResponseValue = wasm.TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_FundingGenerationReady_get_channel_value_satoshis(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1137,6 +1277,7 @@ export function LDKEvent_FundingGenerationReady_get_channel_value_satoshis(ptr: const nativeResponseValue = wasm.TS_LDKEvent_FundingGenerationReady_get_channel_value_satoshis(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_FundingGenerationReady_get_output_script(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1144,6 +1285,7 @@ export function LDKEvent_FundingGenerationReady_get_output_script(ptr: number): const nativeResponseValue = wasm.TS_LDKEvent_FundingGenerationReady_get_output_script(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_FundingGenerationReady_get_user_channel_id(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1151,6 +1293,7 @@ export function LDKEvent_FundingGenerationReady_get_user_channel_id(ptr: number) const nativeResponseValue = wasm.TS_LDKEvent_FundingGenerationReady_get_user_channel_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentReceived_get_payment_hash(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1158,6 +1301,7 @@ export function LDKEvent_PaymentReceived_get_payment_hash(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_PaymentReceived_get_payment_hash(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentReceived_get_amt(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1165,6 +1309,7 @@ export function LDKEvent_PaymentReceived_get_amt(ptr: number): bigint { const nativeResponseValue = wasm.TS_LDKEvent_PaymentReceived_get_amt(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentReceived_get_purpose(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1172,6 +1317,7 @@ export function LDKEvent_PaymentReceived_get_purpose(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_PaymentReceived_get_purpose(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentSent_get_payment_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1179,6 +1325,7 @@ export function LDKEvent_PaymentSent_get_payment_id(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_PaymentSent_get_payment_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentSent_get_payment_preimage(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1186,6 +1333,7 @@ export function LDKEvent_PaymentSent_get_payment_preimage(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_PaymentSent_get_payment_preimage(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentSent_get_payment_hash(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1193,6 +1341,7 @@ export function LDKEvent_PaymentSent_get_payment_hash(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_PaymentSent_get_payment_hash(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentSent_get_fee_paid_msat(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1200,6 +1349,7 @@ export function LDKEvent_PaymentSent_get_fee_paid_msat(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_PaymentSent_get_fee_paid_msat(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentPathFailed_get_payment_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1207,6 +1357,7 @@ export function LDKEvent_PaymentPathFailed_get_payment_id(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_PaymentPathFailed_get_payment_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentPathFailed_get_payment_hash(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1214,6 +1365,7 @@ export function LDKEvent_PaymentPathFailed_get_payment_hash(ptr: number): number const nativeResponseValue = wasm.TS_LDKEvent_PaymentPathFailed_get_payment_hash(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentPathFailed_get_rejected_by_dest(ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1221,6 +1373,7 @@ export function LDKEvent_PaymentPathFailed_get_rejected_by_dest(ptr: number): bo const nativeResponseValue = wasm.TS_LDKEvent_PaymentPathFailed_get_rejected_by_dest(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentPathFailed_get_network_update(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1228,6 +1381,7 @@ export function LDKEvent_PaymentPathFailed_get_network_update(ptr: number): numb const nativeResponseValue = wasm.TS_LDKEvent_PaymentPathFailed_get_network_update(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentPathFailed_get_all_paths_failed(ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1235,6 +1389,7 @@ export function LDKEvent_PaymentPathFailed_get_all_paths_failed(ptr: number): bo const nativeResponseValue = wasm.TS_LDKEvent_PaymentPathFailed_get_all_paths_failed(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentPathFailed_get_path(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1242,6 +1397,7 @@ export function LDKEvent_PaymentPathFailed_get_path(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_PaymentPathFailed_get_path(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentPathFailed_get_short_channel_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1249,6 +1405,7 @@ export function LDKEvent_PaymentPathFailed_get_short_channel_id(ptr: number): nu const nativeResponseValue = wasm.TS_LDKEvent_PaymentPathFailed_get_short_channel_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentPathFailed_get_retry(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1256,6 +1413,7 @@ export function LDKEvent_PaymentPathFailed_get_retry(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_PaymentPathFailed_get_retry(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentFailed_get_payment_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1263,6 +1421,7 @@ export function LDKEvent_PaymentFailed_get_payment_id(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_PaymentFailed_get_payment_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentFailed_get_payment_hash(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1270,6 +1429,7 @@ export function LDKEvent_PaymentFailed_get_payment_hash(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_PaymentFailed_get_payment_hash(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PendingHTLCsForwardable_get_time_forwardable(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1277,6 +1437,7 @@ export function LDKEvent_PendingHTLCsForwardable_get_time_forwardable(ptr: numbe const nativeResponseValue = wasm.TS_LDKEvent_PendingHTLCsForwardable_get_time_forwardable(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_SpendableOutputs_get_outputs(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1284,6 +1445,7 @@ export function LDKEvent_SpendableOutputs_get_outputs(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_SpendableOutputs_get_outputs(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentForwarded_get_fee_earned_msat(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1291,6 +1453,7 @@ export function LDKEvent_PaymentForwarded_get_fee_earned_msat(ptr: number): numb const nativeResponseValue = wasm.TS_LDKEvent_PaymentForwarded_get_fee_earned_msat(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1298,6 +1461,7 @@ export function LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr: number) const nativeResponseValue = wasm.TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_ChannelClosed_get_channel_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1305,6 +1469,7 @@ export function LDKEvent_ChannelClosed_get_channel_id(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_ChannelClosed_get_channel_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_ChannelClosed_get_user_channel_id(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1312,6 +1477,7 @@ export function LDKEvent_ChannelClosed_get_user_channel_id(ptr: number): bigint const nativeResponseValue = wasm.TS_LDKEvent_ChannelClosed_get_user_channel_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_ChannelClosed_get_reason(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1319,6 +1485,7 @@ export function LDKEvent_ChannelClosed_get_reason(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_ChannelClosed_get_reason(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_DiscardFunding_get_channel_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1326,6 +1493,7 @@ export function LDKEvent_DiscardFunding_get_channel_id(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_DiscardFunding_get_channel_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_DiscardFunding_get_transaction(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1333,6 +1501,7 @@ export function LDKEvent_DiscardFunding_get_transaction(ptr: number): number { const nativeResponseValue = wasm.TS_LDKEvent_DiscardFunding_get_transaction(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentPathSuccessful_get_payment_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1340,6 +1509,7 @@ export function LDKEvent_PaymentPathSuccessful_get_payment_id(ptr: number): numb const nativeResponseValue = wasm.TS_LDKEvent_PaymentPathSuccessful_get_payment_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1347,6 +1517,7 @@ export function LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr: number): nu const nativeResponseValue = wasm.TS_LDKEvent_PaymentPathSuccessful_get_payment_hash(ptr); return nativeResponseValue; } +/* @internal */ export function LDKEvent_PaymentPathSuccessful_get_path(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1355,6 +1526,7 @@ export function LDKEvent_PaymentPathSuccessful_get_path(ptr: number): number { return nativeResponseValue; } // uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_usizeTransactionZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1363,6 +1535,7 @@ export function C2Tuple_usizeTransactionZ_get_a(owner: number): number { return nativeResponseValue; } // struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_usizeTransactionZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1371,6 +1544,7 @@ export function C2Tuple_usizeTransactionZ_get_b(owner: number): number { return nativeResponseValue; } // uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_u32TxOutZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1379,6 +1553,7 @@ export function C2Tuple_u32TxOutZ_get_a(owner: number): number { return nativeResponseValue; } // struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_u32TxOutZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1387,6 +1562,7 @@ export function C2Tuple_u32TxOutZ_get_b(owner: number): number { return nativeResponseValue; } // struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1395,6 +1571,7 @@ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner: number): numbe return nativeResponseValue; } // struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1402,9 +1579,11 @@ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner: number): numbe const nativeResponseValue = wasm.TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner); return nativeResponseValue; } +/* @internal */ export class LDKBalance { protected constructor() {} } +/* @internal */ export function LDKBalance_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1412,6 +1591,7 @@ export function LDKBalance_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKBalance_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1419,6 +1599,7 @@ export function LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis const nativeResponseValue = wasm.TS_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis(ptr); return nativeResponseValue; } +/* @internal */ export function LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1426,6 +1607,7 @@ export function LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_s const nativeResponseValue = wasm.TS_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis(ptr); return nativeResponseValue; } +/* @internal */ export function LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1433,6 +1615,7 @@ export function LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_heigh const nativeResponseValue = wasm.TS_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(ptr); return nativeResponseValue; } +/* @internal */ export function LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1440,6 +1623,7 @@ export function LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis(pt const nativeResponseValue = wasm.TS_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis(ptr); return nativeResponseValue; } +/* @internal */ export function LDKBalance_ContentiousClaimable_get_timeout_height(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1447,6 +1631,7 @@ export function LDKBalance_ContentiousClaimable_get_timeout_height(ptr: number): const nativeResponseValue = wasm.TS_LDKBalance_ContentiousClaimable_get_timeout_height(ptr); return nativeResponseValue; } +/* @internal */ export function LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_amount_satoshis(ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1454,6 +1639,7 @@ export function LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_amoun const nativeResponseValue = wasm.TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_amount_satoshis(ptr); return nativeResponseValue; } +/* @internal */ export function LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_height(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1462,6 +1648,7 @@ export function LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_heigh return nativeResponseValue; } // struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_SignatureCVec_SignatureZZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1470,6 +1657,7 @@ export function C2Tuple_SignatureCVec_SignatureZZ_get_a(owner: number): number { return nativeResponseValue; } // struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_SignatureCVec_SignatureZZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1478,6 +1666,7 @@ export function C2Tuple_SignatureCVec_SignatureZZ_get_b(owner: number): number { return nativeResponseValue; } // struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1486,6 +1675,7 @@ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner: num return nativeResponseValue; } // void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1494,6 +1684,7 @@ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner: nu // debug statements here } // struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_SignatureNoneZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1502,6 +1693,7 @@ export function CResult_SignatureNoneZ_get_ok(owner: number): number { return nativeResponseValue; } // void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_SignatureNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1509,11 +1701,7 @@ export function CResult_SignatureNoneZ_get_err(owner: number): void { const nativeResponseValue = wasm.TS_CResult_SignatureNoneZ_get_err(owner); // debug statements here } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKBaseSign { get_per_commitment_point (idx: bigint): number; release_commitment_secret (idx: bigint): number; @@ -1530,6 +1718,7 @@ export interface LDKBaseSign { ready_channel (channel_parameters: number): void; } +/* @internal */ export function LDKBaseSign_new(impl: LDKBaseSign, pubkeys: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1541,11 +1730,8 @@ export function LDKBaseSign_new(impl: LDKBaseSign, pubkeys: number): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKBaseSign_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // LDKPublicKey BaseSign_get_per_commitment_point LDKBaseSign *NONNULL_PTR this_arg, uint64_t idx +/* @internal */ export function BaseSign_get_per_commitment_point(this_arg: number, idx: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1554,6 +1740,7 @@ export function BaseSign_get_per_commitment_point(this_arg: number, idx: bigint) return nativeResponseValue; } // LDKThirtyTwoBytes BaseSign_release_commitment_secret LDKBaseSign *NONNULL_PTR this_arg, uint64_t idx +/* @internal */ export function BaseSign_release_commitment_secret(this_arg: number, idx: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1562,6 +1749,7 @@ export function BaseSign_release_commitment_secret(this_arg: number, idx: bigint return nativeResponseValue; } // LDKCResult_NoneNoneZ BaseSign_validate_holder_commitment LDKBaseSign *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx +/* @internal */ export function BaseSign_validate_holder_commitment(this_arg: number, holder_tx: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1570,6 +1758,7 @@ export function BaseSign_validate_holder_commitment(this_arg: number, holder_tx: return nativeResponseValue; } // LDKThirtyTwoBytes BaseSign_channel_keys_id LDKBaseSign *NONNULL_PTR this_arg +/* @internal */ export function BaseSign_channel_keys_id(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1578,6 +1767,7 @@ export function BaseSign_channel_keys_id(this_arg: number): number { return nativeResponseValue; } // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ BaseSign_sign_counterparty_commitment LDKBaseSign *NONNULL_PTR this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx +/* @internal */ export function BaseSign_sign_counterparty_commitment(this_arg: number, commitment_tx: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1586,6 +1776,7 @@ export function BaseSign_sign_counterparty_commitment(this_arg: number, commitme return nativeResponseValue; } // LDKCResult_NoneNoneZ BaseSign_validate_counterparty_revocation LDKBaseSign *NONNULL_PTR this_arg, uint64_t idx, const uint8_t (*secret)[32] +/* @internal */ export function BaseSign_validate_counterparty_revocation(this_arg: number, idx: bigint, secret: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1594,6 +1785,7 @@ export function BaseSign_validate_counterparty_revocation(this_arg: number, idx: return nativeResponseValue; } // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ BaseSign_sign_holder_commitment_and_htlcs LDKBaseSign *NONNULL_PTR this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx +/* @internal */ export function BaseSign_sign_holder_commitment_and_htlcs(this_arg: number, commitment_tx: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1602,6 +1794,7 @@ export function BaseSign_sign_holder_commitment_and_htlcs(this_arg: number, comm return nativeResponseValue; } // LDKCResult_SignatureNoneZ BaseSign_sign_justice_revoked_output LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32] +/* @internal */ export function BaseSign_sign_justice_revoked_output(this_arg: number, justice_tx: number, input: number, amount: bigint, per_commitment_key: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1610,6 +1803,7 @@ export function BaseSign_sign_justice_revoked_output(this_arg: number, justice_t return nativeResponseValue; } // LDKCResult_SignatureNoneZ BaseSign_sign_justice_revoked_htlc LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc +/* @internal */ export function BaseSign_sign_justice_revoked_htlc(this_arg: number, justice_tx: number, input: number, amount: bigint, per_commitment_key: number, htlc: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1618,6 +1812,7 @@ export function BaseSign_sign_justice_revoked_htlc(this_arg: number, justice_tx: return nativeResponseValue; } // LDKCResult_SignatureNoneZ BaseSign_sign_counterparty_htlc_transaction LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc +/* @internal */ export function BaseSign_sign_counterparty_htlc_transaction(this_arg: number, htlc_tx: number, input: number, amount: bigint, per_commitment_point: number, htlc: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1626,6 +1821,7 @@ export function BaseSign_sign_counterparty_htlc_transaction(this_arg: number, ht return nativeResponseValue; } // LDKCResult_SignatureNoneZ BaseSign_sign_closing_transaction LDKBaseSign *NONNULL_PTR this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx +/* @internal */ export function BaseSign_sign_closing_transaction(this_arg: number, closing_tx: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1634,6 +1830,7 @@ export function BaseSign_sign_closing_transaction(this_arg: number, closing_tx: return nativeResponseValue; } // LDKCResult_SignatureNoneZ BaseSign_sign_channel_announcement LDKBaseSign *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg +/* @internal */ export function BaseSign_sign_channel_announcement(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1642,6 +1839,7 @@ export function BaseSign_sign_channel_announcement(this_arg: number, msg: number return nativeResponseValue; } // void BaseSign_ready_channel LDKBaseSign *NONNULL_PTR this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters +/* @internal */ export function BaseSign_ready_channel(this_arg: number, channel_parameters: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1650,6 +1848,7 @@ export function BaseSign_ready_channel(this_arg: number, channel_parameters: num // debug statements here } // LDKChannelPublicKeys BaseSign_get_pubkeys LDKBaseSign *NONNULL_PTR this_arg +/* @internal */ export function BaseSign_get_pubkeys(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1657,15 +1856,12 @@ export function BaseSign_get_pubkeys(this_arg: number): number { const nativeResponseValue = wasm.TS_BaseSign_get_pubkeys(this_arg); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKSign { write (): number; } +/* @internal */ export function LDKSign_new(impl: LDKSign, BaseSign: LDKBaseSign, pubkeys: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1677,11 +1873,8 @@ export function LDKSign_new(impl: LDKSign, BaseSign: LDKBaseSign, pubkeys: numbe js_objs[i] = new WeakRef(impl); return wasm.TS_LDKSign_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // LDKCVec_u8Z Sign_write LDKSign *NONNULL_PTR this_arg +/* @internal */ export function Sign_write(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1690,6 +1883,7 @@ export function Sign_write(this_arg: number): number { return nativeResponseValue; } // struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_BlockHashChannelMonitorZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1698,6 +1892,7 @@ export function C2Tuple_BlockHashChannelMonitorZ_get_a(owner: number): number { return nativeResponseValue; } // struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_BlockHashChannelMonitorZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1706,6 +1901,7 @@ export function C2Tuple_BlockHashChannelMonitorZ_get_b(owner: number): number { return nativeResponseValue; } // struct LDKC2Tuple_BlockHashChannelMonitorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1714,6 +1910,7 @@ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owne return nativeResponseValue; } // struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1722,6 +1919,7 @@ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(own return nativeResponseValue; } // struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteHopDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1730,6 +1928,7 @@ export function CResult_RouteHopDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteHopDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1738,6 +1937,7 @@ export function CResult_RouteHopDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1746,6 +1946,7 @@ export function CResult_RouteDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1754,6 +1955,7 @@ export function CResult_RouteDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteParametersDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1762,6 +1964,7 @@ export function CResult_RouteParametersDecodeErrorZ_get_ok(owner: number): numbe return nativeResponseValue; } // struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteParametersDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1770,6 +1973,7 @@ export function CResult_RouteParametersDecodeErrorZ_get_err(owner: number): numb return nativeResponseValue; } // struct LDKPayee CResult_PayeeDecodeErrorZ_get_ok(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PayeeDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1778,6 +1982,7 @@ export function CResult_PayeeDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_PayeeDecodeErrorZ_get_err(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PayeeDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1786,6 +1991,7 @@ export function CResult_PayeeDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteHintDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1794,6 +2000,7 @@ export function CResult_RouteHintDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteHintDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1802,6 +2009,7 @@ export function CResult_RouteHintDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKRouteHintHop CResult_RouteHintHopDecodeErrorZ_get_ok(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteHintHopDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1810,6 +2018,7 @@ export function CResult_RouteHintHopDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteHintHopDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1818,6 +2027,7 @@ export function CResult_RouteHintHopDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteLightningErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1826,6 +2036,7 @@ export function CResult_RouteLightningErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RouteLightningErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1834,6 +2045,7 @@ export function CResult_RouteLightningErrorZ_get_err(owner: number): number { return nativeResponseValue; } // void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NoneLightningErrorZ_get_ok(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1842,6 +2054,7 @@ export function CResult_NoneLightningErrorZ_get_ok(owner: number): void { // debug statements here } // struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NoneLightningErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1850,6 +2063,7 @@ export function CResult_NoneLightningErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_PublicKeyTypeZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1858,6 +2072,7 @@ export function C2Tuple_PublicKeyTypeZ_get_a(owner: number): number { return nativeResponseValue; } // struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_PublicKeyTypeZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1865,9 +2080,11 @@ export function C2Tuple_PublicKeyTypeZ_get_b(owner: number): number { const nativeResponseValue = wasm.TS_C2Tuple_PublicKeyTypeZ_get_b(owner); return nativeResponseValue; } +/* @internal */ export class LDKErrorAction { protected constructor() {} } +/* @internal */ export function LDKErrorAction_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1875,6 +2092,7 @@ export function LDKErrorAction_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKErrorAction_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKErrorAction_DisconnectPeer_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1882,6 +2100,7 @@ export function LDKErrorAction_DisconnectPeer_get_msg(ptr: number): number { const nativeResponseValue = wasm.TS_LDKErrorAction_DisconnectPeer_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKErrorAction_IgnoreAndLog_get_ignore_and_log(ptr: number): Level { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1889,6 +2108,7 @@ export function LDKErrorAction_IgnoreAndLog_get_ignore_and_log(ptr: number): Lev const nativeResponseValue = wasm.TS_LDKErrorAction_IgnoreAndLog_get_ignore_and_log(ptr); return nativeResponseValue; } +/* @internal */ export function LDKErrorAction_SendErrorMessage_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1896,9 +2116,11 @@ export function LDKErrorAction_SendErrorMessage_get_msg(ptr: number): number { const nativeResponseValue = wasm.TS_LDKErrorAction_SendErrorMessage_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export class LDKMessageSendEvent { protected constructor() {} } +/* @internal */ export function LDKMessageSendEvent_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1906,6 +2128,7 @@ export function LDKMessageSendEvent_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKMessageSendEvent_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendAcceptChannel_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1913,6 +2136,7 @@ export function LDKMessageSendEvent_SendAcceptChannel_get_node_id(ptr: number): const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendAcceptChannel_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1920,6 +2144,7 @@ export function LDKMessageSendEvent_SendAcceptChannel_get_msg(ptr: number): numb const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendAcceptChannel_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendOpenChannel_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1927,6 +2152,7 @@ export function LDKMessageSendEvent_SendOpenChannel_get_node_id(ptr: number): nu const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendOpenChannel_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendOpenChannel_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1934,6 +2160,7 @@ export function LDKMessageSendEvent_SendOpenChannel_get_msg(ptr: number): number const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendOpenChannel_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendFundingCreated_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1941,6 +2168,7 @@ export function LDKMessageSendEvent_SendFundingCreated_get_node_id(ptr: number): const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendFundingCreated_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendFundingCreated_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1948,6 +2176,7 @@ export function LDKMessageSendEvent_SendFundingCreated_get_msg(ptr: number): num const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendFundingCreated_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendFundingSigned_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1955,6 +2184,7 @@ export function LDKMessageSendEvent_SendFundingSigned_get_node_id(ptr: number): const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendFundingSigned_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendFundingSigned_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1962,6 +2192,7 @@ export function LDKMessageSendEvent_SendFundingSigned_get_msg(ptr: number): numb const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendFundingSigned_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendFundingLocked_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1969,6 +2200,7 @@ export function LDKMessageSendEvent_SendFundingLocked_get_node_id(ptr: number): const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendFundingLocked_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendFundingLocked_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1976,6 +2208,7 @@ export function LDKMessageSendEvent_SendFundingLocked_get_msg(ptr: number): numb const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendFundingLocked_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1983,6 +2216,7 @@ export function LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(ptr: const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1990,6 +2224,7 @@ export function LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(ptr: numb const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_UpdateHTLCs_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -1997,6 +2232,7 @@ export function LDKMessageSendEvent_UpdateHTLCs_get_node_id(ptr: number): number const nativeResponseValue = wasm.TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_UpdateHTLCs_get_updates(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2004,6 +2240,7 @@ export function LDKMessageSendEvent_UpdateHTLCs_get_updates(ptr: number): number const nativeResponseValue = wasm.TS_LDKMessageSendEvent_UpdateHTLCs_get_updates(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendRevokeAndACK_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2011,6 +2248,7 @@ export function LDKMessageSendEvent_SendRevokeAndACK_get_node_id(ptr: number): n const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendRevokeAndACK_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2018,6 +2256,7 @@ export function LDKMessageSendEvent_SendRevokeAndACK_get_msg(ptr: number): numbe const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendRevokeAndACK_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendClosingSigned_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2025,6 +2264,7 @@ export function LDKMessageSendEvent_SendClosingSigned_get_node_id(ptr: number): const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendClosingSigned_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendClosingSigned_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2032,6 +2272,7 @@ export function LDKMessageSendEvent_SendClosingSigned_get_msg(ptr: number): numb const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendClosingSigned_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendShutdown_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2039,6 +2280,7 @@ export function LDKMessageSendEvent_SendShutdown_get_node_id(ptr: number): numbe const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendShutdown_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendShutdown_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2046,6 +2288,7 @@ export function LDKMessageSendEvent_SendShutdown_get_msg(ptr: number): number { const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendShutdown_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendChannelReestablish_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2053,6 +2296,7 @@ export function LDKMessageSendEvent_SendChannelReestablish_get_node_id(ptr: numb const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendChannelReestablish_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2060,6 +2304,7 @@ export function LDKMessageSendEvent_SendChannelReestablish_get_msg(ptr: number): const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendChannelReestablish_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2067,6 +2312,7 @@ export function LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(ptr: nu const nativeResponseValue = wasm.TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2074,6 +2320,7 @@ export function LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg( const nativeResponseValue = wasm.TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2081,6 +2328,7 @@ export function LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(ptr: numbe const nativeResponseValue = wasm.TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2088,6 +2336,7 @@ export function LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(ptr: number): const nativeResponseValue = wasm.TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendChannelUpdate_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2095,6 +2344,7 @@ export function LDKMessageSendEvent_SendChannelUpdate_get_node_id(ptr: number): const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendChannelUpdate_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2102,6 +2352,7 @@ export function LDKMessageSendEvent_SendChannelUpdate_get_msg(ptr: number): numb const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendChannelUpdate_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_HandleError_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2109,6 +2360,7 @@ export function LDKMessageSendEvent_HandleError_get_node_id(ptr: number): number const nativeResponseValue = wasm.TS_LDKMessageSendEvent_HandleError_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_HandleError_get_action(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2116,6 +2368,7 @@ export function LDKMessageSendEvent_HandleError_get_action(ptr: number): number const nativeResponseValue = wasm.TS_LDKMessageSendEvent_HandleError_get_action(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2123,6 +2376,7 @@ export function LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(ptr: numbe const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendChannelRangeQuery_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2130,6 +2384,7 @@ export function LDKMessageSendEvent_SendChannelRangeQuery_get_msg(ptr: number): const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendChannelRangeQuery_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendShortIdsQuery_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2137,6 +2392,7 @@ export function LDKMessageSendEvent_SendShortIdsQuery_get_node_id(ptr: number): const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendShortIdsQuery_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2144,6 +2400,7 @@ export function LDKMessageSendEvent_SendShortIdsQuery_get_msg(ptr: number): numb const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendShortIdsQuery_get_msg(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendReplyChannelRange_get_node_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2151,6 +2408,7 @@ export function LDKMessageSendEvent_SendReplyChannelRange_get_node_id(ptr: numbe const nativeResponseValue = wasm.TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id(ptr); return nativeResponseValue; } +/* @internal */ export function LDKMessageSendEvent_SendReplyChannelRange_get_msg(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2159,6 +2417,7 @@ export function LDKMessageSendEvent_SendReplyChannelRange_get_msg(ptr: number): return nativeResponseValue; } // bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_boolLightningErrorZ_get_ok(owner: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2167,6 +2426,7 @@ export function CResult_boolLightningErrorZ_get_ok(owner: number): boolean { return nativeResponseValue; } // struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_boolLightningErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2175,6 +2435,7 @@ export function CResult_boolLightningErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); +/* @internal */ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2183,6 +2444,7 @@ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(own return nativeResponseValue; } // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); +/* @internal */ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2191,6 +2453,7 @@ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(own return nativeResponseValue; } // struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner); +/* @internal */ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2199,6 +2462,7 @@ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(own return nativeResponseValue; } // struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2207,6 +2471,7 @@ export function CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2215,6 +2480,7 @@ export function CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner: number): number return nativeResponseValue; } // void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NonePeerHandleErrorZ_get_ok(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2223,6 +2489,7 @@ export function CResult_NonePeerHandleErrorZ_get_ok(owner: number): void { // debug statements here } // struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NonePeerHandleErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2231,6 +2498,7 @@ export function CResult_NonePeerHandleErrorZ_get_err(owner: number): number { return nativeResponseValue; } // bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_boolPeerHandleErrorZ_get_ok(owner: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2239,6 +2507,7 @@ export function CResult_boolPeerHandleErrorZ_get_ok(owner: number): boolean { return nativeResponseValue; } // struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_boolPeerHandleErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2247,6 +2516,7 @@ export function CResult_boolPeerHandleErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TxOutAccessErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2255,6 +2525,7 @@ export function CResult_TxOutAccessErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TxOutAccessErrorZ_get_err(owner: number): AccessError { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2263,6 +2534,7 @@ export function CResult_TxOutAccessErrorZ_get_err(owner: number): AccessError { return nativeResponseValue; } // void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2271,6 +2543,7 @@ export function CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner: number): void // debug statements here } // enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NoneChannelMonitorUpdateErrZ_get_err(owner: number): ChannelMonitorUpdateErr { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2278,9 +2551,11 @@ export function CResult_NoneChannelMonitorUpdateErrZ_get_err(owner: number): Cha const nativeResponseValue = wasm.TS_CResult_NoneChannelMonitorUpdateErrZ_get_err(owner); return nativeResponseValue; } +/* @internal */ export class LDKCOption_C2Tuple_usizeTransactionZZ { protected constructor() {} } +/* @internal */ export function LDKCOption_C2Tuple_usizeTransactionZZ_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2288,6 +2563,7 @@ export function LDKCOption_C2Tuple_usizeTransactionZZ_ty_from_ptr(ptr: number): const nativeResponseValue = wasm.TS_LDKCOption_C2Tuple_usizeTransactionZZ_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_C2Tuple_usizeTransactionZZ_Some_get_some(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2295,9 +2571,11 @@ export function LDKCOption_C2Tuple_usizeTransactionZZ_Some_get_some(ptr: number) const nativeResponseValue = wasm.TS_LDKCOption_C2Tuple_usizeTransactionZZ_Some_get_some(ptr); return nativeResponseValue; } +/* @internal */ export class LDKCOption_ClosureReasonZ { protected constructor() {} } +/* @internal */ export function LDKCOption_ClosureReasonZ_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2305,6 +2583,7 @@ export function LDKCOption_ClosureReasonZ_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_ClosureReasonZ_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_ClosureReasonZ_Some_get_some(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2313,6 +2592,7 @@ export function LDKCOption_ClosureReasonZ_Some_get_some(ptr: number): number { return nativeResponseValue; } // struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2321,6 +2601,7 @@ export function CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner: number) return nativeResponseValue; } // struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2328,9 +2609,11 @@ export function CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner: number const nativeResponseValue = wasm.TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner); return nativeResponseValue; } +/* @internal */ export class LDKCOption_EventZ { protected constructor() {} } +/* @internal */ export function LDKCOption_EventZ_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2338,6 +2621,7 @@ export function LDKCOption_EventZ_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_EventZ_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_EventZ_Some_get_some(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2346,6 +2630,7 @@ export function LDKCOption_EventZ_Some_get_some(ptr: number): number { return nativeResponseValue; } // struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_COption_EventZDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2354,6 +2639,7 @@ export function CResult_COption_EventZDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_COption_EventZDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2362,6 +2648,7 @@ export function CResult_COption_EventZDecodeErrorZ_get_err(owner: number): numbe return nativeResponseValue; } // struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NodeIdDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2370,6 +2657,7 @@ export function CResult_NodeIdDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NodeIdDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2378,6 +2666,7 @@ export function CResult_NodeIdDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2386,6 +2675,7 @@ export function CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner: number) return nativeResponseValue; } // struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2393,15 +2683,12 @@ export function CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner: number const nativeResponseValue = wasm.TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKAccess { get_utxo (genesis_hash: number, short_channel_id: bigint): number; } +/* @internal */ export function LDKAccess_new(impl: LDKAccess): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2413,11 +2700,8 @@ export function LDKAccess_new(impl: LDKAccess): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKAccess_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess *NONNULL_PTR this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id +/* @internal */ export function Access_get_utxo(this_arg: number, genesis_hash: number, short_channel_id: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2425,9 +2709,11 @@ export function Access_get_utxo(this_arg: number, genesis_hash: number, short_ch const nativeResponseValue = wasm.TS_Access_get_utxo(this_arg, genesis_hash, short_channel_id); return nativeResponseValue; } +/* @internal */ export class LDKCOption_AccessZ { protected constructor() {} } +/* @internal */ export function LDKCOption_AccessZ_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2435,6 +2721,7 @@ export function LDKCOption_AccessZ_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_AccessZ_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_AccessZ_Some_get_some(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2443,6 +2730,7 @@ export function LDKCOption_AccessZ_Some_get_some(ptr: number): number { return nativeResponseValue; } // struct LDKDirectionalChannelInfo CResult_DirectionalChannelInfoDecodeErrorZ_get_ok(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_DirectionalChannelInfoDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2451,6 +2739,7 @@ export function CResult_DirectionalChannelInfoDecodeErrorZ_get_ok(owner: number) return nativeResponseValue; } // struct LDKDecodeError CResult_DirectionalChannelInfoDecodeErrorZ_get_err(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_DirectionalChannelInfoDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2459,6 +2748,7 @@ export function CResult_DirectionalChannelInfoDecodeErrorZ_get_err(owner: number return nativeResponseValue; } // struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelInfoDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2467,6 +2757,7 @@ export function CResult_ChannelInfoDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelInfoDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2475,6 +2766,7 @@ export function CResult_ChannelInfoDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RoutingFeesDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2483,6 +2775,7 @@ export function CResult_RoutingFeesDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RoutingFeesDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2490,9 +2783,11 @@ export function CResult_RoutingFeesDecodeErrorZ_get_err(owner: number): number { const nativeResponseValue = wasm.TS_CResult_RoutingFeesDecodeErrorZ_get_err(owner); return nativeResponseValue; } +/* @internal */ export class LDKNetAddress { protected constructor() {} } +/* @internal */ export function LDKNetAddress_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2500,6 +2795,7 @@ export function LDKNetAddress_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKNetAddress_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetAddress_IPv4_get_addr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2507,6 +2803,7 @@ export function LDKNetAddress_IPv4_get_addr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKNetAddress_IPv4_get_addr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetAddress_IPv4_get_port(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2514,6 +2811,7 @@ export function LDKNetAddress_IPv4_get_port(ptr: number): number { const nativeResponseValue = wasm.TS_LDKNetAddress_IPv4_get_port(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetAddress_IPv6_get_addr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2521,6 +2819,7 @@ export function LDKNetAddress_IPv6_get_addr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKNetAddress_IPv6_get_addr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetAddress_IPv6_get_port(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2528,6 +2827,7 @@ export function LDKNetAddress_IPv6_get_port(ptr: number): number { const nativeResponseValue = wasm.TS_LDKNetAddress_IPv6_get_port(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetAddress_OnionV2_get_onion_v2(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2535,6 +2835,7 @@ export function LDKNetAddress_OnionV2_get_onion_v2(ptr: number): number { const nativeResponseValue = wasm.TS_LDKNetAddress_OnionV2_get_onion_v2(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetAddress_OnionV3_get_ed25519_pubkey(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2542,6 +2843,7 @@ export function LDKNetAddress_OnionV3_get_ed25519_pubkey(ptr: number): number { const nativeResponseValue = wasm.TS_LDKNetAddress_OnionV3_get_ed25519_pubkey(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetAddress_OnionV3_get_checksum(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2549,6 +2851,7 @@ export function LDKNetAddress_OnionV3_get_checksum(ptr: number): number { const nativeResponseValue = wasm.TS_LDKNetAddress_OnionV3_get_checksum(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetAddress_OnionV3_get_version(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2556,6 +2859,7 @@ export function LDKNetAddress_OnionV3_get_version(ptr: number): number { const nativeResponseValue = wasm.TS_LDKNetAddress_OnionV3_get_version(ptr); return nativeResponseValue; } +/* @internal */ export function LDKNetAddress_OnionV3_get_port(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2564,6 +2868,7 @@ export function LDKNetAddress_OnionV3_get_port(ptr: number): number { return nativeResponseValue; } // struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2572,6 +2877,7 @@ export function CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner: number): return nativeResponseValue; } // struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2580,6 +2886,7 @@ export function CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner: number): return nativeResponseValue; } // struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NodeInfoDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2588,6 +2895,7 @@ export function CResult_NodeInfoDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NodeInfoDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2596,6 +2904,7 @@ export function CResult_NodeInfoDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NetworkGraphDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2604,6 +2913,7 @@ export function CResult_NetworkGraphDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NetworkGraphDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2611,9 +2921,11 @@ export function CResult_NetworkGraphDecodeErrorZ_get_err(owner: number): number const nativeResponseValue = wasm.TS_CResult_NetworkGraphDecodeErrorZ_get_err(owner); return nativeResponseValue; } +/* @internal */ export class LDKCOption_CVec_NetAddressZZ { protected constructor() {} } +/* @internal */ export function LDKCOption_CVec_NetAddressZZ_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2621,6 +2933,7 @@ export function LDKCOption_CVec_NetAddressZZ_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_CVec_NetAddressZZ_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_CVec_NetAddressZZ_Some_get_some(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2629,6 +2942,7 @@ export function LDKCOption_CVec_NetAddressZZ_Some_get_some(ptr: number): number return nativeResponseValue; } // struct LDKScoringParameters *CResult_ScoringParametersDecodeErrorZ_get_ok(LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ScoringParametersDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2637,6 +2951,7 @@ export function CResult_ScoringParametersDecodeErrorZ_get_ok(owner: number): num return nativeResponseValue; } // struct LDKDecodeError CResult_ScoringParametersDecodeErrorZ_get_err(LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ScoringParametersDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2645,6 +2960,7 @@ export function CResult_ScoringParametersDecodeErrorZ_get_err(owner: number): nu return nativeResponseValue; } // struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_InitFeaturesDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2653,6 +2969,7 @@ export function CResult_InitFeaturesDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_InitFeaturesDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2661,6 +2978,7 @@ export function CResult_InitFeaturesDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2669,6 +2987,7 @@ export function CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner: number): numbe return nativeResponseValue; } // struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelFeaturesDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2677,6 +2996,7 @@ export function CResult_ChannelFeaturesDecodeErrorZ_get_err(owner: number): numb return nativeResponseValue; } // struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NodeFeaturesDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2685,6 +3005,7 @@ export function CResult_NodeFeaturesDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NodeFeaturesDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2693,6 +3014,7 @@ export function CResult_NodeFeaturesDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_InvoiceFeaturesDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2701,6 +3023,7 @@ export function CResult_InvoiceFeaturesDecodeErrorZ_get_ok(owner: number): numbe return nativeResponseValue; } // struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2709,6 +3032,7 @@ export function CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner: number): numb return nativeResponseValue; } // struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2717,6 +3041,7 @@ export function CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner: number): n return nativeResponseValue; } // struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2725,6 +3050,7 @@ export function CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner: number): return nativeResponseValue; } // struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NetAddressDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2733,6 +3059,7 @@ export function CResult_NetAddressDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NetAddressDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2741,6 +3068,7 @@ export function CResult_NetAddressDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_AcceptChannelDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2749,6 +3077,7 @@ export function CResult_AcceptChannelDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_AcceptChannelDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2757,6 +3086,7 @@ export function CResult_AcceptChannelDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2765,6 +3095,7 @@ export function CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner: number) return nativeResponseValue; } // struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2773,6 +3104,7 @@ export function CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner: number return nativeResponseValue; } // struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelReestablishDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2781,6 +3113,7 @@ export function CResult_ChannelReestablishDecodeErrorZ_get_ok(owner: number): nu return nativeResponseValue; } // struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelReestablishDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2789,6 +3122,7 @@ export function CResult_ChannelReestablishDecodeErrorZ_get_err(owner: number): n return nativeResponseValue; } // struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ClosingSignedDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2797,6 +3131,7 @@ export function CResult_ClosingSignedDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ClosingSignedDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2805,6 +3140,7 @@ export function CResult_ClosingSignedDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2813,6 +3149,7 @@ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner: number): return nativeResponseValue; } // struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2821,6 +3158,7 @@ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner: number) return nativeResponseValue; } // struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CommitmentSignedDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2829,6 +3167,7 @@ export function CResult_CommitmentSignedDecodeErrorZ_get_ok(owner: number): numb return nativeResponseValue; } // struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CommitmentSignedDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2837,6 +3176,7 @@ export function CResult_CommitmentSignedDecodeErrorZ_get_err(owner: number): num return nativeResponseValue; } // struct LDKFundingCreated CResult_FundingCreatedDecodeErrorZ_get_ok(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_FundingCreatedDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2845,6 +3185,7 @@ export function CResult_FundingCreatedDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_FundingCreatedDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2853,6 +3194,7 @@ export function CResult_FundingCreatedDecodeErrorZ_get_err(owner: number): numbe return nativeResponseValue; } // struct LDKFundingSigned CResult_FundingSignedDecodeErrorZ_get_ok(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_FundingSignedDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2861,6 +3203,7 @@ export function CResult_FundingSignedDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_FundingSignedDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2869,6 +3212,7 @@ export function CResult_FundingSignedDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKFundingLocked CResult_FundingLockedDecodeErrorZ_get_ok(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_FundingLockedDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2877,6 +3221,7 @@ export function CResult_FundingLockedDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_FundingLockedDecodeErrorZ_get_err(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_FundingLockedDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2885,6 +3230,7 @@ export function CResult_FundingLockedDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKInit CResult_InitDecodeErrorZ_get_ok(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_InitDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2893,6 +3239,7 @@ export function CResult_InitDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_InitDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2901,6 +3248,7 @@ export function CResult_InitDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKOpenChannel CResult_OpenChannelDecodeErrorZ_get_ok(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_OpenChannelDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2909,6 +3257,7 @@ export function CResult_OpenChannelDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_OpenChannelDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2917,6 +3266,7 @@ export function CResult_OpenChannelDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKRevokeAndACK CResult_RevokeAndACKDecodeErrorZ_get_ok(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RevokeAndACKDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2925,6 +3275,7 @@ export function CResult_RevokeAndACKDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RevokeAndACKDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2933,6 +3284,7 @@ export function CResult_RevokeAndACKDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKShutdown CResult_ShutdownDecodeErrorZ_get_ok(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ShutdownDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2941,6 +3293,7 @@ export function CResult_ShutdownDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ShutdownDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2949,6 +3302,7 @@ export function CResult_ShutdownDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKUpdateFailHTLC CResult_UpdateFailHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2957,6 +3311,7 @@ export function CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2965,6 +3320,7 @@ export function CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner: number): numbe return nativeResponseValue; } // struct LDKUpdateFailMalformedHTLC CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2973,6 +3329,7 @@ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner: number return nativeResponseValue; } // struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2981,6 +3338,7 @@ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner: numbe return nativeResponseValue; } // struct LDKUpdateFee CResult_UpdateFeeDecodeErrorZ_get_ok(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UpdateFeeDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2989,6 +3347,7 @@ export function CResult_UpdateFeeDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UpdateFeeDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -2997,6 +3356,7 @@ export function CResult_UpdateFeeDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKUpdateFulfillHTLC CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3005,6 +3365,7 @@ export function CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner: number): num return nativeResponseValue; } // struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3013,6 +3374,7 @@ export function CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner: number): nu return nativeResponseValue; } // struct LDKUpdateAddHTLC CResult_UpdateAddHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3021,6 +3383,7 @@ export function CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3029,6 +3392,7 @@ export function CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PingDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3037,6 +3401,7 @@ export function CResult_PingDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PingDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3045,6 +3410,7 @@ export function CResult_PingDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKPong CResult_PongDecodeErrorZ_get_ok(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PongDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3053,6 +3419,7 @@ export function CResult_PongDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PongDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3061,6 +3428,7 @@ export function CResult_PongDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKUnsignedChannelAnnouncement CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3069,6 +3437,7 @@ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner: nu return nativeResponseValue; } // struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3077,6 +3446,7 @@ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner: n return nativeResponseValue; } // struct LDKChannelAnnouncement CResult_ChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3085,6 +3455,7 @@ export function CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner: number): n return nativeResponseValue; } // struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3093,6 +3464,7 @@ export function CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner: number): return nativeResponseValue; } // struct LDKUnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3101,6 +3473,7 @@ export function CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner: number): return nativeResponseValue; } // struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3109,6 +3482,7 @@ export function CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner: number) return nativeResponseValue; } // struct LDKChannelUpdate CResult_ChannelUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelUpdateDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3117,6 +3491,7 @@ export function CResult_ChannelUpdateDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ChannelUpdateDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3125,6 +3500,7 @@ export function CResult_ChannelUpdateDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKErrorMessage CResult_ErrorMessageDecodeErrorZ_get_ok(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ErrorMessageDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3133,6 +3509,7 @@ export function CResult_ErrorMessageDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ErrorMessageDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3141,6 +3518,7 @@ export function CResult_ErrorMessageDecodeErrorZ_get_err(owner: number): number return nativeResponseValue; } // struct LDKUnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3149,6 +3527,7 @@ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner: numbe return nativeResponseValue; } // struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3157,6 +3536,7 @@ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner: numb return nativeResponseValue; } // struct LDKNodeAnnouncement CResult_NodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3165,6 +3545,7 @@ export function CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner: number): numb return nativeResponseValue; } // struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NodeAnnouncementDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3173,6 +3554,7 @@ export function CResult_NodeAnnouncementDecodeErrorZ_get_err(owner: number): num return nativeResponseValue; } // struct LDKQueryShortChannelIds CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3181,6 +3563,7 @@ export function CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner: number): return nativeResponseValue; } // struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3189,6 +3572,7 @@ export function CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner: number): return nativeResponseValue; } // struct LDKReplyShortChannelIdsEnd CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3197,6 +3581,7 @@ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner: number return nativeResponseValue; } // struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3205,6 +3590,7 @@ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner: numbe return nativeResponseValue; } // struct LDKQueryChannelRange CResult_QueryChannelRangeDecodeErrorZ_get_ok(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3213,6 +3599,7 @@ export function CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner: number): num return nativeResponseValue; } // struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_QueryChannelRangeDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3221,6 +3608,7 @@ export function CResult_QueryChannelRangeDecodeErrorZ_get_err(owner: number): nu return nativeResponseValue; } // struct LDKReplyChannelRange CResult_ReplyChannelRangeDecodeErrorZ_get_ok(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3229,6 +3617,7 @@ export function CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner: number): num return nativeResponseValue; } // struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3237,6 +3626,7 @@ export function CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner: number): nu return nativeResponseValue; } // struct LDKGossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_get_ok(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3245,6 +3635,7 @@ export function CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner: number): return nativeResponseValue; } // struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3253,6 +3644,7 @@ export function CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner: number) return nativeResponseValue; } // struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3261,6 +3653,7 @@ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner: return nativeResponseValue; } // struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3269,6 +3662,7 @@ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner return nativeResponseValue; } // struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3277,6 +3671,7 @@ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner: return nativeResponseValue; } // struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3285,6 +3680,7 @@ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner: return nativeResponseValue; } // struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3293,6 +3689,7 @@ export function CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner: numb return nativeResponseValue; } // struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3301,6 +3698,7 @@ export function CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner: num return nativeResponseValue; } // struct LDKSign CResult_SignDecodeErrorZ_get_ok(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_SignDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3309,6 +3707,7 @@ export function CResult_SignDecodeErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_SignDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3317,6 +3716,7 @@ export function CResult_SignDecodeErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RecoverableSignatureNoneZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3325,6 +3725,7 @@ export function CResult_RecoverableSignatureNoneZ_get_ok(owner: number): number return nativeResponseValue; } // void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_RecoverableSignatureNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3333,6 +3734,7 @@ export function CResult_RecoverableSignatureNoneZ_get_err(owner: number): void { // debug statements here } // struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3341,6 +3743,7 @@ export function CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner: number): number { return nativeResponseValue; } // void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_CVec_CVec_u8ZZNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3349,6 +3752,7 @@ export function CResult_CVec_CVec_u8ZZNoneZ_get_err(owner: number): void { // debug statements here } // struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_InMemorySignerDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3357,6 +3761,7 @@ export function CResult_InMemorySignerDecodeErrorZ_get_ok(owner: number): number return nativeResponseValue; } // struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_InMemorySignerDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3365,6 +3770,7 @@ export function CResult_InMemorySignerDecodeErrorZ_get_err(owner: number): numbe return nativeResponseValue; } // struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TransactionNoneZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3373,6 +3779,7 @@ export function CResult_TransactionNoneZ_get_ok(owner: number): number { return nativeResponseValue; } // void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_TransactionNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3380,16 +3787,13 @@ export function CResult_TransactionNoneZ_get_err(owner: number): void { const nativeResponseValue = wasm.TS_CResult_TransactionNoneZ_get_err(owner); // debug statements here } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKFilter { register_tx (txid: number, script_pubkey: number): void; register_output (output: number): number; } +/* @internal */ export function LDKFilter_new(impl: LDKFilter): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3401,11 +3805,8 @@ export function LDKFilter_new(impl: LDKFilter): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKFilter_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // void Filter_register_tx LDKFilter *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey +/* @internal */ export function Filter_register_tx(this_arg: number, txid: number, script_pubkey: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3414,6 +3815,7 @@ export function Filter_register_tx(this_arg: number, txid: number, script_pubkey // debug statements here } // LDKCOption_C2Tuple_usizeTransactionZZ Filter_register_output LDKFilter *NONNULL_PTR this_arg, struct LDKWatchedOutput output +/* @internal */ export function Filter_register_output(this_arg: number, output: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3421,9 +3823,11 @@ export function Filter_register_output(this_arg: number, output: number): number const nativeResponseValue = wasm.TS_Filter_register_output(this_arg, output); return nativeResponseValue; } +/* @internal */ export class LDKCOption_FilterZ { protected constructor() {} } +/* @internal */ export function LDKCOption_FilterZ_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3431,6 +3835,7 @@ export function LDKCOption_FilterZ_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_FilterZ_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_FilterZ_Some_get_some(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3439,6 +3844,7 @@ export function LDKCOption_FilterZ_Some_get_some(ptr: number): number { return nativeResponseValue; } // struct LDKLockedChannelMonitor *CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_LockedChannelMonitorNoneZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3447,6 +3853,7 @@ export function CResult_LockedChannelMonitorNoneZ_get_ok(owner: number): number return nativeResponseValue; } // void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_LockedChannelMonitorNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3454,9 +3861,11 @@ export function CResult_LockedChannelMonitorNoneZ_get_err(owner: number): void { const nativeResponseValue = wasm.TS_CResult_LockedChannelMonitorNoneZ_get_err(owner); // debug statements here } +/* @internal */ export class LDKAPIError { protected constructor() {} } +/* @internal */ export function LDKAPIError_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3464,6 +3873,7 @@ export function LDKAPIError_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKAPIError_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKAPIError_APIMisuseError_get_err(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3471,6 +3881,7 @@ export function LDKAPIError_APIMisuseError_get_err(ptr: number): number { const nativeResponseValue = wasm.TS_LDKAPIError_APIMisuseError_get_err(ptr); return nativeResponseValue; } +/* @internal */ export function LDKAPIError_FeeRateTooHigh_get_err(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3478,6 +3889,7 @@ export function LDKAPIError_FeeRateTooHigh_get_err(ptr: number): number { const nativeResponseValue = wasm.TS_LDKAPIError_FeeRateTooHigh_get_err(ptr); return nativeResponseValue; } +/* @internal */ export function LDKAPIError_FeeRateTooHigh_get_feerate(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3485,6 +3897,7 @@ export function LDKAPIError_FeeRateTooHigh_get_feerate(ptr: number): number { const nativeResponseValue = wasm.TS_LDKAPIError_FeeRateTooHigh_get_feerate(ptr); return nativeResponseValue; } +/* @internal */ export function LDKAPIError_RouteError_get_err(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3492,6 +3905,7 @@ export function LDKAPIError_RouteError_get_err(ptr: number): number { const nativeResponseValue = wasm.TS_LDKAPIError_RouteError_get_err(ptr); return nativeResponseValue; } +/* @internal */ export function LDKAPIError_ChannelUnavailable_get_err(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3499,6 +3913,7 @@ export function LDKAPIError_ChannelUnavailable_get_err(ptr: number): number { const nativeResponseValue = wasm.TS_LDKAPIError_ChannelUnavailable_get_err(ptr); return nativeResponseValue; } +/* @internal */ export function LDKAPIError_IncompatibleShutdownScript_get_script(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3507,6 +3922,7 @@ export function LDKAPIError_IncompatibleShutdownScript_get_script(ptr: number): return nativeResponseValue; } // void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NoneAPIErrorZ_get_ok(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3515,6 +3931,7 @@ export function CResult_NoneAPIErrorZ_get_ok(owner: number): void { // debug statements here } // struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NoneAPIErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3522,9 +3939,11 @@ export function CResult_NoneAPIErrorZ_get_err(owner: number): number { const nativeResponseValue = wasm.TS_CResult_NoneAPIErrorZ_get_err(owner); return nativeResponseValue; } +/* @internal */ export class LDKCOption_u16Z { protected constructor() {} } +/* @internal */ export function LDKCOption_u16Z_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3532,6 +3951,7 @@ export function LDKCOption_u16Z_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKCOption_u16Z_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKCOption_u16Z_Some_get_some(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3540,6 +3960,7 @@ export function LDKCOption_u16Z_Some_get_some(ptr: number): number { return nativeResponseValue; } // struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult__u832APIErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3548,6 +3969,7 @@ export function CResult__u832APIErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKAPIError CResult__u832APIErrorZ_get_err(LDKCResult__u832APIErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult__u832APIErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3555,9 +3977,11 @@ export function CResult__u832APIErrorZ_get_err(owner: number): number { const nativeResponseValue = wasm.TS_CResult__u832APIErrorZ_get_err(owner); return nativeResponseValue; } +/* @internal */ export class LDKPaymentSendFailure { protected constructor() {} } +/* @internal */ export function LDKPaymentSendFailure_ty_from_ptr(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3565,6 +3989,7 @@ export function LDKPaymentSendFailure_ty_from_ptr(ptr: number): number { const nativeResponseValue = wasm.TS_LDKPaymentSendFailure_ty_from_ptr(ptr); return nativeResponseValue; } +/* @internal */ export function LDKPaymentSendFailure_ParameterError_get_parameter_error(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3572,6 +3997,7 @@ export function LDKPaymentSendFailure_ParameterError_get_parameter_error(ptr: nu const nativeResponseValue = wasm.TS_LDKPaymentSendFailure_ParameterError_get_parameter_error(ptr); return nativeResponseValue; } +/* @internal */ export function LDKPaymentSendFailure_PathParameterError_get_path_parameter_error(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3579,6 +4005,7 @@ export function LDKPaymentSendFailure_PathParameterError_get_path_parameter_erro const nativeResponseValue = wasm.TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error(ptr); return nativeResponseValue; } +/* @internal */ export function LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3586,6 +4013,7 @@ export function LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_sa const nativeResponseValue = wasm.TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe(ptr); return nativeResponseValue; } +/* @internal */ export function LDKPaymentSendFailure_PartialFailure_get_results(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3593,6 +4021,7 @@ export function LDKPaymentSendFailure_PartialFailure_get_results(ptr: number): n const nativeResponseValue = wasm.TS_LDKPaymentSendFailure_PartialFailure_get_results(ptr); return nativeResponseValue; } +/* @internal */ export function LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3600,6 +4029,7 @@ export function LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry(ptr: const nativeResponseValue = wasm.TS_LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry(ptr); return nativeResponseValue; } +/* @internal */ export function LDKPaymentSendFailure_PartialFailure_get_payment_id(ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3608,6 +4038,7 @@ export function LDKPaymentSendFailure_PartialFailure_get_payment_id(ptr: number) return nativeResponseValue; } // struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PaymentIdPaymentSendFailureZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3616,6 +4047,7 @@ export function CResult_PaymentIdPaymentSendFailureZ_get_ok(owner: number): numb return nativeResponseValue; } // struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PaymentIdPaymentSendFailureZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3624,6 +4056,7 @@ export function CResult_PaymentIdPaymentSendFailureZ_get_err(owner: number): num return nativeResponseValue; } // void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NonePaymentSendFailureZ_get_ok(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3632,6 +4065,7 @@ export function CResult_NonePaymentSendFailureZ_get_ok(owner: number): void { // debug statements here } // struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner); +/* @internal */ export function CResult_NonePaymentSendFailureZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3640,6 +4074,7 @@ export function CResult_NonePaymentSendFailureZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_PaymentHashPaymentIdZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3648,6 +4083,7 @@ export function C2Tuple_PaymentHashPaymentIdZ_get_a(owner: number): number { return nativeResponseValue; } // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_PaymentHashPaymentIdZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3656,6 +4092,7 @@ export function C2Tuple_PaymentHashPaymentIdZ_get_b(owner: number): number { return nativeResponseValue; } // struct LDKC2Tuple_PaymentHashPaymentIdZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3664,6 +4101,7 @@ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok( return nativeResponseValue; } // struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3672,6 +4110,7 @@ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err return nativeResponseValue; } // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_PaymentHashPaymentSecretZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3680,6 +4119,7 @@ export function C2Tuple_PaymentHashPaymentSecretZ_get_a(owner: number): number { return nativeResponseValue; } // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_PaymentHashPaymentSecretZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3688,6 +4128,7 @@ export function C2Tuple_PaymentHashPaymentSecretZ_get_b(owner: number): number { return nativeResponseValue; } // struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3696,6 +4137,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner: num return nativeResponseValue; } // void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3704,6 +4146,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(owner: nu // debug statements here } // struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3712,6 +4155,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner: return nativeResponseValue; } // struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3720,6 +4164,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner return nativeResponseValue; } // struct LDKThirtyTwoBytes CResult_PaymentSecretNoneZ_get_ok(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PaymentSecretNoneZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3728,6 +4173,7 @@ export function CResult_PaymentSecretNoneZ_get_ok(owner: number): number { return nativeResponseValue; } // void CResult_PaymentSecretNoneZ_get_err(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PaymentSecretNoneZ_get_err(owner: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3736,6 +4182,7 @@ export function CResult_PaymentSecretNoneZ_get_err(owner: number): void { // debug statements here } // struct LDKThirtyTwoBytes CResult_PaymentSecretAPIErrorZ_get_ok(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PaymentSecretAPIErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3744,6 +4191,7 @@ export function CResult_PaymentSecretAPIErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKAPIError CResult_PaymentSecretAPIErrorZ_get_err(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PaymentSecretAPIErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3752,6 +4200,7 @@ export function CResult_PaymentSecretAPIErrorZ_get_err(owner: number): number { return nativeResponseValue; } // struct LDKThirtyTwoBytes CResult_PaymentPreimageAPIErrorZ_get_ok(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PaymentPreimageAPIErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3760,6 +4209,7 @@ export function CResult_PaymentPreimageAPIErrorZ_get_ok(owner: number): number { return nativeResponseValue; } // struct LDKAPIError CResult_PaymentPreimageAPIErrorZ_get_err(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_PaymentPreimageAPIErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3767,17 +4217,14 @@ export function CResult_PaymentPreimageAPIErrorZ_get_err(owner: number): number const nativeResponseValue = wasm.TS_CResult_PaymentPreimageAPIErrorZ_get_err(owner); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKWatch { watch_channel (funding_txo: number, monitor: number): number; update_channel (funding_txo: number, update: number): number; release_pending_monitor_events (): number; } +/* @internal */ export function LDKWatch_new(impl: LDKWatch): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3789,11 +4236,8 @@ export function LDKWatch_new(impl: LDKWatch): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKWatch_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_watch_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor +/* @internal */ export function Watch_watch_channel(this_arg: number, funding_txo: number, monitor: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3802,6 +4246,7 @@ export function Watch_watch_channel(this_arg: number, funding_txo: number, monit return nativeResponseValue; } // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_update_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update +/* @internal */ export function Watch_update_channel(this_arg: number, funding_txo: number, update: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3810,6 +4255,7 @@ export function Watch_update_channel(this_arg: number, funding_txo: number, upda return nativeResponseValue; } // LDKCVec_MonitorEventZ Watch_release_pending_monitor_events LDKWatch *NONNULL_PTR this_arg +/* @internal */ export function Watch_release_pending_monitor_events(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3817,15 +4263,12 @@ export function Watch_release_pending_monitor_events(this_arg: number): number { const nativeResponseValue = wasm.TS_Watch_release_pending_monitor_events(this_arg); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKBroadcasterInterface { broadcast_transaction (tx: number): void; } +/* @internal */ export function LDKBroadcasterInterface_new(impl: LDKBroadcasterInterface): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3837,11 +4280,8 @@ export function LDKBroadcasterInterface_new(impl: LDKBroadcasterInterface): numb js_objs[i] = new WeakRef(impl); return wasm.TS_LDKBroadcasterInterface_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // void BroadcasterInterface_broadcast_transaction LDKBroadcasterInterface *NONNULL_PTR this_arg, struct LDKTransaction tx +/* @internal */ export function BroadcasterInterface_broadcast_transaction(this_arg: number, tx: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3849,11 +4289,7 @@ export function BroadcasterInterface_broadcast_transaction(this_arg: number, tx: const nativeResponseValue = wasm.TS_BroadcasterInterface_broadcast_transaction(this_arg, tx); // debug statements here } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKKeysInterface { get_node_secret (): number; get_destination_script (): number; @@ -3865,6 +4301,7 @@ export interface LDKKeysInterface { get_inbound_payment_key_material (): number; } +/* @internal */ export function LDKKeysInterface_new(impl: LDKKeysInterface): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3876,11 +4313,8 @@ export function LDKKeysInterface_new(impl: LDKKeysInterface): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKKeysInterface_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // LDKSecretKey KeysInterface_get_node_secret LDKKeysInterface *NONNULL_PTR this_arg +/* @internal */ export function KeysInterface_get_node_secret(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3889,6 +4323,7 @@ export function KeysInterface_get_node_secret(this_arg: number): number { return nativeResponseValue; } // LDKCVec_u8Z KeysInterface_get_destination_script LDKKeysInterface *NONNULL_PTR this_arg +/* @internal */ export function KeysInterface_get_destination_script(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3897,6 +4332,7 @@ export function KeysInterface_get_destination_script(this_arg: number): number { return nativeResponseValue; } // LDKShutdownScript KeysInterface_get_shutdown_scriptpubkey LDKKeysInterface *NONNULL_PTR this_arg +/* @internal */ export function KeysInterface_get_shutdown_scriptpubkey(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3905,6 +4341,7 @@ export function KeysInterface_get_shutdown_scriptpubkey(this_arg: number): numbe return nativeResponseValue; } // LDKSign KeysInterface_get_channel_signer LDKKeysInterface *NONNULL_PTR this_arg, bool inbound, uint64_t channel_value_satoshis +/* @internal */ export function KeysInterface_get_channel_signer(this_arg: number, inbound: boolean, channel_value_satoshis: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3913,6 +4350,7 @@ export function KeysInterface_get_channel_signer(this_arg: number, inbound: bool return nativeResponseValue; } // LDKThirtyTwoBytes KeysInterface_get_secure_random_bytes LDKKeysInterface *NONNULL_PTR this_arg +/* @internal */ export function KeysInterface_get_secure_random_bytes(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3921,6 +4359,7 @@ export function KeysInterface_get_secure_random_bytes(this_arg: number): number return nativeResponseValue; } // LDKCResult_SignDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface *NONNULL_PTR this_arg, struct LDKu8slice reader +/* @internal */ export function KeysInterface_read_chan_signer(this_arg: number, reader: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3929,6 +4368,7 @@ export function KeysInterface_read_chan_signer(this_arg: number, reader: number) return nativeResponseValue; } // LDKCResult_RecoverableSignatureNoneZ KeysInterface_sign_invoice LDKKeysInterface *NONNULL_PTR this_arg, struct LDKCVec_u8Z invoice_preimage +/* @internal */ export function KeysInterface_sign_invoice(this_arg: number, invoice_preimage: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3937,6 +4377,7 @@ export function KeysInterface_sign_invoice(this_arg: number, invoice_preimage: n return nativeResponseValue; } // LDKThirtyTwoBytes KeysInterface_get_inbound_payment_key_material LDKKeysInterface *NONNULL_PTR this_arg +/* @internal */ export function KeysInterface_get_inbound_payment_key_material(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3944,15 +4385,12 @@ export function KeysInterface_get_inbound_payment_key_material(this_arg: number) const nativeResponseValue = wasm.TS_KeysInterface_get_inbound_payment_key_material(this_arg); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKFeeEstimator { get_est_sat_per_1000_weight (confirmation_target: ConfirmationTarget): number; } +/* @internal */ export function LDKFeeEstimator_new(impl: LDKFeeEstimator): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3964,11 +4402,8 @@ export function LDKFeeEstimator_new(impl: LDKFeeEstimator): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKFeeEstimator_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator *NONNULL_PTR this_arg, enum LDKConfirmationTarget confirmation_target +/* @internal */ export function FeeEstimator_get_est_sat_per_1000_weight(this_arg: number, confirmation_target: ConfirmationTarget): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3976,15 +4411,12 @@ export function FeeEstimator_get_est_sat_per_1000_weight(this_arg: number, confi const nativeResponseValue = wasm.TS_FeeEstimator_get_est_sat_per_1000_weight(this_arg, confirmation_target); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKLogger { log (record: number): void; } +/* @internal */ export function LDKLogger_new(impl: LDKLogger): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -3996,11 +4428,8 @@ export function LDKLogger_new(impl: LDKLogger): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKLogger_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_BlockHashChannelManagerZ_get_a(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4009,6 +4438,7 @@ export function C2Tuple_BlockHashChannelManagerZ_get_a(owner: number): number { return nativeResponseValue; } // struct LDKChannelManager *C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner); +/* @internal */ export function C2Tuple_BlockHashChannelManagerZ_get_b(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4017,6 +4447,7 @@ export function C2Tuple_BlockHashChannelManagerZ_get_b(owner: number): number { return nativeResponseValue; } // struct LDKC2Tuple_BlockHashChannelManagerZ *CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4025,6 +4456,7 @@ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owne return nativeResponseValue; } // struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4032,15 +4464,12 @@ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(own const nativeResponseValue = wasm.TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKMessageSendEventsProvider { get_and_clear_pending_msg_events (): number; } +/* @internal */ export function LDKMessageSendEventsProvider_new(impl: LDKMessageSendEventsProvider): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4052,11 +4481,8 @@ export function LDKMessageSendEventsProvider_new(impl: LDKMessageSendEventsProvi js_objs[i] = new WeakRef(impl); return wasm.TS_LDKMessageSendEventsProvider_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // LDKCVec_MessageSendEventZ MessageSendEventsProvider_get_and_clear_pending_msg_events LDKMessageSendEventsProvider *NONNULL_PTR this_arg +/* @internal */ export function MessageSendEventsProvider_get_and_clear_pending_msg_events(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4064,15 +4490,12 @@ export function MessageSendEventsProvider_get_and_clear_pending_msg_events(this_ const nativeResponseValue = wasm.TS_MessageSendEventsProvider_get_and_clear_pending_msg_events(this_arg); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKEventHandler { handle_event (event: number): void; } +/* @internal */ export function LDKEventHandler_new(impl: LDKEventHandler): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4084,11 +4507,8 @@ export function LDKEventHandler_new(impl: LDKEventHandler): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKEventHandler_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // void EventHandler_handle_event LDKEventHandler *NONNULL_PTR this_arg, const struct LDKEvent *NONNULL_PTR event +/* @internal */ export function EventHandler_handle_event(this_arg: number, event: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4096,15 +4516,12 @@ export function EventHandler_handle_event(this_arg: number, event: number): void const nativeResponseValue = wasm.TS_EventHandler_handle_event(this_arg, event); // debug statements here } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKEventsProvider { process_pending_events (handler: number): void; } +/* @internal */ export function LDKEventsProvider_new(impl: LDKEventsProvider): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4116,11 +4533,8 @@ export function LDKEventsProvider_new(impl: LDKEventsProvider): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKEventsProvider_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // void EventsProvider_process_pending_events LDKEventsProvider *NONNULL_PTR this_arg, struct LDKEventHandler handler +/* @internal */ export function EventsProvider_process_pending_events(this_arg: number, handler: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4128,16 +4542,13 @@ export function EventsProvider_process_pending_events(this_arg: number, handler: const nativeResponseValue = wasm.TS_EventsProvider_process_pending_events(this_arg, handler); // debug statements here } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKListen { block_connected (block: number, height: number): void; block_disconnected (header: number, height: number): void; } +/* @internal */ export function LDKListen_new(impl: LDKListen): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4149,11 +4560,8 @@ export function LDKListen_new(impl: LDKListen): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKListen_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // void Listen_block_connected LDKListen *NONNULL_PTR this_arg, struct LDKu8slice block, uint32_t height +/* @internal */ export function Listen_block_connected(this_arg: number, block: number, height: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4162,6 +4570,7 @@ export function Listen_block_connected(this_arg: number, block: number, height: // debug statements here } // void Listen_block_disconnected LDKListen *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height +/* @internal */ export function Listen_block_disconnected(this_arg: number, header: number, height: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4169,11 +4578,7 @@ export function Listen_block_disconnected(this_arg: number, header: number, heig const nativeResponseValue = wasm.TS_Listen_block_disconnected(this_arg, header, height); // debug statements here } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKConfirm { transactions_confirmed (header: number, txdata: number, height: number): void; transaction_unconfirmed (txid: number): void; @@ -4181,6 +4586,7 @@ export interface LDKConfirm { get_relevant_txids (): number; } +/* @internal */ export function LDKConfirm_new(impl: LDKConfirm): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4192,11 +4598,8 @@ export function LDKConfirm_new(impl: LDKConfirm): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKConfirm_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // void Confirm_transactions_confirmed LDKConfirm *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height +/* @internal */ export function Confirm_transactions_confirmed(this_arg: number, header: number, txdata: number, height: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4205,6 +4608,7 @@ export function Confirm_transactions_confirmed(this_arg: number, header: number, // debug statements here } // void Confirm_transaction_unconfirmed LDKConfirm *NONNULL_PTR this_arg, const uint8_t (*txid)[32] +/* @internal */ export function Confirm_transaction_unconfirmed(this_arg: number, txid: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4213,6 +4617,7 @@ export function Confirm_transaction_unconfirmed(this_arg: number, txid: number): // debug statements here } // void Confirm_best_block_updated LDKConfirm *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height +/* @internal */ export function Confirm_best_block_updated(this_arg: number, header: number, height: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4221,6 +4626,7 @@ export function Confirm_best_block_updated(this_arg: number, header: number, hei // debug statements here } // LDKCVec_TxidZ Confirm_get_relevant_txids LDKConfirm *NONNULL_PTR this_arg +/* @internal */ export function Confirm_get_relevant_txids(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4228,16 +4634,13 @@ export function Confirm_get_relevant_txids(this_arg: number): number { const nativeResponseValue = wasm.TS_Confirm_get_relevant_txids(this_arg); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKPersist { persist_new_channel (channel_id: number, data: number, update_id: number): number; update_persisted_channel (channel_id: number, update: number, data: number, update_id: number): number; } +/* @internal */ export function LDKPersist_new(impl: LDKPersist): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4249,11 +4652,8 @@ export function LDKPersist_new(impl: LDKPersist): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKPersist_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id +/* @internal */ export function Persist_persist_new_channel(this_arg: number, channel_id: number, data: number, update_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4262,6 +4662,7 @@ export function Persist_persist_new_channel(this_arg: number, channel_id: number return nativeResponseValue; } // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id +/* @internal */ export function Persist_update_persisted_channel(this_arg: number, channel_id: number, update: number, data: number, update_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4269,11 +4670,7 @@ export function Persist_update_persisted_channel(this_arg: number, channel_id: n const nativeResponseValue = wasm.TS_Persist_update_persisted_channel(this_arg, channel_id, update, data, update_id); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKChannelMessageHandler { handle_open_channel (their_node_id: number, their_features: number, msg: number): void; handle_accept_channel (their_node_id: number, their_features: number, msg: number): void; @@ -4297,6 +4694,7 @@ export interface LDKChannelMessageHandler { handle_error (their_node_id: number, msg: number): void; } +/* @internal */ export function LDKChannelMessageHandler_new(impl: LDKChannelMessageHandler, MessageSendEventsProvider: LDKMessageSendEventsProvider): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4308,11 +4706,8 @@ export function LDKChannelMessageHandler_new(impl: LDKChannelMessageHandler, Mes js_objs[i] = new WeakRef(impl); return wasm.TS_LDKChannelMessageHandler_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_open_channel(this_arg: number, their_node_id: number, their_features: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4321,6 +4716,7 @@ export function ChannelMessageHandler_handle_open_channel(this_arg: number, thei // debug statements here } // void ChannelMessageHandler_handle_accept_channel LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_accept_channel(this_arg: number, their_node_id: number, their_features: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4329,6 +4725,7 @@ export function ChannelMessageHandler_handle_accept_channel(this_arg: number, th // debug statements here } // void ChannelMessageHandler_handle_funding_created LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_funding_created(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4337,6 +4734,7 @@ export function ChannelMessageHandler_handle_funding_created(this_arg: number, t // debug statements here } // void ChannelMessageHandler_handle_funding_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_funding_signed(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4345,6 +4743,7 @@ export function ChannelMessageHandler_handle_funding_signed(this_arg: number, th // debug statements here } // void ChannelMessageHandler_handle_funding_locked LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_funding_locked(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4353,6 +4752,7 @@ export function ChannelMessageHandler_handle_funding_locked(this_arg: number, th // debug statements here } // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_shutdown(this_arg: number, their_node_id: number, their_features: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4361,6 +4761,7 @@ export function ChannelMessageHandler_handle_shutdown(this_arg: number, their_no // debug statements here } // void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_closing_signed(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4369,6 +4770,7 @@ export function ChannelMessageHandler_handle_closing_signed(this_arg: number, th // debug statements here } // void ChannelMessageHandler_handle_update_add_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_update_add_htlc(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4377,6 +4779,7 @@ export function ChannelMessageHandler_handle_update_add_htlc(this_arg: number, t // debug statements here } // void ChannelMessageHandler_handle_update_fulfill_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_update_fulfill_htlc(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4385,6 +4788,7 @@ export function ChannelMessageHandler_handle_update_fulfill_htlc(this_arg: numbe // debug statements here } // void ChannelMessageHandler_handle_update_fail_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_update_fail_htlc(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4393,6 +4797,7 @@ export function ChannelMessageHandler_handle_update_fail_htlc(this_arg: number, // debug statements here } // void ChannelMessageHandler_handle_update_fail_malformed_htlc LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_update_fail_malformed_htlc(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4401,6 +4806,7 @@ export function ChannelMessageHandler_handle_update_fail_malformed_htlc(this_arg // debug statements here } // void ChannelMessageHandler_handle_commitment_signed LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_commitment_signed(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4409,6 +4815,7 @@ export function ChannelMessageHandler_handle_commitment_signed(this_arg: number, // debug statements here } // void ChannelMessageHandler_handle_revoke_and_ack LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_revoke_and_ack(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4417,6 +4824,7 @@ export function ChannelMessageHandler_handle_revoke_and_ack(this_arg: number, th // debug statements here } // void ChannelMessageHandler_handle_update_fee LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_update_fee(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4425,6 +4833,7 @@ export function ChannelMessageHandler_handle_update_fee(this_arg: number, their_ // debug statements here } // void ChannelMessageHandler_handle_announcement_signatures LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_announcement_signatures(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4433,6 +4842,7 @@ export function ChannelMessageHandler_handle_announcement_signatures(this_arg: n // debug statements here } // void ChannelMessageHandler_peer_disconnected LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible +/* @internal */ export function ChannelMessageHandler_peer_disconnected(this_arg: number, their_node_id: number, no_connection_possible: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4441,6 +4851,7 @@ export function ChannelMessageHandler_peer_disconnected(this_arg: number, their_ // debug statements here } // void ChannelMessageHandler_peer_connected LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_peer_connected(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4449,6 +4860,7 @@ export function ChannelMessageHandler_peer_connected(this_arg: number, their_nod // debug statements here } // void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_channel_reestablish(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4457,6 +4869,7 @@ export function ChannelMessageHandler_handle_channel_reestablish(this_arg: numbe // debug statements here } // void ChannelMessageHandler_handle_channel_update LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_channel_update(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4465,6 +4878,7 @@ export function ChannelMessageHandler_handle_channel_update(this_arg: number, th // debug statements here } // void ChannelMessageHandler_handle_error LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg +/* @internal */ export function ChannelMessageHandler_handle_error(this_arg: number, their_node_id: number, msg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4472,11 +4886,7 @@ export function ChannelMessageHandler_handle_error(this_arg: number, their_node_ const nativeResponseValue = wasm.TS_ChannelMessageHandler_handle_error(this_arg, their_node_id, msg); // debug statements here } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKRoutingMessageHandler { handle_node_announcement (msg: number): number; handle_channel_announcement (msg: number): number; @@ -4490,6 +4900,7 @@ export interface LDKRoutingMessageHandler { handle_query_short_channel_ids (their_node_id: number, msg: number): number; } +/* @internal */ export function LDKRoutingMessageHandler_new(impl: LDKRoutingMessageHandler, MessageSendEventsProvider: LDKMessageSendEventsProvider): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4501,11 +4912,8 @@ export function LDKRoutingMessageHandler_new(impl: LDKRoutingMessageHandler, Mes js_objs[i] = new WeakRef(impl); return wasm.TS_LDKRoutingMessageHandler_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg +/* @internal */ export function RoutingMessageHandler_handle_node_announcement(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4514,6 +4922,7 @@ export function RoutingMessageHandler_handle_node_announcement(this_arg: number, return nativeResponseValue; } // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg +/* @internal */ export function RoutingMessageHandler_handle_channel_announcement(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4522,6 +4931,7 @@ export function RoutingMessageHandler_handle_channel_announcement(this_arg: numb return nativeResponseValue; } // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_update LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg +/* @internal */ export function RoutingMessageHandler_handle_channel_update(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4530,6 +4940,7 @@ export function RoutingMessageHandler_handle_channel_update(this_arg: number, ms return nativeResponseValue; } // LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ RoutingMessageHandler_get_next_channel_announcements LDKRoutingMessageHandler *NONNULL_PTR this_arg, uint64_t starting_point, uint8_t batch_amount +/* @internal */ export function RoutingMessageHandler_get_next_channel_announcements(this_arg: number, starting_point: bigint, batch_amount: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4538,6 +4949,7 @@ export function RoutingMessageHandler_get_next_channel_announcements(this_arg: n return nativeResponseValue; } // LDKCVec_NodeAnnouncementZ RoutingMessageHandler_get_next_node_announcements LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount +/* @internal */ export function RoutingMessageHandler_get_next_node_announcements(this_arg: number, starting_point: number, batch_amount: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4546,6 +4958,7 @@ export function RoutingMessageHandler_get_next_node_announcements(this_arg: numb return nativeResponseValue; } // void RoutingMessageHandler_sync_routing_table LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init +/* @internal */ export function RoutingMessageHandler_sync_routing_table(this_arg: number, their_node_id: number, init: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4554,6 +4967,7 @@ export function RoutingMessageHandler_sync_routing_table(this_arg: number, their // debug statements here } // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_channel_range LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg +/* @internal */ export function RoutingMessageHandler_handle_reply_channel_range(this_arg: number, their_node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4562,6 +4976,7 @@ export function RoutingMessageHandler_handle_reply_channel_range(this_arg: numbe return nativeResponseValue; } // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_short_channel_ids_end LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg +/* @internal */ export function RoutingMessageHandler_handle_reply_short_channel_ids_end(this_arg: number, their_node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4570,6 +4985,7 @@ export function RoutingMessageHandler_handle_reply_short_channel_ids_end(this_ar return nativeResponseValue; } // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_channel_range LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg +/* @internal */ export function RoutingMessageHandler_handle_query_channel_range(this_arg: number, their_node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4578,6 +4994,7 @@ export function RoutingMessageHandler_handle_query_channel_range(this_arg: numbe return nativeResponseValue; } // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_short_channel_ids LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg +/* @internal */ export function RoutingMessageHandler_handle_query_short_channel_ids(this_arg: number, their_node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4585,15 +5002,12 @@ export function RoutingMessageHandler_handle_query_short_channel_ids(this_arg: n const nativeResponseValue = wasm.TS_RoutingMessageHandler_handle_query_short_channel_ids(this_arg, their_node_id, msg); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKCustomMessageReader { read (message_type: number, buffer: number): number; } +/* @internal */ export function LDKCustomMessageReader_new(impl: LDKCustomMessageReader): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4605,11 +5019,8 @@ export function LDKCustomMessageReader_new(impl: LDKCustomMessageReader): number js_objs[i] = new WeakRef(impl); return wasm.TS_LDKCustomMessageReader_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // LDKCResult_COption_TypeZDecodeErrorZ CustomMessageReader_read LDKCustomMessageReader *NONNULL_PTR this_arg, uint16_t message_type, struct LDKu8slice buffer +/* @internal */ export function CustomMessageReader_read(this_arg: number, message_type: number, buffer: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4617,16 +5028,13 @@ export function CustomMessageReader_read(this_arg: number, message_type: number, const nativeResponseValue = wasm.TS_CustomMessageReader_read(this_arg, message_type, buffer); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKCustomMessageHandler { handle_custom_message (msg: number, sender_node_id: number): number; get_and_clear_pending_msg (): number; } +/* @internal */ export function LDKCustomMessageHandler_new(impl: LDKCustomMessageHandler, CustomMessageReader: LDKCustomMessageReader): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4638,11 +5046,8 @@ export function LDKCustomMessageHandler_new(impl: LDKCustomMessageHandler, Custo js_objs[i] = new WeakRef(impl); return wasm.TS_LDKCustomMessageHandler_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // LDKCResult_NoneLightningErrorZ CustomMessageHandler_handle_custom_message LDKCustomMessageHandler *NONNULL_PTR this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id +/* @internal */ export function CustomMessageHandler_handle_custom_message(this_arg: number, msg: number, sender_node_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4651,6 +5056,7 @@ export function CustomMessageHandler_handle_custom_message(this_arg: number, msg return nativeResponseValue; } // LDKCVec_C2Tuple_PublicKeyTypeZZ CustomMessageHandler_get_and_clear_pending_msg LDKCustomMessageHandler *NONNULL_PTR this_arg +/* @internal */ export function CustomMessageHandler_get_and_clear_pending_msg(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4658,11 +5064,7 @@ export function CustomMessageHandler_get_and_clear_pending_msg(this_arg: number) const nativeResponseValue = wasm.TS_CustomMessageHandler_get_and_clear_pending_msg(this_arg); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKSocketDescriptor { send_data (data: number, resume_read: boolean): number; disconnect_socket (): void; @@ -4670,6 +5072,7 @@ export interface LDKSocketDescriptor { hash (): bigint; } +/* @internal */ export function LDKSocketDescriptor_new(impl: LDKSocketDescriptor): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4681,11 +5084,8 @@ export function LDKSocketDescriptor_new(impl: LDKSocketDescriptor): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKSocketDescriptor_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // uintptr_t SocketDescriptor_send_data LDKSocketDescriptor *NONNULL_PTR this_arg, struct LDKu8slice data, bool resume_read +/* @internal */ export function SocketDescriptor_send_data(this_arg: number, data: number, resume_read: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4694,6 +5094,7 @@ export function SocketDescriptor_send_data(this_arg: number, data: number, resum return nativeResponseValue; } // void SocketDescriptor_disconnect_socket LDKSocketDescriptor *NONNULL_PTR this_arg +/* @internal */ export function SocketDescriptor_disconnect_socket(this_arg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4702,6 +5103,7 @@ export function SocketDescriptor_disconnect_socket(this_arg: number): void { // debug statements here } // uint64_t SocketDescriptor_hash LDKSocketDescriptor *NONNULL_PTR this_arg +/* @internal */ export function SocketDescriptor_hash(this_arg: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4709,11 +5111,7 @@ export function SocketDescriptor_hash(this_arg: number): bigint { const nativeResponseValue = wasm.TS_SocketDescriptor_hash(this_arg); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKScore { channel_penalty_msat (short_channel_id: bigint, send_amt_msat: bigint, channel_capacity_msat: number, source: number, target: number): bigint; payment_path_failed (path: number, short_channel_id: bigint): void; @@ -4721,6 +5119,7 @@ export interface LDKScore { write (): number; } +/* @internal */ export function LDKScore_new(impl: LDKScore): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4732,11 +5131,8 @@ export function LDKScore_new(impl: LDKScore): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKScore_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // uint64_t Score_channel_penalty_msat LDKScore *NONNULL_PTR this_arg, uint64_t short_channel_id, uint64_t send_amt_msat, struct LDKCOption_u64Z channel_capacity_msat, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target +/* @internal */ export function Score_channel_penalty_msat(this_arg: number, short_channel_id: bigint, send_amt_msat: bigint, channel_capacity_msat: number, source: number, target: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4745,6 +5141,7 @@ export function Score_channel_penalty_msat(this_arg: number, short_channel_id: b return nativeResponseValue; } // void Score_payment_path_failed LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id +/* @internal */ export function Score_payment_path_failed(this_arg: number, path: number, short_channel_id: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4753,6 +5150,7 @@ export function Score_payment_path_failed(this_arg: number, path: number, short_ // debug statements here } // void Score_payment_path_successful LDKScore *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path +/* @internal */ export function Score_payment_path_successful(this_arg: number, path: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4761,6 +5159,7 @@ export function Score_payment_path_successful(this_arg: number, path: number): v // debug statements here } // LDKCVec_u8Z Score_write LDKScore *NONNULL_PTR this_arg +/* @internal */ export function Score_write(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4768,15 +5167,12 @@ export function Score_write(this_arg: number): number { const nativeResponseValue = wasm.TS_Score_write(this_arg); return nativeResponseValue; } - - - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START - +/* @internal */ export interface LDKLockableScore { lock (): number; } +/* @internal */ export function LDKLockableScore_new(impl: LDKLockableScore): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4788,11 +5184,8 @@ export function LDKLockableScore_new(impl: LDKLockableScore): number { js_objs[i] = new WeakRef(impl); return wasm.TS_LDKLockableScore_new(i); } - -// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END - - // LDKScore LockableScore_lock LDKLockableScore *NONNULL_PTR this_arg +/* @internal */ export function LockableScore_lock(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4801,6 +5194,7 @@ export function LockableScore_lock(this_arg: number): number { return nativeResponseValue; } // struct LDKStr _ldk_get_compiled_version(void); +/* @internal */ export function _ldk_get_compiled_version(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4809,6 +5203,7 @@ export function _ldk_get_compiled_version(): number { return nativeResponseValue; } // struct LDKStr _ldk_c_bindings_get_compiled_version(void); +/* @internal */ export function _ldk_c_bindings_get_compiled_version(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4817,6 +5212,7 @@ export function _ldk_c_bindings_get_compiled_version(): number { return nativeResponseValue; } // void Transaction_free(struct LDKTransaction _res); +/* @internal */ export function Transaction_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4825,6 +5221,7 @@ export function Transaction_free(_res: number): void { // debug statements here } // struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value); +/* @internal */ export function TxOut_new(script_pubkey: number, value: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4833,6 +5230,7 @@ export function TxOut_new(script_pubkey: number, value: bigint): number { return nativeResponseValue; } // void TxOut_free(struct LDKTxOut _res); +/* @internal */ export function TxOut_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4841,6 +5239,7 @@ export function TxOut_free(_res: number): void { // debug statements here } // uintptr_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg); +/* @internal */ export function TxOut_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4849,6 +5248,7 @@ export function TxOut_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig); +/* @internal */ export function TxOut_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4857,6 +5257,7 @@ export function TxOut_clone(orig: number): number { return nativeResponseValue; } // void Str_free(struct LDKStr _res); +/* @internal */ export function Str_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4865,6 +5266,7 @@ export function Str_free(_res: number): void { // debug statements here } // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o); +/* @internal */ export function CResult_ChannelConfigDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4873,6 +5275,7 @@ export function CResult_ChannelConfigDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ChannelConfigDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4881,6 +5284,7 @@ export function CResult_ChannelConfigDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ChannelConfigDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4889,6 +5293,7 @@ export function CResult_ChannelConfigDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res); +/* @internal */ export function CResult_ChannelConfigDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4897,6 +5302,7 @@ export function CResult_ChannelConfigDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4905,6 +5311,7 @@ export function CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ChannelConfigDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4913,6 +5320,7 @@ export function CResult_ChannelConfigDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o); +/* @internal */ export function CResult_OutPointDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4921,6 +5329,7 @@ export function CResult_OutPointDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_OutPointDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4929,6 +5338,7 @@ export function CResult_OutPointDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_OutPointDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4937,6 +5347,7 @@ export function CResult_OutPointDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res); +/* @internal */ export function CResult_OutPointDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4945,6 +5356,7 @@ export function CResult_OutPointDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_OutPointDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4953,6 +5365,7 @@ export function CResult_OutPointDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_OutPointDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4961,6 +5374,7 @@ export function CResult_OutPointDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o); +/* @internal */ export function CResult_SecretKeyErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4969,6 +5383,7 @@ export function CResult_SecretKeyErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e); +/* @internal */ export function CResult_SecretKeyErrorZ_err(e: Secp256k1Error): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4977,6 +5392,7 @@ export function CResult_SecretKeyErrorZ_err(e: Secp256k1Error): number { return nativeResponseValue; } // bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_SecretKeyErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4985,6 +5401,7 @@ export function CResult_SecretKeyErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res); +/* @internal */ export function CResult_SecretKeyErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -4993,6 +5410,7 @@ export function CResult_SecretKeyErrorZ_free(_res: number): void { // debug statements here } // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o); +/* @internal */ export function CResult_PublicKeyErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5001,6 +5419,7 @@ export function CResult_PublicKeyErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e); +/* @internal */ export function CResult_PublicKeyErrorZ_err(e: Secp256k1Error): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5009,6 +5428,7 @@ export function CResult_PublicKeyErrorZ_err(e: Secp256k1Error): number { return nativeResponseValue; } // bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_PublicKeyErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5017,6 +5437,7 @@ export function CResult_PublicKeyErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res); +/* @internal */ export function CResult_PublicKeyErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5025,6 +5446,7 @@ export function CResult_PublicKeyErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_PublicKeyErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5033,6 +5455,7 @@ export function CResult_PublicKeyErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_PublicKeyErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5041,6 +5464,7 @@ export function CResult_PublicKeyErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o); +/* @internal */ export function CResult_TxCreationKeysDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5049,6 +5473,7 @@ export function CResult_TxCreationKeysDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_TxCreationKeysDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5057,6 +5482,7 @@ export function CResult_TxCreationKeysDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_TxCreationKeysDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5065,6 +5491,7 @@ export function CResult_TxCreationKeysDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res); +/* @internal */ export function CResult_TxCreationKeysDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5073,6 +5500,7 @@ export function CResult_TxCreationKeysDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5081,6 +5509,7 @@ export function CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg: number): numbe return nativeResponseValue; } // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_TxCreationKeysDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5089,6 +5518,7 @@ export function CResult_TxCreationKeysDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o); +/* @internal */ export function CResult_ChannelPublicKeysDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5097,6 +5527,7 @@ export function CResult_ChannelPublicKeysDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ChannelPublicKeysDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5105,6 +5536,7 @@ export function CResult_ChannelPublicKeysDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5113,6 +5545,7 @@ export function CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o: number): boolean return nativeResponseValue; } // void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res); +/* @internal */ export function CResult_ChannelPublicKeysDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5121,6 +5554,7 @@ export function CResult_ChannelPublicKeysDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5129,6 +5563,7 @@ export function CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg: number): nu return nativeResponseValue; } // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ChannelPublicKeysDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5137,6 +5572,7 @@ export function CResult_ChannelPublicKeysDecodeErrorZ_clone(orig: number): numbe return nativeResponseValue; } // struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o); +/* @internal */ export function CResult_TxCreationKeysErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5145,6 +5581,7 @@ export function CResult_TxCreationKeysErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e); +/* @internal */ export function CResult_TxCreationKeysErrorZ_err(e: Secp256k1Error): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5153,6 +5590,7 @@ export function CResult_TxCreationKeysErrorZ_err(e: Secp256k1Error): number { return nativeResponseValue; } // bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_TxCreationKeysErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5161,6 +5599,7 @@ export function CResult_TxCreationKeysErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res); +/* @internal */ export function CResult_TxCreationKeysErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5169,6 +5608,7 @@ export function CResult_TxCreationKeysErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_TxCreationKeysErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5177,6 +5617,7 @@ export function CResult_TxCreationKeysErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_TxCreationKeysErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5185,6 +5626,7 @@ export function CResult_TxCreationKeysErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCOption_u32Z COption_u32Z_some(uint32_t o); +/* @internal */ export function COption_u32Z_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5193,6 +5635,7 @@ export function COption_u32Z_some(o: number): number { return nativeResponseValue; } // struct LDKCOption_u32Z COption_u32Z_none(void); +/* @internal */ export function COption_u32Z_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5201,6 +5644,7 @@ export function COption_u32Z_none(): number { return nativeResponseValue; } // void COption_u32Z_free(struct LDKCOption_u32Z _res); +/* @internal */ export function COption_u32Z_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5209,6 +5653,7 @@ export function COption_u32Z_free(_res: number): void { // debug statements here } // uintptr_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg); +/* @internal */ export function COption_u32Z_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5217,6 +5662,7 @@ export function COption_u32Z_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig); +/* @internal */ export function COption_u32Z_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5225,6 +5671,7 @@ export function COption_u32Z_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o); +/* @internal */ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5233,6 +5680,7 @@ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o: number): number return nativeResponseValue; } // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5241,6 +5689,7 @@ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e: number): numbe return nativeResponseValue; } // bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5249,6 +5698,7 @@ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o: number): boo return nativeResponseValue; } // void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res); +/* @internal */ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5257,6 +5707,7 @@ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res: number): v // debug statements here } // uintptr_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5265,6 +5716,7 @@ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg: number return nativeResponseValue; } // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5273,6 +5725,7 @@ export function CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig: number): return nativeResponseValue; } // enum LDKCOption_NoneZ COption_NoneZ_some(void); +/* @internal */ export function COption_NoneZ_some(): COption_NoneZ { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5281,6 +5734,7 @@ export function COption_NoneZ_some(): COption_NoneZ { return nativeResponseValue; } // enum LDKCOption_NoneZ COption_NoneZ_none(void); +/* @internal */ export function COption_NoneZ_none(): COption_NoneZ { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5289,6 +5743,7 @@ export function COption_NoneZ_none(): COption_NoneZ { return nativeResponseValue; } // void COption_NoneZ_free(enum LDKCOption_NoneZ _res); +/* @internal */ export function COption_NoneZ_free(_res: COption_NoneZ): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5297,6 +5752,7 @@ export function COption_NoneZ_free(_res: COption_NoneZ): void { // debug statements here } // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o); +/* @internal */ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5305,6 +5761,7 @@ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok( return nativeResponseValue; } // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5313,6 +5770,7 @@ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err return nativeResponseValue; } // bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5321,6 +5779,7 @@ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ return nativeResponseValue; } // void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res); +/* @internal */ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5329,6 +5788,7 @@ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_fre // debug statements here } // uintptr_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5337,6 +5797,7 @@ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clo return nativeResponseValue; } // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5345,6 +5806,7 @@ export function CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clo return nativeResponseValue; } // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o); +/* @internal */ export function CResult_ChannelTransactionParametersDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5353,6 +5815,7 @@ export function CResult_ChannelTransactionParametersDecodeErrorZ_ok(o: number): return nativeResponseValue; } // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ChannelTransactionParametersDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5361,6 +5824,7 @@ export function CResult_ChannelTransactionParametersDecodeErrorZ_err(e: number): return nativeResponseValue; } // bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5369,6 +5833,7 @@ export function CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o: number return nativeResponseValue; } // void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res); +/* @internal */ export function CResult_ChannelTransactionParametersDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5377,6 +5842,7 @@ export function CResult_ChannelTransactionParametersDecodeErrorZ_free(_res: numb // debug statements here } // uintptr_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5385,6 +5851,7 @@ export function CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg: return nativeResponseValue; } // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5393,6 +5860,7 @@ export function CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig: num return nativeResponseValue; } // void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res); +/* @internal */ export function CVec_SignatureZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5401,6 +5869,7 @@ export function CVec_SignatureZ_free(_res: number): void { // debug statements here } // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o); +/* @internal */ export function CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5409,6 +5878,7 @@ export function CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o: number): n return nativeResponseValue; } // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_HolderCommitmentTransactionDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5417,6 +5887,7 @@ export function CResult_HolderCommitmentTransactionDecodeErrorZ_err(e: number): return nativeResponseValue; } // bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5425,6 +5896,7 @@ export function CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o: number) return nativeResponseValue; } // void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res); +/* @internal */ export function CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5433,6 +5905,7 @@ export function CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res: numbe // debug statements here } // uintptr_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5441,6 +5914,7 @@ export function CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg: n return nativeResponseValue; } // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5449,6 +5923,7 @@ export function CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig: numb return nativeResponseValue; } // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o); +/* @internal */ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5457,6 +5932,7 @@ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o: number): nu return nativeResponseValue; } // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5465,6 +5941,7 @@ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e: number): n return nativeResponseValue; } // bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5473,6 +5950,7 @@ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o: number): return nativeResponseValue; } // void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res); +/* @internal */ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5481,6 +5959,7 @@ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res: number // debug statements here } // uintptr_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5489,6 +5968,7 @@ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg: nu return nativeResponseValue; } // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5497,6 +5977,7 @@ export function CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig: numbe return nativeResponseValue; } // struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o); +/* @internal */ export function CResult_TrustedClosingTransactionNoneZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5505,6 +5986,7 @@ export function CResult_TrustedClosingTransactionNoneZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void); +/* @internal */ export function CResult_TrustedClosingTransactionNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5513,6 +5995,7 @@ export function CResult_TrustedClosingTransactionNoneZ_err(): number { return nativeResponseValue; } // bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_TrustedClosingTransactionNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5521,6 +6004,7 @@ export function CResult_TrustedClosingTransactionNoneZ_is_ok(o: number): boolean return nativeResponseValue; } // void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res); +/* @internal */ export function CResult_TrustedClosingTransactionNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5529,6 +6013,7 @@ export function CResult_TrustedClosingTransactionNoneZ_free(_res: number): void // debug statements here } // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o); +/* @internal */ export function CResult_CommitmentTransactionDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5537,6 +6022,7 @@ export function CResult_CommitmentTransactionDecodeErrorZ_ok(o: number): number return nativeResponseValue; } // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_CommitmentTransactionDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5545,6 +6031,7 @@ export function CResult_CommitmentTransactionDecodeErrorZ_err(e: number): number return nativeResponseValue; } // bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_CommitmentTransactionDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5553,6 +6040,7 @@ export function CResult_CommitmentTransactionDecodeErrorZ_is_ok(o: number): bool return nativeResponseValue; } // void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res); +/* @internal */ export function CResult_CommitmentTransactionDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5561,6 +6049,7 @@ export function CResult_CommitmentTransactionDecodeErrorZ_free(_res: number): vo // debug statements here } // uintptr_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5569,6 +6058,7 @@ export function CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg: number) return nativeResponseValue; } // struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_CommitmentTransactionDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5577,6 +6067,7 @@ export function CResult_CommitmentTransactionDecodeErrorZ_clone(orig: number): n return nativeResponseValue; } // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o); +/* @internal */ export function CResult_TrustedCommitmentTransactionNoneZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5585,6 +6076,7 @@ export function CResult_TrustedCommitmentTransactionNoneZ_ok(o: number): number return nativeResponseValue; } // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void); +/* @internal */ export function CResult_TrustedCommitmentTransactionNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5593,6 +6085,7 @@ export function CResult_TrustedCommitmentTransactionNoneZ_err(): number { return nativeResponseValue; } // bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_TrustedCommitmentTransactionNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5601,6 +6094,7 @@ export function CResult_TrustedCommitmentTransactionNoneZ_is_ok(o: number): bool return nativeResponseValue; } // void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res); +/* @internal */ export function CResult_TrustedCommitmentTransactionNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5609,6 +6103,7 @@ export function CResult_TrustedCommitmentTransactionNoneZ_free(_res: number): vo // debug statements here } // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o); +/* @internal */ export function CResult_CVec_SignatureZNoneZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5617,6 +6112,7 @@ export function CResult_CVec_SignatureZNoneZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void); +/* @internal */ export function CResult_CVec_SignatureZNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5625,6 +6121,7 @@ export function CResult_CVec_SignatureZNoneZ_err(): number { return nativeResponseValue; } // bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_CVec_SignatureZNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5633,6 +6130,7 @@ export function CResult_CVec_SignatureZNoneZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res); +/* @internal */ export function CResult_CVec_SignatureZNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5641,6 +6139,7 @@ export function CResult_CVec_SignatureZNoneZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg); +/* @internal */ export function CResult_CVec_SignatureZNoneZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5649,6 +6148,7 @@ export function CResult_CVec_SignatureZNoneZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig); +/* @internal */ export function CResult_CVec_SignatureZNoneZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5657,6 +6157,7 @@ export function CResult_CVec_SignatureZNoneZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o); +/* @internal */ export function CResult_ShutdownScriptDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5665,6 +6166,7 @@ export function CResult_ShutdownScriptDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ShutdownScriptDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5673,6 +6175,7 @@ export function CResult_ShutdownScriptDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ShutdownScriptDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5681,6 +6184,7 @@ export function CResult_ShutdownScriptDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res); +/* @internal */ export function CResult_ShutdownScriptDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5689,6 +6193,7 @@ export function CResult_ShutdownScriptDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5697,6 +6202,7 @@ export function CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg: number): numbe return nativeResponseValue; } // struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ShutdownScriptDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5705,6 +6211,7 @@ export function CResult_ShutdownScriptDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o); +/* @internal */ export function CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5713,6 +6220,7 @@ export function CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o: number): numb return nativeResponseValue; } // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e); +/* @internal */ export function CResult_ShutdownScriptInvalidShutdownScriptZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5721,6 +6229,7 @@ export function CResult_ShutdownScriptInvalidShutdownScriptZ_err(e: number): num return nativeResponseValue; } // bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o); +/* @internal */ export function CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5729,6 +6238,7 @@ export function CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o: number): b return nativeResponseValue; } // void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res); +/* @internal */ export function CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5737,6 +6247,7 @@ export function CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res: number): // debug statements here } // uintptr_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5745,6 +6256,7 @@ export function CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg: numb return nativeResponseValue; } // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5753,6 +6265,7 @@ export function CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig: number) return nativeResponseValue; } // struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o); +/* @internal */ export function COption_TypeZ_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5761,6 +6274,7 @@ export function COption_TypeZ_some(o: number): number { return nativeResponseValue; } // struct LDKCOption_TypeZ COption_TypeZ_none(void); +/* @internal */ export function COption_TypeZ_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5769,6 +6283,7 @@ export function COption_TypeZ_none(): number { return nativeResponseValue; } // void COption_TypeZ_free(struct LDKCOption_TypeZ _res); +/* @internal */ export function COption_TypeZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5777,6 +6292,7 @@ export function COption_TypeZ_free(_res: number): void { // debug statements here } // uintptr_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg); +/* @internal */ export function COption_TypeZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5785,6 +6301,7 @@ export function COption_TypeZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig); +/* @internal */ export function COption_TypeZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5793,6 +6310,7 @@ export function COption_TypeZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o); +/* @internal */ export function CResult_COption_TypeZDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5801,6 +6319,7 @@ export function CResult_COption_TypeZDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_COption_TypeZDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5809,6 +6328,7 @@ export function CResult_COption_TypeZDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_COption_TypeZDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5817,6 +6337,7 @@ export function CResult_COption_TypeZDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res); +/* @internal */ export function CResult_COption_TypeZDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5825,6 +6346,7 @@ export function CResult_COption_TypeZDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5833,6 +6355,7 @@ export function CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_COption_TypeZDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5841,6 +6364,7 @@ export function CResult_COption_TypeZDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o); +/* @internal */ export function CResult_StringErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5849,6 +6373,7 @@ export function CResult_StringErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e); +/* @internal */ export function CResult_StringErrorZ_err(e: Secp256k1Error): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5857,6 +6382,7 @@ export function CResult_StringErrorZ_err(e: Secp256k1Error): number { return nativeResponseValue; } // bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_StringErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5865,6 +6391,7 @@ export function CResult_StringErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res); +/* @internal */ export function CResult_StringErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5873,6 +6400,7 @@ export function CResult_StringErrorZ_free(_res: number): void { // debug statements here } // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o); +/* @internal */ export function CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5881,6 +6409,7 @@ export function CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ChannelMonitorUpdateDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5889,6 +6418,7 @@ export function CResult_ChannelMonitorUpdateDecodeErrorZ_err(e: number): number return nativeResponseValue; } // bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5897,6 +6427,7 @@ export function CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o: number): boole return nativeResponseValue; } // void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res); +/* @internal */ export function CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5905,6 +6436,7 @@ export function CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res: number): voi // debug statements here } // uintptr_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5913,6 +6445,7 @@ export function CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg: number): return nativeResponseValue; } // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5921,6 +6454,7 @@ export function CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig: number): nu return nativeResponseValue; } // struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o); +/* @internal */ export function COption_MonitorEventZ_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5929,6 +6463,7 @@ export function COption_MonitorEventZ_some(o: number): number { return nativeResponseValue; } // struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void); +/* @internal */ export function COption_MonitorEventZ_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5937,6 +6472,7 @@ export function COption_MonitorEventZ_none(): number { return nativeResponseValue; } // void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res); +/* @internal */ export function COption_MonitorEventZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5945,6 +6481,7 @@ export function COption_MonitorEventZ_free(_res: number): void { // debug statements here } // uintptr_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg); +/* @internal */ export function COption_MonitorEventZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5953,6 +6490,7 @@ export function COption_MonitorEventZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig); +/* @internal */ export function COption_MonitorEventZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5961,6 +6499,7 @@ export function COption_MonitorEventZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o); +/* @internal */ export function CResult_COption_MonitorEventZDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5969,6 +6508,7 @@ export function CResult_COption_MonitorEventZDecodeErrorZ_ok(o: number): number return nativeResponseValue; } // struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_COption_MonitorEventZDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5977,6 +6517,7 @@ export function CResult_COption_MonitorEventZDecodeErrorZ_err(e: number): number return nativeResponseValue; } // bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5985,6 +6526,7 @@ export function CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o: number): bool return nativeResponseValue; } // void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res); +/* @internal */ export function CResult_COption_MonitorEventZDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -5993,6 +6535,7 @@ export function CResult_COption_MonitorEventZDecodeErrorZ_free(_res: number): vo // debug statements here } // uintptr_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6001,6 +6544,7 @@ export function CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg: number) return nativeResponseValue; } // struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_COption_MonitorEventZDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6009,6 +6553,7 @@ export function CResult_COption_MonitorEventZDecodeErrorZ_clone(orig: number): n return nativeResponseValue; } // struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o); +/* @internal */ export function CResult_HTLCUpdateDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6017,6 +6562,7 @@ export function CResult_HTLCUpdateDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_HTLCUpdateDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6025,6 +6571,7 @@ export function CResult_HTLCUpdateDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_HTLCUpdateDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6033,6 +6580,7 @@ export function CResult_HTLCUpdateDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res); +/* @internal */ export function CResult_HTLCUpdateDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6041,6 +6589,7 @@ export function CResult_HTLCUpdateDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6049,6 +6598,7 @@ export function CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_HTLCUpdateDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6057,6 +6607,7 @@ export function CResult_HTLCUpdateDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void); +/* @internal */ export function CResult_NoneNoneZ_ok(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6065,6 +6616,7 @@ export function CResult_NoneNoneZ_ok(): number { return nativeResponseValue; } // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void); +/* @internal */ export function CResult_NoneNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6073,6 +6625,7 @@ export function CResult_NoneNoneZ_err(): number { return nativeResponseValue; } // bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_NoneNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6081,6 +6634,7 @@ export function CResult_NoneNoneZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res); +/* @internal */ export function CResult_NoneNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6089,6 +6643,7 @@ export function CResult_NoneNoneZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NoneNoneZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6097,6 +6652,7 @@ export function CResult_NoneNoneZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NoneNoneZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6105,6 +6661,7 @@ export function CResult_NoneNoneZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b); +/* @internal */ export function C2Tuple_OutPointScriptZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6113,6 +6670,7 @@ export function C2Tuple_OutPointScriptZ_new(a: number, b: number): number { return nativeResponseValue; } // void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res); +/* @internal */ export function C2Tuple_OutPointScriptZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6121,6 +6679,7 @@ export function C2Tuple_OutPointScriptZ_free(_res: number): void { // debug statements here } // struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b); +/* @internal */ export function C2Tuple_u32ScriptZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6129,6 +6688,7 @@ export function C2Tuple_u32ScriptZ_new(a: number, b: number): number { return nativeResponseValue; } // void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res); +/* @internal */ export function C2Tuple_u32ScriptZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6137,6 +6697,7 @@ export function C2Tuple_u32ScriptZ_free(_res: number): void { // debug statements here } // void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res); +/* @internal */ export function CVec_C2Tuple_u32ScriptZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6145,6 +6706,7 @@ export function CVec_C2Tuple_u32ScriptZZ_free(_res: number): void { // debug statements here } // struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b); +/* @internal */ export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6153,6 +6715,7 @@ export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a: number, b: number): return nativeResponseValue; } // void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res); +/* @internal */ export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6161,6 +6724,7 @@ export function C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res: number): void { // debug statements here } // void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res); +/* @internal */ export function CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6169,6 +6733,7 @@ export function CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res: number): // debug statements here } // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); +/* @internal */ export function CVec_MonitorEventZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6177,6 +6742,7 @@ export function CVec_MonitorEventZ_free(_res: number): void { // debug statements here } // void CVec_EventZ_free(struct LDKCVec_EventZ _res); +/* @internal */ export function CVec_EventZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6185,6 +6751,7 @@ export function CVec_EventZ_free(_res: number): void { // debug statements here } // void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res); +/* @internal */ export function CVec_TransactionZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6193,6 +6760,7 @@ export function CVec_TransactionZ_free(_res: number): void { // debug statements here } // uintptr_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg); +/* @internal */ export function C2Tuple_usizeTransactionZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6201,6 +6769,7 @@ export function C2Tuple_usizeTransactionZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig); +/* @internal */ export function C2Tuple_usizeTransactionZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6209,6 +6778,7 @@ export function C2Tuple_usizeTransactionZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b); +/* @internal */ export function C2Tuple_usizeTransactionZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6217,6 +6787,7 @@ export function C2Tuple_usizeTransactionZ_new(a: number, b: number): number { return nativeResponseValue; } // void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res); +/* @internal */ export function C2Tuple_usizeTransactionZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6225,6 +6796,7 @@ export function C2Tuple_usizeTransactionZ_free(_res: number): void { // debug statements here } // void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res); +/* @internal */ export function CVec_C2Tuple_usizeTransactionZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6233,6 +6805,7 @@ export function CVec_C2Tuple_usizeTransactionZZ_free(_res: number): void { // debug statements here } // uintptr_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg); +/* @internal */ export function C2Tuple_u32TxOutZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6241,6 +6814,7 @@ export function C2Tuple_u32TxOutZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig); +/* @internal */ export function C2Tuple_u32TxOutZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6249,6 +6823,7 @@ export function C2Tuple_u32TxOutZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b); +/* @internal */ export function C2Tuple_u32TxOutZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6257,6 +6832,7 @@ export function C2Tuple_u32TxOutZ_new(a: number, b: number): number { return nativeResponseValue; } // void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res); +/* @internal */ export function C2Tuple_u32TxOutZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6265,6 +6841,7 @@ export function C2Tuple_u32TxOutZ_free(_res: number): void { // debug statements here } // void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res); +/* @internal */ export function CVec_C2Tuple_u32TxOutZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6273,6 +6850,7 @@ export function CVec_C2Tuple_u32TxOutZZ_free(_res: number): void { // debug statements here } // uintptr_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg); +/* @internal */ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6281,6 +6859,7 @@ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg: number): num return nativeResponseValue; } // struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig); +/* @internal */ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6289,6 +6868,7 @@ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig: number): number return nativeResponseValue; } // struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b); +/* @internal */ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6297,6 +6877,7 @@ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a: number, b: number): return nativeResponseValue; } // void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res); +/* @internal */ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6305,6 +6886,7 @@ export function C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res: number): void { // debug statements here } // void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res); +/* @internal */ export function CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6313,6 +6895,7 @@ export function CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res: number): v // debug statements here } // void CVec_TxidZ_free(struct LDKCVec_TxidZ _res); +/* @internal */ export function CVec_TxidZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6321,6 +6904,7 @@ export function CVec_TxidZ_free(_res: number): void { // debug statements here } // void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res); +/* @internal */ export function CVec_BalanceZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6329,6 +6913,7 @@ export function CVec_BalanceZ_free(_res: number): void { // debug statements here } // uintptr_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg); +/* @internal */ export function C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6337,6 +6922,7 @@ export function C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_clone(const struct LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR orig); +/* @internal */ export function C2Tuple_BlockHashChannelMonitorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6345,6 +6931,7 @@ export function C2Tuple_BlockHashChannelMonitorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b); +/* @internal */ export function C2Tuple_BlockHashChannelMonitorZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6353,6 +6940,7 @@ export function C2Tuple_BlockHashChannelMonitorZ_new(a: number, b: number): numb return nativeResponseValue; } // void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res); +/* @internal */ export function C2Tuple_BlockHashChannelMonitorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6361,6 +6949,7 @@ export function C2Tuple_BlockHashChannelMonitorZ_free(_res: number): void { // debug statements here } // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6369,6 +6958,7 @@ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o: numbe return nativeResponseValue; } // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6377,6 +6967,7 @@ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e: numb return nativeResponseValue; } // bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6385,6 +6976,7 @@ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o: nu return nativeResponseValue; } // void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6393,6 +6985,7 @@ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res: // debug statements here } // uintptr_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6401,6 +6994,7 @@ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(a return nativeResponseValue; } // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6409,6 +7003,7 @@ export function CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig: return nativeResponseValue; } // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o); +/* @internal */ export function CResult_RouteHopDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6417,6 +7012,7 @@ export function CResult_RouteHopDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_RouteHopDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6425,6 +7021,7 @@ export function CResult_RouteHopDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_RouteHopDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6433,6 +7030,7 @@ export function CResult_RouteHopDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res); +/* @internal */ export function CResult_RouteHopDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6441,6 +7039,7 @@ export function CResult_RouteHopDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_RouteHopDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6449,6 +7048,7 @@ export function CResult_RouteHopDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_RouteHopDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6457,6 +7057,7 @@ export function CResult_RouteHopDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res); +/* @internal */ export function CVec_RouteHopZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6465,6 +7066,7 @@ export function CVec_RouteHopZ_free(_res: number): void { // debug statements here } // void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res); +/* @internal */ export function CVec_CVec_RouteHopZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6473,6 +7075,7 @@ export function CVec_CVec_RouteHopZZ_free(_res: number): void { // debug statements here } // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o); +/* @internal */ export function CResult_RouteDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6481,6 +7084,7 @@ export function CResult_RouteDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_RouteDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6489,6 +7093,7 @@ export function CResult_RouteDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_RouteDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6497,6 +7102,7 @@ export function CResult_RouteDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res); +/* @internal */ export function CResult_RouteDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6505,6 +7111,7 @@ export function CResult_RouteDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_RouteDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6513,6 +7120,7 @@ export function CResult_RouteDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_RouteDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6521,6 +7129,7 @@ export function CResult_RouteDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o); +/* @internal */ export function CResult_RouteParametersDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6529,6 +7138,7 @@ export function CResult_RouteParametersDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_RouteParametersDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6537,6 +7147,7 @@ export function CResult_RouteParametersDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_RouteParametersDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6545,6 +7156,7 @@ export function CResult_RouteParametersDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res); +/* @internal */ export function CResult_RouteParametersDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6553,6 +7165,7 @@ export function CResult_RouteParametersDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_RouteParametersDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6561,6 +7174,7 @@ export function CResult_RouteParametersDecodeErrorZ_clone_ptr(arg: number): numb return nativeResponseValue; } // struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_RouteParametersDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6569,6 +7183,7 @@ export function CResult_RouteParametersDecodeErrorZ_clone(orig: number): number return nativeResponseValue; } // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); +/* @internal */ export function CVec_RouteHintZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6577,6 +7192,7 @@ export function CVec_RouteHintZ_free(_res: number): void { // debug statements here } // struct LDKCOption_u64Z COption_u64Z_some(uint64_t o); +/* @internal */ export function COption_u64Z_some(o: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6585,6 +7201,7 @@ export function COption_u64Z_some(o: bigint): number { return nativeResponseValue; } // struct LDKCOption_u64Z COption_u64Z_none(void); +/* @internal */ export function COption_u64Z_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6593,6 +7210,7 @@ export function COption_u64Z_none(): number { return nativeResponseValue; } // void COption_u64Z_free(struct LDKCOption_u64Z _res); +/* @internal */ export function COption_u64Z_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6601,6 +7219,7 @@ export function COption_u64Z_free(_res: number): void { // debug statements here } // uintptr_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg); +/* @internal */ export function COption_u64Z_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6609,6 +7228,7 @@ export function COption_u64Z_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig); +/* @internal */ export function COption_u64Z_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6617,6 +7237,7 @@ export function COption_u64Z_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_ok(struct LDKPayee o); +/* @internal */ export function CResult_PayeeDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6625,6 +7246,7 @@ export function CResult_PayeeDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_PayeeDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6633,6 +7255,7 @@ export function CResult_PayeeDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_PayeeDecodeErrorZ_is_ok(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_PayeeDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6641,6 +7264,7 @@ export function CResult_PayeeDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_PayeeDecodeErrorZ_free(struct LDKCResult_PayeeDecodeErrorZ _res); +/* @internal */ export function CResult_PayeeDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6649,6 +7273,7 @@ export function CResult_PayeeDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_PayeeDecodeErrorZ_clone_ptr(LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_PayeeDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6657,6 +7282,7 @@ export function CResult_PayeeDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_PayeeDecodeErrorZ CResult_PayeeDecodeErrorZ_clone(const struct LDKCResult_PayeeDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_PayeeDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6665,6 +7291,7 @@ export function CResult_PayeeDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res); +/* @internal */ export function CVec_RouteHintHopZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6673,6 +7300,7 @@ export function CVec_RouteHintHopZ_free(_res: number): void { // debug statements here } // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o); +/* @internal */ export function CResult_RouteHintDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6681,6 +7309,7 @@ export function CResult_RouteHintDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_RouteHintDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6689,6 +7318,7 @@ export function CResult_RouteHintDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_RouteHintDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6697,6 +7327,7 @@ export function CResult_RouteHintDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res); +/* @internal */ export function CResult_RouteHintDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6705,6 +7336,7 @@ export function CResult_RouteHintDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_RouteHintDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6713,6 +7345,7 @@ export function CResult_RouteHintDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_RouteHintDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6721,6 +7354,7 @@ export function CResult_RouteHintDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o); +/* @internal */ export function CResult_RouteHintHopDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6729,6 +7363,7 @@ export function CResult_RouteHintHopDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_RouteHintHopDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6737,6 +7372,7 @@ export function CResult_RouteHintHopDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_RouteHintHopDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6745,6 +7381,7 @@ export function CResult_RouteHintHopDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res); +/* @internal */ export function CResult_RouteHintHopDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6753,6 +7390,7 @@ export function CResult_RouteHintHopDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6761,6 +7399,7 @@ export function CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_RouteHintHopDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6769,6 +7408,7 @@ export function CResult_RouteHintHopDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); +/* @internal */ export function CVec_ChannelDetailsZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6777,6 +7417,7 @@ export function CVec_ChannelDetailsZ_free(_res: number): void { // debug statements here } // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); +/* @internal */ export function CResult_RouteLightningErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6785,6 +7426,7 @@ export function CResult_RouteLightningErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e); +/* @internal */ export function CResult_RouteLightningErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6793,6 +7435,7 @@ export function CResult_RouteLightningErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_RouteLightningErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6801,6 +7444,7 @@ export function CResult_RouteLightningErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res); +/* @internal */ export function CResult_RouteLightningErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6809,6 +7453,7 @@ export function CResult_RouteLightningErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_RouteLightningErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6817,6 +7462,7 @@ export function CResult_RouteLightningErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_RouteLightningErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6825,6 +7471,7 @@ export function CResult_RouteLightningErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); +/* @internal */ export function CResult_NoneLightningErrorZ_ok(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6833,6 +7480,7 @@ export function CResult_NoneLightningErrorZ_ok(): number { return nativeResponseValue; } // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); +/* @internal */ export function CResult_NoneLightningErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6841,6 +7489,7 @@ export function CResult_NoneLightningErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_NoneLightningErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6849,6 +7498,7 @@ export function CResult_NoneLightningErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); +/* @internal */ export function CResult_NoneLightningErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6857,6 +7507,7 @@ export function CResult_NoneLightningErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NoneLightningErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6865,6 +7516,7 @@ export function CResult_NoneLightningErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NoneLightningErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6873,6 +7525,7 @@ export function CResult_NoneLightningErrorZ_clone(orig: number): number { return nativeResponseValue; } // uintptr_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg); +/* @internal */ export function C2Tuple_PublicKeyTypeZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6881,6 +7534,7 @@ export function C2Tuple_PublicKeyTypeZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig); +/* @internal */ export function C2Tuple_PublicKeyTypeZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6889,6 +7543,7 @@ export function C2Tuple_PublicKeyTypeZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b); +/* @internal */ export function C2Tuple_PublicKeyTypeZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6897,6 +7552,7 @@ export function C2Tuple_PublicKeyTypeZ_new(a: number, b: number): number { return nativeResponseValue; } // void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res); +/* @internal */ export function C2Tuple_PublicKeyTypeZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6905,6 +7561,7 @@ export function C2Tuple_PublicKeyTypeZ_free(_res: number): void { // debug statements here } // void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res); +/* @internal */ export function CVec_C2Tuple_PublicKeyTypeZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6913,6 +7570,7 @@ export function CVec_C2Tuple_PublicKeyTypeZZ_free(_res: number): void { // debug statements here } // void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res); +/* @internal */ export function CVec_MessageSendEventZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6921,6 +7579,7 @@ export function CVec_MessageSendEventZ_free(_res: number): void { // debug statements here } // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o); +/* @internal */ export function CResult_boolLightningErrorZ_ok(o: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6929,6 +7588,7 @@ export function CResult_boolLightningErrorZ_ok(o: boolean): number { return nativeResponseValue; } // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e); +/* @internal */ export function CResult_boolLightningErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6937,6 +7597,7 @@ export function CResult_boolLightningErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_boolLightningErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6945,6 +7606,7 @@ export function CResult_boolLightningErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); +/* @internal */ export function CResult_boolLightningErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6953,6 +7615,7 @@ export function CResult_boolLightningErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_boolLightningErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6961,6 +7624,7 @@ export function CResult_boolLightningErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_boolLightningErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6969,6 +7633,7 @@ export function CResult_boolLightningErrorZ_clone(orig: number): number { return nativeResponseValue; } // uintptr_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg); +/* @internal */ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6977,6 +7642,7 @@ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr return nativeResponseValue; } // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig); +/* @internal */ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6985,6 +7651,7 @@ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(ori return nativeResponseValue; } // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); +/* @internal */ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a: number, b: number, c: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -6993,6 +7660,7 @@ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a: nu return nativeResponseValue; } // void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res); +/* @internal */ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7001,6 +7669,7 @@ export function C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res // debug statements here } // void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res); +/* @internal */ export function CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7009,6 +7678,7 @@ export function CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_fre // debug statements here } // void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res); +/* @internal */ export function CVec_NodeAnnouncementZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7017,6 +7687,7 @@ export function CVec_NodeAnnouncementZ_free(_res: number): void { // debug statements here } // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); +/* @internal */ export function CVec_PublicKeyZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7025,6 +7696,7 @@ export function CVec_PublicKeyZ_free(_res: number): void { // debug statements here } // void CVec_u8Z_free(struct LDKCVec_u8Z _res); +/* @internal */ export function CVec_u8Z_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7033,6 +7705,7 @@ export function CVec_u8Z_free(_res: number): void { // debug statements here } // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o); +/* @internal */ export function CResult_CVec_u8ZPeerHandleErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7041,6 +7714,7 @@ export function CResult_CVec_u8ZPeerHandleErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e); +/* @internal */ export function CResult_CVec_u8ZPeerHandleErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7049,6 +7723,7 @@ export function CResult_CVec_u8ZPeerHandleErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7057,6 +7732,7 @@ export function CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res); +/* @internal */ export function CResult_CVec_u8ZPeerHandleErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7065,6 +7741,7 @@ export function CResult_CVec_u8ZPeerHandleErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7073,6 +7750,7 @@ export function CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_CVec_u8ZPeerHandleErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7081,6 +7759,7 @@ export function CResult_CVec_u8ZPeerHandleErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void); +/* @internal */ export function CResult_NonePeerHandleErrorZ_ok(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7089,6 +7768,7 @@ export function CResult_NonePeerHandleErrorZ_ok(): number { return nativeResponseValue; } // struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e); +/* @internal */ export function CResult_NonePeerHandleErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7097,6 +7777,7 @@ export function CResult_NonePeerHandleErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_NonePeerHandleErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7105,6 +7786,7 @@ export function CResult_NonePeerHandleErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res); +/* @internal */ export function CResult_NonePeerHandleErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7113,6 +7795,7 @@ export function CResult_NonePeerHandleErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NonePeerHandleErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7121,6 +7804,7 @@ export function CResult_NonePeerHandleErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NonePeerHandleErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7129,6 +7813,7 @@ export function CResult_NonePeerHandleErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o); +/* @internal */ export function CResult_boolPeerHandleErrorZ_ok(o: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7137,6 +7822,7 @@ export function CResult_boolPeerHandleErrorZ_ok(o: boolean): number { return nativeResponseValue; } // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e); +/* @internal */ export function CResult_boolPeerHandleErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7145,6 +7831,7 @@ export function CResult_boolPeerHandleErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_boolPeerHandleErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7153,6 +7840,7 @@ export function CResult_boolPeerHandleErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res); +/* @internal */ export function CResult_boolPeerHandleErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7161,6 +7849,7 @@ export function CResult_boolPeerHandleErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_boolPeerHandleErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7169,6 +7858,7 @@ export function CResult_boolPeerHandleErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_boolPeerHandleErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7177,6 +7867,7 @@ export function CResult_boolPeerHandleErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o); +/* @internal */ export function CResult_TxOutAccessErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7185,6 +7876,7 @@ export function CResult_TxOutAccessErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e); +/* @internal */ export function CResult_TxOutAccessErrorZ_err(e: AccessError): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7193,6 +7885,7 @@ export function CResult_TxOutAccessErrorZ_err(e: AccessError): number { return nativeResponseValue; } // bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_TxOutAccessErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7201,6 +7894,7 @@ export function CResult_TxOutAccessErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res); +/* @internal */ export function CResult_TxOutAccessErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7209,6 +7903,7 @@ export function CResult_TxOutAccessErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_TxOutAccessErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7217,6 +7912,7 @@ export function CResult_TxOutAccessErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_TxOutAccessErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7225,6 +7921,7 @@ export function CResult_TxOutAccessErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void); +/* @internal */ export function CResult_NoneChannelMonitorUpdateErrZ_ok(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7233,6 +7930,7 @@ export function CResult_NoneChannelMonitorUpdateErrZ_ok(): number { return nativeResponseValue; } // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e); +/* @internal */ export function CResult_NoneChannelMonitorUpdateErrZ_err(e: ChannelMonitorUpdateErr): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7241,6 +7939,7 @@ export function CResult_NoneChannelMonitorUpdateErrZ_err(e: ChannelMonitorUpdate return nativeResponseValue; } // bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o); +/* @internal */ export function CResult_NoneChannelMonitorUpdateErrZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7249,6 +7948,7 @@ export function CResult_NoneChannelMonitorUpdateErrZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res); +/* @internal */ export function CResult_NoneChannelMonitorUpdateErrZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7257,6 +7957,7 @@ export function CResult_NoneChannelMonitorUpdateErrZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7265,6 +7966,7 @@ export function CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg: number): num return nativeResponseValue; } // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NoneChannelMonitorUpdateErrZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7273,6 +7975,7 @@ export function CResult_NoneChannelMonitorUpdateErrZ_clone(orig: number): number return nativeResponseValue; } // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o); +/* @internal */ export function COption_C2Tuple_usizeTransactionZZ_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7281,6 +7984,7 @@ export function COption_C2Tuple_usizeTransactionZZ_some(o: number): number { return nativeResponseValue; } // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void); +/* @internal */ export function COption_C2Tuple_usizeTransactionZZ_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7289,6 +7993,7 @@ export function COption_C2Tuple_usizeTransactionZZ_none(): number { return nativeResponseValue; } // void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res); +/* @internal */ export function COption_C2Tuple_usizeTransactionZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7297,6 +8002,7 @@ export function COption_C2Tuple_usizeTransactionZZ_free(_res: number): void { // debug statements here } // uintptr_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg); +/* @internal */ export function COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7305,6 +8011,7 @@ export function COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg: number): numbe return nativeResponseValue; } // struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig); +/* @internal */ export function COption_C2Tuple_usizeTransactionZZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7313,6 +8020,7 @@ export function COption_C2Tuple_usizeTransactionZZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o); +/* @internal */ export function COption_ClosureReasonZ_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7321,6 +8029,7 @@ export function COption_ClosureReasonZ_some(o: number): number { return nativeResponseValue; } // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void); +/* @internal */ export function COption_ClosureReasonZ_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7329,6 +8038,7 @@ export function COption_ClosureReasonZ_none(): number { return nativeResponseValue; } // void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res); +/* @internal */ export function COption_ClosureReasonZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7337,6 +8047,7 @@ export function COption_ClosureReasonZ_free(_res: number): void { // debug statements here } // uintptr_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg); +/* @internal */ export function COption_ClosureReasonZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7345,6 +8056,7 @@ export function COption_ClosureReasonZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig); +/* @internal */ export function COption_ClosureReasonZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7353,6 +8065,7 @@ export function COption_ClosureReasonZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o); +/* @internal */ export function CResult_COption_ClosureReasonZDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7361,6 +8074,7 @@ export function CResult_COption_ClosureReasonZDecodeErrorZ_ok(o: number): number return nativeResponseValue; } // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_COption_ClosureReasonZDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7369,6 +8083,7 @@ export function CResult_COption_ClosureReasonZDecodeErrorZ_err(e: number): numbe return nativeResponseValue; } // bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7377,6 +8092,7 @@ export function CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o: number): boo return nativeResponseValue; } // void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res); +/* @internal */ export function CResult_COption_ClosureReasonZDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7385,6 +8101,7 @@ export function CResult_COption_ClosureReasonZDecodeErrorZ_free(_res: number): v // debug statements here } // uintptr_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7393,6 +8110,7 @@ export function CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg: number return nativeResponseValue; } // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7401,6 +8119,7 @@ export function CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig: number): return nativeResponseValue; } // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o); +/* @internal */ export function COption_NetworkUpdateZ_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7409,6 +8128,7 @@ export function COption_NetworkUpdateZ_some(o: number): number { return nativeResponseValue; } // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void); +/* @internal */ export function COption_NetworkUpdateZ_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7417,6 +8137,7 @@ export function COption_NetworkUpdateZ_none(): number { return nativeResponseValue; } // void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res); +/* @internal */ export function COption_NetworkUpdateZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7425,6 +8146,7 @@ export function COption_NetworkUpdateZ_free(_res: number): void { // debug statements here } // uintptr_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg); +/* @internal */ export function COption_NetworkUpdateZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7433,6 +8155,7 @@ export function COption_NetworkUpdateZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig); +/* @internal */ export function COption_NetworkUpdateZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7441,6 +8164,7 @@ export function COption_NetworkUpdateZ_clone(orig: number): number { return nativeResponseValue; } // void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res); +/* @internal */ export function CVec_SpendableOutputDescriptorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7449,6 +8173,7 @@ export function CVec_SpendableOutputDescriptorZ_free(_res: number): void { // debug statements here } // struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o); +/* @internal */ export function COption_EventZ_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7457,6 +8182,7 @@ export function COption_EventZ_some(o: number): number { return nativeResponseValue; } // struct LDKCOption_EventZ COption_EventZ_none(void); +/* @internal */ export function COption_EventZ_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7465,6 +8191,7 @@ export function COption_EventZ_none(): number { return nativeResponseValue; } // void COption_EventZ_free(struct LDKCOption_EventZ _res); +/* @internal */ export function COption_EventZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7473,6 +8200,7 @@ export function COption_EventZ_free(_res: number): void { // debug statements here } // uintptr_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg); +/* @internal */ export function COption_EventZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7481,6 +8209,7 @@ export function COption_EventZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig); +/* @internal */ export function COption_EventZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7489,6 +8218,7 @@ export function COption_EventZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o); +/* @internal */ export function CResult_COption_EventZDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7497,6 +8227,7 @@ export function CResult_COption_EventZDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_COption_EventZDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7505,6 +8236,7 @@ export function CResult_COption_EventZDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_COption_EventZDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7513,6 +8245,7 @@ export function CResult_COption_EventZDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res); +/* @internal */ export function CResult_COption_EventZDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7521,6 +8254,7 @@ export function CResult_COption_EventZDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_COption_EventZDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7529,6 +8263,7 @@ export function CResult_COption_EventZDecodeErrorZ_clone_ptr(arg: number): numbe return nativeResponseValue; } // struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_COption_EventZDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7537,6 +8272,7 @@ export function CResult_COption_EventZDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o); +/* @internal */ export function CResult_NodeIdDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7545,6 +8281,7 @@ export function CResult_NodeIdDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_NodeIdDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7553,6 +8290,7 @@ export function CResult_NodeIdDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_NodeIdDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7561,6 +8299,7 @@ export function CResult_NodeIdDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res); +/* @internal */ export function CResult_NodeIdDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7569,6 +8308,7 @@ export function CResult_NodeIdDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NodeIdDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7577,6 +8317,7 @@ export function CResult_NodeIdDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NodeIdDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7585,6 +8326,7 @@ export function CResult_NodeIdDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o); +/* @internal */ export function CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7593,6 +8335,7 @@ export function CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o: number): number return nativeResponseValue; } // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_COption_NetworkUpdateZDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7601,6 +8344,7 @@ export function CResult_COption_NetworkUpdateZDecodeErrorZ_err(e: number): numbe return nativeResponseValue; } // bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7609,6 +8353,7 @@ export function CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o: number): boo return nativeResponseValue; } // void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res); +/* @internal */ export function CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7617,6 +8362,7 @@ export function CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res: number): v // debug statements here } // uintptr_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7625,6 +8371,7 @@ export function CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg: number return nativeResponseValue; } // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7633,6 +8380,7 @@ export function CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig: number): return nativeResponseValue; } // struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o); +/* @internal */ export function COption_AccessZ_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7641,6 +8389,7 @@ export function COption_AccessZ_some(o: number): number { return nativeResponseValue; } // struct LDKCOption_AccessZ COption_AccessZ_none(void); +/* @internal */ export function COption_AccessZ_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7649,6 +8398,7 @@ export function COption_AccessZ_none(): number { return nativeResponseValue; } // void COption_AccessZ_free(struct LDKCOption_AccessZ _res); +/* @internal */ export function COption_AccessZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7657,6 +8407,7 @@ export function COption_AccessZ_free(_res: number): void { // debug statements here } // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o); +/* @internal */ export function CResult_DirectionalChannelInfoDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7665,6 +8416,7 @@ export function CResult_DirectionalChannelInfoDecodeErrorZ_ok(o: number): number return nativeResponseValue; } // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_DirectionalChannelInfoDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7673,6 +8425,7 @@ export function CResult_DirectionalChannelInfoDecodeErrorZ_err(e: number): numbe return nativeResponseValue; } // bool CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7681,6 +8434,7 @@ export function CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(o: number): boo return nativeResponseValue; } // void CResult_DirectionalChannelInfoDecodeErrorZ_free(struct LDKCResult_DirectionalChannelInfoDecodeErrorZ _res); +/* @internal */ export function CResult_DirectionalChannelInfoDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7689,6 +8443,7 @@ export function CResult_DirectionalChannelInfoDecodeErrorZ_free(_res: number): v // debug statements here } // uintptr_t CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7697,6 +8452,7 @@ export function CResult_DirectionalChannelInfoDecodeErrorZ_clone_ptr(arg: number return nativeResponseValue; } // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_clone(const struct LDKCResult_DirectionalChannelInfoDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_DirectionalChannelInfoDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7705,6 +8461,7 @@ export function CResult_DirectionalChannelInfoDecodeErrorZ_clone(orig: number): return nativeResponseValue; } // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o); +/* @internal */ export function CResult_ChannelInfoDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7713,6 +8470,7 @@ export function CResult_ChannelInfoDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ChannelInfoDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7721,6 +8479,7 @@ export function CResult_ChannelInfoDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ChannelInfoDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7729,6 +8488,7 @@ export function CResult_ChannelInfoDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res); +/* @internal */ export function CResult_ChannelInfoDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7737,6 +8497,7 @@ export function CResult_ChannelInfoDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7745,6 +8506,7 @@ export function CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ChannelInfoDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7753,6 +8515,7 @@ export function CResult_ChannelInfoDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o); +/* @internal */ export function CResult_RoutingFeesDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7761,6 +8524,7 @@ export function CResult_RoutingFeesDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_RoutingFeesDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7769,6 +8533,7 @@ export function CResult_RoutingFeesDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_RoutingFeesDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7777,6 +8542,7 @@ export function CResult_RoutingFeesDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res); +/* @internal */ export function CResult_RoutingFeesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7785,6 +8551,7 @@ export function CResult_RoutingFeesDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7793,6 +8560,7 @@ export function CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_RoutingFeesDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7801,6 +8569,7 @@ export function CResult_RoutingFeesDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); +/* @internal */ export function CVec_NetAddressZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7809,6 +8578,7 @@ export function CVec_NetAddressZ_free(_res: number): void { // debug statements here } // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o); +/* @internal */ export function CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7817,6 +8587,7 @@ export function CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_NodeAnnouncementInfoDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7825,6 +8596,7 @@ export function CResult_NodeAnnouncementInfoDecodeErrorZ_err(e: number): number return nativeResponseValue; } // bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7833,6 +8605,7 @@ export function CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o: number): boole return nativeResponseValue; } // void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res); +/* @internal */ export function CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7841,6 +8614,7 @@ export function CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res: number): voi // debug statements here } // uintptr_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7849,6 +8623,7 @@ export function CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg: number): return nativeResponseValue; } // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7857,6 +8632,7 @@ export function CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig: number): nu return nativeResponseValue; } // void CVec_u64Z_free(struct LDKCVec_u64Z _res); +/* @internal */ export function CVec_u64Z_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7865,6 +8641,7 @@ export function CVec_u64Z_free(_res: number): void { // debug statements here } // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o); +/* @internal */ export function CResult_NodeInfoDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7873,6 +8650,7 @@ export function CResult_NodeInfoDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_NodeInfoDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7881,6 +8659,7 @@ export function CResult_NodeInfoDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_NodeInfoDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7889,6 +8668,7 @@ export function CResult_NodeInfoDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res); +/* @internal */ export function CResult_NodeInfoDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7897,6 +8677,7 @@ export function CResult_NodeInfoDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NodeInfoDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7905,6 +8686,7 @@ export function CResult_NodeInfoDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NodeInfoDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7913,6 +8695,7 @@ export function CResult_NodeInfoDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o); +/* @internal */ export function CResult_NetworkGraphDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7921,6 +8704,7 @@ export function CResult_NetworkGraphDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_NetworkGraphDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7929,6 +8713,7 @@ export function CResult_NetworkGraphDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_NetworkGraphDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7937,6 +8722,7 @@ export function CResult_NetworkGraphDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res); +/* @internal */ export function CResult_NetworkGraphDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7945,6 +8731,7 @@ export function CResult_NetworkGraphDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_NetworkGraphDecodeErrorZ_clone_ptr(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7953,6 +8740,7 @@ export function CResult_NetworkGraphDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_clone(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NetworkGraphDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7961,6 +8749,7 @@ export function CResult_NetworkGraphDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o); +/* @internal */ export function COption_CVec_NetAddressZZ_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7969,6 +8758,7 @@ export function COption_CVec_NetAddressZZ_some(o: number): number { return nativeResponseValue; } // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void); +/* @internal */ export function COption_CVec_NetAddressZZ_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7977,6 +8767,7 @@ export function COption_CVec_NetAddressZZ_none(): number { return nativeResponseValue; } // void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res); +/* @internal */ export function COption_CVec_NetAddressZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7985,6 +8776,7 @@ export function COption_CVec_NetAddressZZ_free(_res: number): void { // debug statements here } // uintptr_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg); +/* @internal */ export function COption_CVec_NetAddressZZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -7993,6 +8785,7 @@ export function COption_CVec_NetAddressZZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig); +/* @internal */ export function COption_CVec_NetAddressZZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8001,6 +8794,7 @@ export function COption_CVec_NetAddressZZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_ok(struct LDKScoringParameters o); +/* @internal */ export function CResult_ScoringParametersDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8009,6 +8803,7 @@ export function CResult_ScoringParametersDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ScoringParametersDecodeErrorZ CResult_ScoringParametersDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ScoringParametersDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8017,6 +8812,7 @@ export function CResult_ScoringParametersDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ScoringParametersDecodeErrorZ_is_ok(const struct LDKCResult_ScoringParametersDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ScoringParametersDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8025,6 +8821,7 @@ export function CResult_ScoringParametersDecodeErrorZ_is_ok(o: number): boolean return nativeResponseValue; } // void CResult_ScoringParametersDecodeErrorZ_free(struct LDKCResult_ScoringParametersDecodeErrorZ _res); +/* @internal */ export function CResult_ScoringParametersDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8033,6 +8830,7 @@ export function CResult_ScoringParametersDecodeErrorZ_free(_res: number): void { // debug statements here } // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o); +/* @internal */ export function CResult_InitFeaturesDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8041,6 +8839,7 @@ export function CResult_InitFeaturesDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_InitFeaturesDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8049,6 +8848,7 @@ export function CResult_InitFeaturesDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_InitFeaturesDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8057,6 +8857,7 @@ export function CResult_InitFeaturesDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res); +/* @internal */ export function CResult_InitFeaturesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8065,6 +8866,7 @@ export function CResult_InitFeaturesDecodeErrorZ_free(_res: number): void { // debug statements here } // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o); +/* @internal */ export function CResult_ChannelFeaturesDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8073,6 +8875,7 @@ export function CResult_ChannelFeaturesDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ChannelFeaturesDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8081,6 +8884,7 @@ export function CResult_ChannelFeaturesDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ChannelFeaturesDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8089,6 +8893,7 @@ export function CResult_ChannelFeaturesDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res); +/* @internal */ export function CResult_ChannelFeaturesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8097,6 +8902,7 @@ export function CResult_ChannelFeaturesDecodeErrorZ_free(_res: number): void { // debug statements here } // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o); +/* @internal */ export function CResult_NodeFeaturesDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8105,6 +8911,7 @@ export function CResult_NodeFeaturesDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_NodeFeaturesDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8113,6 +8920,7 @@ export function CResult_NodeFeaturesDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_NodeFeaturesDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8121,6 +8929,7 @@ export function CResult_NodeFeaturesDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res); +/* @internal */ export function CResult_NodeFeaturesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8129,6 +8938,7 @@ export function CResult_NodeFeaturesDecodeErrorZ_free(_res: number): void { // debug statements here } // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o); +/* @internal */ export function CResult_InvoiceFeaturesDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8137,6 +8947,7 @@ export function CResult_InvoiceFeaturesDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_InvoiceFeaturesDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8145,6 +8956,7 @@ export function CResult_InvoiceFeaturesDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8153,6 +8965,7 @@ export function CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res); +/* @internal */ export function CResult_InvoiceFeaturesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8161,6 +8974,7 @@ export function CResult_InvoiceFeaturesDecodeErrorZ_free(_res: number): void { // debug statements here } // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o); +/* @internal */ export function CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8169,6 +8983,7 @@ export function CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ChannelTypeFeaturesDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8177,6 +8992,7 @@ export function CResult_ChannelTypeFeaturesDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8185,6 +9001,7 @@ export function CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o: number): boolea return nativeResponseValue; } // void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res); +/* @internal */ export function CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8193,6 +9010,7 @@ export function CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res: number): void // debug statements here } // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o); +/* @internal */ export function CResult_NetAddressDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8201,6 +9019,7 @@ export function CResult_NetAddressDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_NetAddressDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8209,6 +9028,7 @@ export function CResult_NetAddressDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_NetAddressDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8217,6 +9037,7 @@ export function CResult_NetAddressDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res); +/* @internal */ export function CResult_NetAddressDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8225,6 +9046,7 @@ export function CResult_NetAddressDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NetAddressDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8233,6 +9055,7 @@ export function CResult_NetAddressDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NetAddressDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8241,6 +9064,7 @@ export function CResult_NetAddressDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res); +/* @internal */ export function CVec_UpdateAddHTLCZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8249,6 +9073,7 @@ export function CVec_UpdateAddHTLCZ_free(_res: number): void { // debug statements here } // void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res); +/* @internal */ export function CVec_UpdateFulfillHTLCZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8257,6 +9082,7 @@ export function CVec_UpdateFulfillHTLCZ_free(_res: number): void { // debug statements here } // void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res); +/* @internal */ export function CVec_UpdateFailHTLCZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8265,6 +9091,7 @@ export function CVec_UpdateFailHTLCZ_free(_res: number): void { // debug statements here } // void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res); +/* @internal */ export function CVec_UpdateFailMalformedHTLCZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8273,6 +9100,7 @@ export function CVec_UpdateFailMalformedHTLCZ_free(_res: number): void { // debug statements here } // struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o); +/* @internal */ export function CResult_AcceptChannelDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8281,6 +9109,7 @@ export function CResult_AcceptChannelDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_AcceptChannelDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8289,6 +9118,7 @@ export function CResult_AcceptChannelDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_AcceptChannelDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8297,6 +9127,7 @@ export function CResult_AcceptChannelDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res); +/* @internal */ export function CResult_AcceptChannelDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8305,6 +9136,7 @@ export function CResult_AcceptChannelDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8313,6 +9145,7 @@ export function CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_AcceptChannelDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8321,6 +9154,7 @@ export function CResult_AcceptChannelDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o); +/* @internal */ export function CResult_AnnouncementSignaturesDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8329,6 +9163,7 @@ export function CResult_AnnouncementSignaturesDecodeErrorZ_ok(o: number): number return nativeResponseValue; } // struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_AnnouncementSignaturesDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8337,6 +9172,7 @@ export function CResult_AnnouncementSignaturesDecodeErrorZ_err(e: number): numbe return nativeResponseValue; } // bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8345,6 +9181,7 @@ export function CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o: number): boo return nativeResponseValue; } // void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res); +/* @internal */ export function CResult_AnnouncementSignaturesDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8353,6 +9190,7 @@ export function CResult_AnnouncementSignaturesDecodeErrorZ_free(_res: number): v // debug statements here } // uintptr_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8361,6 +9199,7 @@ export function CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg: number return nativeResponseValue; } // struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8369,6 +9208,7 @@ export function CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig: number): return nativeResponseValue; } // struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o); +/* @internal */ export function CResult_ChannelReestablishDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8377,6 +9217,7 @@ export function CResult_ChannelReestablishDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ChannelReestablishDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8385,6 +9226,7 @@ export function CResult_ChannelReestablishDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ChannelReestablishDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8393,6 +9235,7 @@ export function CResult_ChannelReestablishDecodeErrorZ_is_ok(o: number): boolean return nativeResponseValue; } // void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res); +/* @internal */ export function CResult_ChannelReestablishDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8401,6 +9244,7 @@ export function CResult_ChannelReestablishDecodeErrorZ_free(_res: number): void // debug statements here } // uintptr_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8409,6 +9253,7 @@ export function CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg: number): n return nativeResponseValue; } // struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ChannelReestablishDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8417,6 +9262,7 @@ export function CResult_ChannelReestablishDecodeErrorZ_clone(orig: number): numb return nativeResponseValue; } // struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o); +/* @internal */ export function CResult_ClosingSignedDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8425,6 +9271,7 @@ export function CResult_ClosingSignedDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ClosingSignedDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8433,6 +9280,7 @@ export function CResult_ClosingSignedDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ClosingSignedDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8441,6 +9289,7 @@ export function CResult_ClosingSignedDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res); +/* @internal */ export function CResult_ClosingSignedDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8449,6 +9298,7 @@ export function CResult_ClosingSignedDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8457,6 +9307,7 @@ export function CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ClosingSignedDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8465,6 +9316,7 @@ export function CResult_ClosingSignedDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o); +/* @internal */ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8473,6 +9325,7 @@ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o: number): number return nativeResponseValue; } // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8481,6 +9334,7 @@ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e: number): number return nativeResponseValue; } // bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8489,6 +9343,7 @@ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o: number): bool return nativeResponseValue; } // void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res); +/* @internal */ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8497,6 +9352,7 @@ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res: number): vo // debug statements here } // uintptr_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8505,6 +9361,7 @@ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg: number) return nativeResponseValue; } // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8513,6 +9370,7 @@ export function CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig: number): n return nativeResponseValue; } // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o); +/* @internal */ export function CResult_CommitmentSignedDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8521,6 +9379,7 @@ export function CResult_CommitmentSignedDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_CommitmentSignedDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8529,6 +9388,7 @@ export function CResult_CommitmentSignedDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_CommitmentSignedDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8537,6 +9397,7 @@ export function CResult_CommitmentSignedDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res); +/* @internal */ export function CResult_CommitmentSignedDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8545,6 +9406,7 @@ export function CResult_CommitmentSignedDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8553,6 +9415,7 @@ export function CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg: number): num return nativeResponseValue; } // struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_CommitmentSignedDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8561,6 +9424,7 @@ export function CResult_CommitmentSignedDecodeErrorZ_clone(orig: number): number return nativeResponseValue; } // struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o); +/* @internal */ export function CResult_FundingCreatedDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8569,6 +9433,7 @@ export function CResult_FundingCreatedDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_FundingCreatedDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8577,6 +9442,7 @@ export function CResult_FundingCreatedDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_FundingCreatedDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8585,6 +9451,7 @@ export function CResult_FundingCreatedDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res); +/* @internal */ export function CResult_FundingCreatedDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8593,6 +9460,7 @@ export function CResult_FundingCreatedDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8601,6 +9469,7 @@ export function CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg: number): numbe return nativeResponseValue; } // struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_FundingCreatedDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8609,6 +9478,7 @@ export function CResult_FundingCreatedDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o); +/* @internal */ export function CResult_FundingSignedDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8617,6 +9487,7 @@ export function CResult_FundingSignedDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_FundingSignedDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8625,6 +9496,7 @@ export function CResult_FundingSignedDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_FundingSignedDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8633,6 +9505,7 @@ export function CResult_FundingSignedDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res); +/* @internal */ export function CResult_FundingSignedDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8641,6 +9514,7 @@ export function CResult_FundingSignedDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_FundingSignedDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8649,6 +9523,7 @@ export function CResult_FundingSignedDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_FundingSignedDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8657,6 +9532,7 @@ export function CResult_FundingSignedDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_ok(struct LDKFundingLocked o); +/* @internal */ export function CResult_FundingLockedDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8665,6 +9541,7 @@ export function CResult_FundingLockedDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_FundingLockedDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8673,6 +9550,7 @@ export function CResult_FundingLockedDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_FundingLockedDecodeErrorZ_is_ok(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_FundingLockedDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8681,6 +9559,7 @@ export function CResult_FundingLockedDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_FundingLockedDecodeErrorZ_free(struct LDKCResult_FundingLockedDecodeErrorZ _res); +/* @internal */ export function CResult_FundingLockedDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8689,6 +9568,7 @@ export function CResult_FundingLockedDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_FundingLockedDecodeErrorZ_clone_ptr(LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_FundingLockedDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8697,6 +9577,7 @@ export function CResult_FundingLockedDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_FundingLockedDecodeErrorZ CResult_FundingLockedDecodeErrorZ_clone(const struct LDKCResult_FundingLockedDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_FundingLockedDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8705,6 +9586,7 @@ export function CResult_FundingLockedDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o); +/* @internal */ export function CResult_InitDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8713,6 +9595,7 @@ export function CResult_InitDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_InitDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8721,6 +9604,7 @@ export function CResult_InitDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_InitDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8729,6 +9613,7 @@ export function CResult_InitDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res); +/* @internal */ export function CResult_InitDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8737,6 +9622,7 @@ export function CResult_InitDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_InitDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8745,6 +9631,7 @@ export function CResult_InitDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_InitDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8753,6 +9640,7 @@ export function CResult_InitDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o); +/* @internal */ export function CResult_OpenChannelDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8761,6 +9649,7 @@ export function CResult_OpenChannelDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_OpenChannelDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8769,6 +9658,7 @@ export function CResult_OpenChannelDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_OpenChannelDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8777,6 +9667,7 @@ export function CResult_OpenChannelDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res); +/* @internal */ export function CResult_OpenChannelDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8785,6 +9676,7 @@ export function CResult_OpenChannelDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_OpenChannelDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8793,6 +9685,7 @@ export function CResult_OpenChannelDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_OpenChannelDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8801,6 +9694,7 @@ export function CResult_OpenChannelDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o); +/* @internal */ export function CResult_RevokeAndACKDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8809,6 +9703,7 @@ export function CResult_RevokeAndACKDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_RevokeAndACKDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8817,6 +9712,7 @@ export function CResult_RevokeAndACKDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_RevokeAndACKDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8825,6 +9721,7 @@ export function CResult_RevokeAndACKDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res); +/* @internal */ export function CResult_RevokeAndACKDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8833,6 +9730,7 @@ export function CResult_RevokeAndACKDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8841,6 +9739,7 @@ export function CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_RevokeAndACKDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8849,6 +9748,7 @@ export function CResult_RevokeAndACKDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o); +/* @internal */ export function CResult_ShutdownDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8857,6 +9757,7 @@ export function CResult_ShutdownDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ShutdownDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8865,6 +9766,7 @@ export function CResult_ShutdownDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ShutdownDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8873,6 +9775,7 @@ export function CResult_ShutdownDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res); +/* @internal */ export function CResult_ShutdownDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8881,6 +9784,7 @@ export function CResult_ShutdownDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ShutdownDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8889,6 +9793,7 @@ export function CResult_ShutdownDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ShutdownDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8897,6 +9802,7 @@ export function CResult_ShutdownDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o); +/* @internal */ export function CResult_UpdateFailHTLCDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8905,6 +9811,7 @@ export function CResult_UpdateFailHTLCDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_UpdateFailHTLCDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8913,6 +9820,7 @@ export function CResult_UpdateFailHTLCDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8921,6 +9829,7 @@ export function CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res); +/* @internal */ export function CResult_UpdateFailHTLCDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8929,6 +9838,7 @@ export function CResult_UpdateFailHTLCDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8937,6 +9847,7 @@ export function CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg: number): numbe return nativeResponseValue; } // struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_UpdateFailHTLCDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8945,6 +9856,7 @@ export function CResult_UpdateFailHTLCDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o); +/* @internal */ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8953,6 +9865,7 @@ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o: number): numbe return nativeResponseValue; } // struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8961,6 +9874,7 @@ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e: number): numb return nativeResponseValue; } // bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8969,6 +9883,7 @@ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o: number): bo return nativeResponseValue; } // void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res); +/* @internal */ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8977,6 +9892,7 @@ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res: number): // debug statements here } // uintptr_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8985,6 +9901,7 @@ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg: numbe return nativeResponseValue; } // struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -8993,6 +9910,7 @@ export function CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig: number): return nativeResponseValue; } // struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o); +/* @internal */ export function CResult_UpdateFeeDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9001,6 +9919,7 @@ export function CResult_UpdateFeeDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_UpdateFeeDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9009,6 +9928,7 @@ export function CResult_UpdateFeeDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_UpdateFeeDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9017,6 +9937,7 @@ export function CResult_UpdateFeeDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res); +/* @internal */ export function CResult_UpdateFeeDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9025,6 +9946,7 @@ export function CResult_UpdateFeeDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9033,6 +9955,7 @@ export function CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_UpdateFeeDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9041,6 +9964,7 @@ export function CResult_UpdateFeeDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o); +/* @internal */ export function CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9049,6 +9973,7 @@ export function CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_UpdateFulfillHTLCDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9057,6 +9982,7 @@ export function CResult_UpdateFulfillHTLCDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9065,6 +9991,7 @@ export function CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o: number): boolean return nativeResponseValue; } // void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res); +/* @internal */ export function CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9073,6 +10000,7 @@ export function CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9081,6 +10009,7 @@ export function CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg: number): nu return nativeResponseValue; } // struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9089,6 +10018,7 @@ export function CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig: number): numbe return nativeResponseValue; } // struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o); +/* @internal */ export function CResult_UpdateAddHTLCDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9097,6 +10027,7 @@ export function CResult_UpdateAddHTLCDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_UpdateAddHTLCDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9105,6 +10036,7 @@ export function CResult_UpdateAddHTLCDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9113,6 +10045,7 @@ export function CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res); +/* @internal */ export function CResult_UpdateAddHTLCDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9121,6 +10054,7 @@ export function CResult_UpdateAddHTLCDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9129,6 +10063,7 @@ export function CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_UpdateAddHTLCDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9137,6 +10072,7 @@ export function CResult_UpdateAddHTLCDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o); +/* @internal */ export function CResult_PingDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9145,6 +10081,7 @@ export function CResult_PingDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_PingDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9153,6 +10090,7 @@ export function CResult_PingDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_PingDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9161,6 +10099,7 @@ export function CResult_PingDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res); +/* @internal */ export function CResult_PingDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9169,6 +10108,7 @@ export function CResult_PingDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_PingDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9177,6 +10117,7 @@ export function CResult_PingDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_PingDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9185,6 +10126,7 @@ export function CResult_PingDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o); +/* @internal */ export function CResult_PongDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9193,6 +10135,7 @@ export function CResult_PongDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_PongDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9201,6 +10144,7 @@ export function CResult_PongDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_PongDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9209,6 +10153,7 @@ export function CResult_PongDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res); +/* @internal */ export function CResult_PongDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9217,6 +10162,7 @@ export function CResult_PongDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_PongDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9225,6 +10171,7 @@ export function CResult_PongDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_PongDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9233,6 +10180,7 @@ export function CResult_PongDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o); +/* @internal */ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9241,6 +10189,7 @@ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o: number): n return nativeResponseValue; } // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9249,6 +10198,7 @@ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e: number): return nativeResponseValue; } // bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9257,6 +10207,7 @@ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o: number) return nativeResponseValue; } // void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res); +/* @internal */ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9265,6 +10216,7 @@ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res: numbe // debug statements here } // uintptr_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9273,6 +10225,7 @@ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg: n return nativeResponseValue; } // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9281,6 +10234,7 @@ export function CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig: numb return nativeResponseValue; } // struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o); +/* @internal */ export function CResult_ChannelAnnouncementDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9289,6 +10243,7 @@ export function CResult_ChannelAnnouncementDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ChannelAnnouncementDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9297,6 +10252,7 @@ export function CResult_ChannelAnnouncementDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9305,6 +10261,7 @@ export function CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o: number): boolea return nativeResponseValue; } // void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res); +/* @internal */ export function CResult_ChannelAnnouncementDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9313,6 +10270,7 @@ export function CResult_ChannelAnnouncementDecodeErrorZ_free(_res: number): void // debug statements here } // uintptr_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9321,6 +10279,7 @@ export function CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg: number): return nativeResponseValue; } // struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ChannelAnnouncementDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9329,6 +10288,7 @@ export function CResult_ChannelAnnouncementDecodeErrorZ_clone(orig: number): num return nativeResponseValue; } // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o); +/* @internal */ export function CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9337,6 +10297,7 @@ export function CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o: number): number return nativeResponseValue; } // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_UnsignedChannelUpdateDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9345,6 +10306,7 @@ export function CResult_UnsignedChannelUpdateDecodeErrorZ_err(e: number): number return nativeResponseValue; } // bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9353,6 +10315,7 @@ export function CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o: number): bool return nativeResponseValue; } // void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res); +/* @internal */ export function CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9361,6 +10324,7 @@ export function CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res: number): vo // debug statements here } // uintptr_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9369,6 +10333,7 @@ export function CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg: number) return nativeResponseValue; } // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9377,6 +10342,7 @@ export function CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig: number): n return nativeResponseValue; } // struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o); +/* @internal */ export function CResult_ChannelUpdateDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9385,6 +10351,7 @@ export function CResult_ChannelUpdateDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ChannelUpdateDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9393,6 +10360,7 @@ export function CResult_ChannelUpdateDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ChannelUpdateDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9401,6 +10369,7 @@ export function CResult_ChannelUpdateDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res); +/* @internal */ export function CResult_ChannelUpdateDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9409,6 +10378,7 @@ export function CResult_ChannelUpdateDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9417,6 +10387,7 @@ export function CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ChannelUpdateDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9425,6 +10396,7 @@ export function CResult_ChannelUpdateDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o); +/* @internal */ export function CResult_ErrorMessageDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9433,6 +10405,7 @@ export function CResult_ErrorMessageDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ErrorMessageDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9441,6 +10414,7 @@ export function CResult_ErrorMessageDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ErrorMessageDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9449,6 +10423,7 @@ export function CResult_ErrorMessageDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res); +/* @internal */ export function CResult_ErrorMessageDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9457,6 +10432,7 @@ export function CResult_ErrorMessageDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9465,6 +10441,7 @@ export function CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ErrorMessageDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9473,6 +10450,7 @@ export function CResult_ErrorMessageDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o); +/* @internal */ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9481,6 +10459,7 @@ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o: number): numb return nativeResponseValue; } // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9489,6 +10468,7 @@ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e: number): num return nativeResponseValue; } // bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9497,6 +10477,7 @@ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o: number): b return nativeResponseValue; } // void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res); +/* @internal */ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9505,6 +10486,7 @@ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res: number): // debug statements here } // uintptr_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9513,6 +10495,7 @@ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg: numb return nativeResponseValue; } // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9521,6 +10504,7 @@ export function CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig: number) return nativeResponseValue; } // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o); +/* @internal */ export function CResult_NodeAnnouncementDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9529,6 +10513,7 @@ export function CResult_NodeAnnouncementDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_NodeAnnouncementDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9537,6 +10522,7 @@ export function CResult_NodeAnnouncementDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_NodeAnnouncementDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9545,6 +10531,7 @@ export function CResult_NodeAnnouncementDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res); +/* @internal */ export function CResult_NodeAnnouncementDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9553,6 +10540,7 @@ export function CResult_NodeAnnouncementDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9561,6 +10549,7 @@ export function CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg: number): num return nativeResponseValue; } // struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NodeAnnouncementDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9569,6 +10558,7 @@ export function CResult_NodeAnnouncementDecodeErrorZ_clone(orig: number): number return nativeResponseValue; } // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o); +/* @internal */ export function CResult_QueryShortChannelIdsDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9577,6 +10567,7 @@ export function CResult_QueryShortChannelIdsDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_QueryShortChannelIdsDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9585,6 +10576,7 @@ export function CResult_QueryShortChannelIdsDecodeErrorZ_err(e: number): number return nativeResponseValue; } // bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9593,6 +10585,7 @@ export function CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o: number): boole return nativeResponseValue; } // void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res); +/* @internal */ export function CResult_QueryShortChannelIdsDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9601,6 +10594,7 @@ export function CResult_QueryShortChannelIdsDecodeErrorZ_free(_res: number): voi // debug statements here } // uintptr_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9609,6 +10603,7 @@ export function CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg: number): return nativeResponseValue; } // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9617,6 +10612,7 @@ export function CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig: number): nu return nativeResponseValue; } // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o); +/* @internal */ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9625,6 +10621,7 @@ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o: number): numbe return nativeResponseValue; } // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9633,6 +10630,7 @@ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e: number): numb return nativeResponseValue; } // bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9641,6 +10639,7 @@ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o: number): bo return nativeResponseValue; } // void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res); +/* @internal */ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9649,6 +10648,7 @@ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res: number): // debug statements here } // uintptr_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9657,6 +10657,7 @@ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg: numbe return nativeResponseValue; } // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9665,6 +10666,7 @@ export function CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig: number): return nativeResponseValue; } // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o); +/* @internal */ export function CResult_QueryChannelRangeDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9673,6 +10675,7 @@ export function CResult_QueryChannelRangeDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_QueryChannelRangeDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9681,6 +10684,7 @@ export function CResult_QueryChannelRangeDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_QueryChannelRangeDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9689,6 +10693,7 @@ export function CResult_QueryChannelRangeDecodeErrorZ_is_ok(o: number): boolean return nativeResponseValue; } // void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res); +/* @internal */ export function CResult_QueryChannelRangeDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9697,6 +10702,7 @@ export function CResult_QueryChannelRangeDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9705,6 +10711,7 @@ export function CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg: number): nu return nativeResponseValue; } // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_QueryChannelRangeDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9713,6 +10720,7 @@ export function CResult_QueryChannelRangeDecodeErrorZ_clone(orig: number): numbe return nativeResponseValue; } // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o); +/* @internal */ export function CResult_ReplyChannelRangeDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9721,6 +10729,7 @@ export function CResult_ReplyChannelRangeDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_ReplyChannelRangeDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9729,6 +10738,7 @@ export function CResult_ReplyChannelRangeDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9737,6 +10747,7 @@ export function CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o: number): boolean return nativeResponseValue; } // void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res); +/* @internal */ export function CResult_ReplyChannelRangeDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9745,6 +10756,7 @@ export function CResult_ReplyChannelRangeDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9753,6 +10765,7 @@ export function CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg: number): nu return nativeResponseValue; } // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_ReplyChannelRangeDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9761,6 +10774,7 @@ export function CResult_ReplyChannelRangeDecodeErrorZ_clone(orig: number): numbe return nativeResponseValue; } // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o); +/* @internal */ export function CResult_GossipTimestampFilterDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9769,6 +10783,7 @@ export function CResult_GossipTimestampFilterDecodeErrorZ_ok(o: number): number return nativeResponseValue; } // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_GossipTimestampFilterDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9777,6 +10792,7 @@ export function CResult_GossipTimestampFilterDecodeErrorZ_err(e: number): number return nativeResponseValue; } // bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9785,6 +10801,7 @@ export function CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o: number): bool return nativeResponseValue; } // void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res); +/* @internal */ export function CResult_GossipTimestampFilterDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9793,6 +10810,7 @@ export function CResult_GossipTimestampFilterDecodeErrorZ_free(_res: number): vo // debug statements here } // uintptr_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9801,6 +10819,7 @@ export function CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg: number) return nativeResponseValue; } // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_GossipTimestampFilterDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9809,6 +10828,7 @@ export function CResult_GossipTimestampFilterDecodeErrorZ_clone(orig: number): n return nativeResponseValue; } // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o); +/* @internal */ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9817,6 +10837,7 @@ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o: number) return nativeResponseValue; } // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9825,6 +10846,7 @@ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e: number return nativeResponseValue; } // bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9833,6 +10855,7 @@ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o: numb return nativeResponseValue; } // void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res); +/* @internal */ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9841,6 +10864,7 @@ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res: nu // debug statements here } // uintptr_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9849,6 +10873,7 @@ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg return nativeResponseValue; } // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9857,6 +10882,7 @@ export function CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig: n return nativeResponseValue; } // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o); +/* @internal */ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9865,6 +10891,7 @@ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o: number): return nativeResponseValue; } // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9873,6 +10900,7 @@ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e: number) return nativeResponseValue; } // bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9881,6 +10909,7 @@ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o: numbe return nativeResponseValue; } // void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res); +/* @internal */ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9889,6 +10918,7 @@ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res: num // debug statements here } // uintptr_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9897,6 +10927,7 @@ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg: return nativeResponseValue; } // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9905,6 +10936,7 @@ export function CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig: nu return nativeResponseValue; } // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o); +/* @internal */ export function CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9913,6 +10945,7 @@ export function CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o: number): num return nativeResponseValue; } // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_SpendableOutputDescriptorDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9921,6 +10954,7 @@ export function CResult_SpendableOutputDescriptorDecodeErrorZ_err(e: number): nu return nativeResponseValue; } // bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9929,6 +10963,7 @@ export function CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o: number): return nativeResponseValue; } // void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res); +/* @internal */ export function CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9937,6 +10972,7 @@ export function CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res: number) // debug statements here } // uintptr_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9945,6 +10981,7 @@ export function CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg: num return nativeResponseValue; } // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9953,6 +10990,7 @@ export function CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig: number return nativeResponseValue; } // uintptr_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg); +/* @internal */ export function C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9961,6 +10999,7 @@ export function C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig); +/* @internal */ export function C2Tuple_SignatureCVec_SignatureZZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9969,6 +11008,7 @@ export function C2Tuple_SignatureCVec_SignatureZZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b); +/* @internal */ export function C2Tuple_SignatureCVec_SignatureZZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9977,6 +11017,7 @@ export function C2Tuple_SignatureCVec_SignatureZZ_new(a: number, b: number): num return nativeResponseValue; } // void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res); +/* @internal */ export function C2Tuple_SignatureCVec_SignatureZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9985,6 +11026,7 @@ export function C2Tuple_SignatureCVec_SignatureZZ_free(_res: number): void { // debug statements here } // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o); +/* @internal */ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -9993,6 +11035,7 @@ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o: number): nu return nativeResponseValue; } // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void); +/* @internal */ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10001,6 +11044,7 @@ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(): number { return nativeResponseValue; } // bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10009,6 +11053,7 @@ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o: number): return nativeResponseValue; } // void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res); +/* @internal */ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10017,6 +11062,7 @@ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res: number // debug statements here } // uintptr_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg); +/* @internal */ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10025,6 +11071,7 @@ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg: nu return nativeResponseValue; } // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig); +/* @internal */ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10033,6 +11080,7 @@ export function CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig: numbe return nativeResponseValue; } // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o); +/* @internal */ export function CResult_SignatureNoneZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10041,6 +11089,7 @@ export function CResult_SignatureNoneZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void); +/* @internal */ export function CResult_SignatureNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10049,6 +11098,7 @@ export function CResult_SignatureNoneZ_err(): number { return nativeResponseValue; } // bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_SignatureNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10057,6 +11107,7 @@ export function CResult_SignatureNoneZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res); +/* @internal */ export function CResult_SignatureNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10065,6 +11116,7 @@ export function CResult_SignatureNoneZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg); +/* @internal */ export function CResult_SignatureNoneZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10073,6 +11125,7 @@ export function CResult_SignatureNoneZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig); +/* @internal */ export function CResult_SignatureNoneZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10081,6 +11134,7 @@ export function CResult_SignatureNoneZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o); +/* @internal */ export function CResult_SignDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10089,6 +11143,7 @@ export function CResult_SignDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_SignDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10097,6 +11152,7 @@ export function CResult_SignDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_SignDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10105,6 +11161,7 @@ export function CResult_SignDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res); +/* @internal */ export function CResult_SignDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10113,6 +11170,7 @@ export function CResult_SignDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_SignDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10121,6 +11179,7 @@ export function CResult_SignDecodeErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_SignDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10129,6 +11188,7 @@ export function CResult_SignDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o); +/* @internal */ export function CResult_RecoverableSignatureNoneZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10137,6 +11197,7 @@ export function CResult_RecoverableSignatureNoneZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void); +/* @internal */ export function CResult_RecoverableSignatureNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10145,6 +11206,7 @@ export function CResult_RecoverableSignatureNoneZ_err(): number { return nativeResponseValue; } // bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_RecoverableSignatureNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10153,6 +11215,7 @@ export function CResult_RecoverableSignatureNoneZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res); +/* @internal */ export function CResult_RecoverableSignatureNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10161,6 +11224,7 @@ export function CResult_RecoverableSignatureNoneZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg); +/* @internal */ export function CResult_RecoverableSignatureNoneZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10169,6 +11233,7 @@ export function CResult_RecoverableSignatureNoneZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig); +/* @internal */ export function CResult_RecoverableSignatureNoneZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10177,6 +11242,7 @@ export function CResult_RecoverableSignatureNoneZ_clone(orig: number): number { return nativeResponseValue; } // void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res); +/* @internal */ export function CVec_CVec_u8ZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10185,6 +11251,7 @@ export function CVec_CVec_u8ZZ_free(_res: number): void { // debug statements here } // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o); +/* @internal */ export function CResult_CVec_CVec_u8ZZNoneZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10193,6 +11260,7 @@ export function CResult_CVec_CVec_u8ZZNoneZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void); +/* @internal */ export function CResult_CVec_CVec_u8ZZNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10201,6 +11269,7 @@ export function CResult_CVec_CVec_u8ZZNoneZ_err(): number { return nativeResponseValue; } // bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_CVec_CVec_u8ZZNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10209,6 +11278,7 @@ export function CResult_CVec_CVec_u8ZZNoneZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res); +/* @internal */ export function CResult_CVec_CVec_u8ZZNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10217,6 +11287,7 @@ export function CResult_CVec_CVec_u8ZZNoneZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg); +/* @internal */ export function CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10225,6 +11296,7 @@ export function CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig); +/* @internal */ export function CResult_CVec_CVec_u8ZZNoneZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10233,6 +11305,7 @@ export function CResult_CVec_CVec_u8ZZNoneZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o); +/* @internal */ export function CResult_InMemorySignerDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10241,6 +11314,7 @@ export function CResult_InMemorySignerDecodeErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_InMemorySignerDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10249,6 +11323,7 @@ export function CResult_InMemorySignerDecodeErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_InMemorySignerDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10257,6 +11332,7 @@ export function CResult_InMemorySignerDecodeErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res); +/* @internal */ export function CResult_InMemorySignerDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10265,6 +11341,7 @@ export function CResult_InMemorySignerDecodeErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10273,6 +11350,7 @@ export function CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg: number): numbe return nativeResponseValue; } // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_InMemorySignerDecodeErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10281,6 +11359,7 @@ export function CResult_InMemorySignerDecodeErrorZ_clone(orig: number): number { return nativeResponseValue; } // void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res); +/* @internal */ export function CVec_TxOutZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10289,6 +11368,7 @@ export function CVec_TxOutZ_free(_res: number): void { // debug statements here } // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o); +/* @internal */ export function CResult_TransactionNoneZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10297,6 +11377,7 @@ export function CResult_TransactionNoneZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void); +/* @internal */ export function CResult_TransactionNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10305,6 +11386,7 @@ export function CResult_TransactionNoneZ_err(): number { return nativeResponseValue; } // bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_TransactionNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10313,6 +11395,7 @@ export function CResult_TransactionNoneZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res); +/* @internal */ export function CResult_TransactionNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10321,6 +11404,7 @@ export function CResult_TransactionNoneZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg); +/* @internal */ export function CResult_TransactionNoneZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10329,6 +11413,7 @@ export function CResult_TransactionNoneZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig); +/* @internal */ export function CResult_TransactionNoneZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10337,6 +11422,7 @@ export function CResult_TransactionNoneZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o); +/* @internal */ export function COption_FilterZ_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10345,6 +11431,7 @@ export function COption_FilterZ_some(o: number): number { return nativeResponseValue; } // struct LDKCOption_FilterZ COption_FilterZ_none(void); +/* @internal */ export function COption_FilterZ_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10353,6 +11440,7 @@ export function COption_FilterZ_none(): number { return nativeResponseValue; } // void COption_FilterZ_free(struct LDKCOption_FilterZ _res); +/* @internal */ export function COption_FilterZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10361,6 +11449,7 @@ export function COption_FilterZ_free(_res: number): void { // debug statements here } // struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o); +/* @internal */ export function CResult_LockedChannelMonitorNoneZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10369,6 +11458,7 @@ export function CResult_LockedChannelMonitorNoneZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void); +/* @internal */ export function CResult_LockedChannelMonitorNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10377,6 +11467,7 @@ export function CResult_LockedChannelMonitorNoneZ_err(): number { return nativeResponseValue; } // bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_LockedChannelMonitorNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10385,6 +11476,7 @@ export function CResult_LockedChannelMonitorNoneZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res); +/* @internal */ export function CResult_LockedChannelMonitorNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10393,6 +11485,7 @@ export function CResult_LockedChannelMonitorNoneZ_free(_res: number): void { // debug statements here } // void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res); +/* @internal */ export function CVec_OutPointZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10401,6 +11494,7 @@ export function CVec_OutPointZ_free(_res: number): void { // debug statements here } // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); +/* @internal */ export function CResult_NoneAPIErrorZ_ok(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10409,6 +11503,7 @@ export function CResult_NoneAPIErrorZ_ok(): number { return nativeResponseValue; } // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e); +/* @internal */ export function CResult_NoneAPIErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10417,6 +11512,7 @@ export function CResult_NoneAPIErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_NoneAPIErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10425,6 +11521,7 @@ export function CResult_NoneAPIErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res); +/* @internal */ export function CResult_NoneAPIErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10433,6 +11530,7 @@ export function CResult_NoneAPIErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NoneAPIErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10441,6 +11539,7 @@ export function CResult_NoneAPIErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NoneAPIErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10449,6 +11548,7 @@ export function CResult_NoneAPIErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCOption_u16Z COption_u16Z_some(uint16_t o); +/* @internal */ export function COption_u16Z_some(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10457,6 +11557,7 @@ export function COption_u16Z_some(o: number): number { return nativeResponseValue; } // struct LDKCOption_u16Z COption_u16Z_none(void); +/* @internal */ export function COption_u16Z_none(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10465,6 +11566,7 @@ export function COption_u16Z_none(): number { return nativeResponseValue; } // void COption_u16Z_free(struct LDKCOption_u16Z _res); +/* @internal */ export function COption_u16Z_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10473,6 +11575,7 @@ export function COption_u16Z_free(_res: number): void { // debug statements here } // uintptr_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg); +/* @internal */ export function COption_u16Z_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10481,6 +11584,7 @@ export function COption_u16Z_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig); +/* @internal */ export function COption_u16Z_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10489,6 +11593,7 @@ export function COption_u16Z_clone(orig: number): number { return nativeResponseValue; } // void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res); +/* @internal */ export function CVec_CResult_NoneAPIErrorZZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10497,6 +11602,7 @@ export function CVec_CResult_NoneAPIErrorZZ_free(_res: number): void { // debug statements here } // void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res); +/* @internal */ export function CVec_APIErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10505,6 +11611,7 @@ export function CVec_APIErrorZ_free(_res: number): void { // debug statements here } // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o); +/* @internal */ export function CResult__u832APIErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10513,6 +11620,7 @@ export function CResult__u832APIErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e); +/* @internal */ export function CResult__u832APIErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10521,6 +11629,7 @@ export function CResult__u832APIErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult__u832APIErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10529,6 +11638,7 @@ export function CResult__u832APIErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res); +/* @internal */ export function CResult__u832APIErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10537,6 +11647,7 @@ export function CResult__u832APIErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult__u832APIErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10545,6 +11656,7 @@ export function CResult__u832APIErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult__u832APIErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10553,6 +11665,7 @@ export function CResult__u832APIErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o); +/* @internal */ export function CResult_PaymentIdPaymentSendFailureZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10561,6 +11674,7 @@ export function CResult_PaymentIdPaymentSendFailureZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); +/* @internal */ export function CResult_PaymentIdPaymentSendFailureZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10569,6 +11683,7 @@ export function CResult_PaymentIdPaymentSendFailureZ_err(e: number): number { return nativeResponseValue; } // bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o); +/* @internal */ export function CResult_PaymentIdPaymentSendFailureZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10577,6 +11692,7 @@ export function CResult_PaymentIdPaymentSendFailureZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res); +/* @internal */ export function CResult_PaymentIdPaymentSendFailureZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10585,6 +11701,7 @@ export function CResult_PaymentIdPaymentSendFailureZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg); +/* @internal */ export function CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10593,6 +11710,7 @@ export function CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg: number): num return nativeResponseValue; } // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig); +/* @internal */ export function CResult_PaymentIdPaymentSendFailureZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10601,6 +11719,7 @@ export function CResult_PaymentIdPaymentSendFailureZ_clone(orig: number): number return nativeResponseValue; } // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); +/* @internal */ export function CResult_NonePaymentSendFailureZ_ok(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10609,6 +11728,7 @@ export function CResult_NonePaymentSendFailureZ_ok(): number { return nativeResponseValue; } // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e); +/* @internal */ export function CResult_NonePaymentSendFailureZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10617,6 +11737,7 @@ export function CResult_NonePaymentSendFailureZ_err(e: number): number { return nativeResponseValue; } // bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o); +/* @internal */ export function CResult_NonePaymentSendFailureZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10625,6 +11746,7 @@ export function CResult_NonePaymentSendFailureZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res); +/* @internal */ export function CResult_NonePaymentSendFailureZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10633,6 +11755,7 @@ export function CResult_NonePaymentSendFailureZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg); +/* @internal */ export function CResult_NonePaymentSendFailureZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10641,6 +11764,7 @@ export function CResult_NonePaymentSendFailureZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig); +/* @internal */ export function CResult_NonePaymentSendFailureZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10649,6 +11773,7 @@ export function CResult_NonePaymentSendFailureZ_clone(orig: number): number { return nativeResponseValue; } // uintptr_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg); +/* @internal */ export function C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10657,6 +11782,7 @@ export function C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig); +/* @internal */ export function C2Tuple_PaymentHashPaymentIdZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10665,6 +11791,7 @@ export function C2Tuple_PaymentHashPaymentIdZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b); +/* @internal */ export function C2Tuple_PaymentHashPaymentIdZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10673,6 +11800,7 @@ export function C2Tuple_PaymentHashPaymentIdZ_new(a: number, b: number): number return nativeResponseValue; } // void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res); +/* @internal */ export function C2Tuple_PaymentHashPaymentIdZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10681,6 +11809,7 @@ export function C2Tuple_PaymentHashPaymentIdZ_free(_res: number): void { // debug statements here } // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10689,6 +11818,7 @@ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o: n return nativeResponseValue; } // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10697,6 +11827,7 @@ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e: return nativeResponseValue; } // bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10705,6 +11836,7 @@ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o return nativeResponseValue; } // void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10713,6 +11845,7 @@ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_r // debug statements here } // uintptr_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10721,6 +11854,7 @@ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_p return nativeResponseValue; } // struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10729,6 +11863,7 @@ export function CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(o return nativeResponseValue; } // uintptr_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg); +/* @internal */ export function C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10737,6 +11872,7 @@ export function C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig); +/* @internal */ export function C2Tuple_PaymentHashPaymentSecretZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10745,6 +11881,7 @@ export function C2Tuple_PaymentHashPaymentSecretZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b); +/* @internal */ export function C2Tuple_PaymentHashPaymentSecretZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10753,6 +11890,7 @@ export function C2Tuple_PaymentHashPaymentSecretZ_new(a: number, b: number): num return nativeResponseValue; } // void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res); +/* @internal */ export function C2Tuple_PaymentHashPaymentSecretZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10761,6 +11899,7 @@ export function C2Tuple_PaymentHashPaymentSecretZ_free(_res: number): void { // debug statements here } // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10769,6 +11908,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o: number): nu return nativeResponseValue; } // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10777,6 +11917,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(): number { return nativeResponseValue; } // bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10785,6 +11926,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o: number): return nativeResponseValue; } // void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10793,6 +11935,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res: number // debug statements here } // uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10801,6 +11944,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg: nu return nativeResponseValue; } // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10809,6 +11953,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig: numbe return nativeResponseValue; } // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10817,6 +11962,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o: number) return nativeResponseValue; } // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10825,6 +11971,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e: number return nativeResponseValue; } // bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10833,6 +11980,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o: numb return nativeResponseValue; } // void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10841,6 +11989,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res: nu // debug statements here } // uintptr_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10849,6 +11998,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg return nativeResponseValue; } // struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10857,6 +12007,7 @@ export function CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig: n return nativeResponseValue; } // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o); +/* @internal */ export function CResult_PaymentSecretNoneZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10865,6 +12016,7 @@ export function CResult_PaymentSecretNoneZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void); +/* @internal */ export function CResult_PaymentSecretNoneZ_err(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10873,6 +12025,7 @@ export function CResult_PaymentSecretNoneZ_err(): number { return nativeResponseValue; } // bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o); +/* @internal */ export function CResult_PaymentSecretNoneZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10881,6 +12034,7 @@ export function CResult_PaymentSecretNoneZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res); +/* @internal */ export function CResult_PaymentSecretNoneZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10889,6 +12043,7 @@ export function CResult_PaymentSecretNoneZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg); +/* @internal */ export function CResult_PaymentSecretNoneZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10897,6 +12052,7 @@ export function CResult_PaymentSecretNoneZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig); +/* @internal */ export function CResult_PaymentSecretNoneZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10905,6 +12061,7 @@ export function CResult_PaymentSecretNoneZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o); +/* @internal */ export function CResult_PaymentSecretAPIErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10913,6 +12070,7 @@ export function CResult_PaymentSecretAPIErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e); +/* @internal */ export function CResult_PaymentSecretAPIErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10921,6 +12079,7 @@ export function CResult_PaymentSecretAPIErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_PaymentSecretAPIErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10929,6 +12088,7 @@ export function CResult_PaymentSecretAPIErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res); +/* @internal */ export function CResult_PaymentSecretAPIErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10937,6 +12097,7 @@ export function CResult_PaymentSecretAPIErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_PaymentSecretAPIErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10945,6 +12106,7 @@ export function CResult_PaymentSecretAPIErrorZ_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_PaymentSecretAPIErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10953,6 +12115,7 @@ export function CResult_PaymentSecretAPIErrorZ_clone(orig: number): number { return nativeResponseValue; } // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o); +/* @internal */ export function CResult_PaymentPreimageAPIErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10961,6 +12124,7 @@ export function CResult_PaymentPreimageAPIErrorZ_ok(o: number): number { return nativeResponseValue; } // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e); +/* @internal */ export function CResult_PaymentPreimageAPIErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10969,6 +12133,7 @@ export function CResult_PaymentPreimageAPIErrorZ_err(e: number): number { return nativeResponseValue; } // bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_PaymentPreimageAPIErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10977,6 +12142,7 @@ export function CResult_PaymentPreimageAPIErrorZ_is_ok(o: number): boolean { return nativeResponseValue; } // void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res); +/* @internal */ export function CResult_PaymentPreimageAPIErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10985,6 +12151,7 @@ export function CResult_PaymentPreimageAPIErrorZ_free(_res: number): void { // debug statements here } // uintptr_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg); +/* @internal */ export function CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -10993,6 +12160,7 @@ export function CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg: number): number return nativeResponseValue; } // struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig); +/* @internal */ export function CResult_PaymentPreimageAPIErrorZ_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11001,6 +12169,7 @@ export function CResult_PaymentPreimageAPIErrorZ_clone(orig: number): number { return nativeResponseValue; } // void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res); +/* @internal */ export function CVec_ChannelMonitorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11009,6 +12178,7 @@ export function CVec_ChannelMonitorZ_free(_res: number): void { // debug statements here } // struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b); +/* @internal */ export function C2Tuple_BlockHashChannelManagerZ_new(a: number, b: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11017,6 +12187,7 @@ export function C2Tuple_BlockHashChannelManagerZ_new(a: number, b: number): numb return nativeResponseValue; } // void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res); +/* @internal */ export function C2Tuple_BlockHashChannelManagerZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11025,6 +12196,7 @@ export function C2Tuple_BlockHashChannelManagerZ_free(_res: number): void { // debug statements here } // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11033,6 +12205,7 @@ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o: numbe return nativeResponseValue; } // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11041,6 +12214,7 @@ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e: numb return nativeResponseValue; } // bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11049,6 +12223,7 @@ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o: nu return nativeResponseValue; } // void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res); +/* @internal */ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11057,6 +12232,7 @@ export function CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res: // debug statements here } // void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr); +/* @internal */ export function PaymentPurpose_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11065,6 +12241,7 @@ export function PaymentPurpose_free(this_ptr: number): void { // debug statements here } // uintptr_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg); +/* @internal */ export function PaymentPurpose_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11073,6 +12250,7 @@ export function PaymentPurpose_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig); +/* @internal */ export function PaymentPurpose_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11081,6 +12259,7 @@ export function PaymentPurpose_clone(orig: number): number { return nativeResponseValue; } // struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret); +/* @internal */ export function PaymentPurpose_invoice_payment(payment_preimage: number, payment_secret: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11089,6 +12268,7 @@ export function PaymentPurpose_invoice_payment(payment_preimage: number, payment return nativeResponseValue; } // struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a); +/* @internal */ export function PaymentPurpose_spontaneous_payment(a: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11097,6 +12277,7 @@ export function PaymentPurpose_spontaneous_payment(a: number): number { return nativeResponseValue; } // void ClosureReason_free(struct LDKClosureReason this_ptr); +/* @internal */ export function ClosureReason_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11105,6 +12286,7 @@ export function ClosureReason_free(this_ptr: number): void { // debug statements here } // uintptr_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg); +/* @internal */ export function ClosureReason_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11113,6 +12295,7 @@ export function ClosureReason_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig); +/* @internal */ export function ClosureReason_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11121,6 +12304,7 @@ export function ClosureReason_clone(orig: number): number { return nativeResponseValue; } // struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg); +/* @internal */ export function ClosureReason_counterparty_force_closed(peer_msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11129,6 +12313,7 @@ export function ClosureReason_counterparty_force_closed(peer_msg: number): numbe return nativeResponseValue; } // struct LDKClosureReason ClosureReason_holder_force_closed(void); +/* @internal */ export function ClosureReason_holder_force_closed(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11137,6 +12322,7 @@ export function ClosureReason_holder_force_closed(): number { return nativeResponseValue; } // struct LDKClosureReason ClosureReason_cooperative_closure(void); +/* @internal */ export function ClosureReason_cooperative_closure(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11145,6 +12331,7 @@ export function ClosureReason_cooperative_closure(): number { return nativeResponseValue; } // struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void); +/* @internal */ export function ClosureReason_commitment_tx_confirmed(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11153,6 +12340,7 @@ export function ClosureReason_commitment_tx_confirmed(): number { return nativeResponseValue; } // struct LDKClosureReason ClosureReason_funding_timed_out(void); +/* @internal */ export function ClosureReason_funding_timed_out(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11161,6 +12349,7 @@ export function ClosureReason_funding_timed_out(): number { return nativeResponseValue; } // struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err); +/* @internal */ export function ClosureReason_processing_error(err: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11169,6 +12358,7 @@ export function ClosureReason_processing_error(err: number): number { return nativeResponseValue; } // struct LDKClosureReason ClosureReason_disconnected_peer(void); +/* @internal */ export function ClosureReason_disconnected_peer(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11177,6 +12367,7 @@ export function ClosureReason_disconnected_peer(): number { return nativeResponseValue; } // struct LDKClosureReason ClosureReason_outdated_channel_manager(void); +/* @internal */ export function ClosureReason_outdated_channel_manager(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11185,6 +12376,7 @@ export function ClosureReason_outdated_channel_manager(): number { return nativeResponseValue; } // struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj); +/* @internal */ export function ClosureReason_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11193,6 +12385,7 @@ export function ClosureReason_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser); +/* @internal */ export function ClosureReason_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11201,6 +12394,7 @@ export function ClosureReason_read(ser: number): number { return nativeResponseValue; } // void Event_free(struct LDKEvent this_ptr); +/* @internal */ export function Event_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11209,6 +12403,7 @@ export function Event_free(this_ptr: number): void { // debug statements here } // uintptr_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg); +/* @internal */ export function Event_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11217,6 +12412,7 @@ export function Event_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); +/* @internal */ export function Event_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11225,6 +12421,7 @@ export function Event_clone(orig: number): number { return nativeResponseValue; } // struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id); +/* @internal */ export function Event_funding_generation_ready(temporary_channel_id: number, channel_value_satoshis: bigint, output_script: number, user_channel_id: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11233,6 +12430,7 @@ export function Event_funding_generation_ready(temporary_channel_id: number, cha return nativeResponseValue; } // struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amt, struct LDKPaymentPurpose purpose); +/* @internal */ export function Event_payment_received(payment_hash: number, amt: bigint, purpose: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11241,6 +12439,7 @@ export function Event_payment_received(payment_hash: number, amt: bigint, purpos return nativeResponseValue; } // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat); +/* @internal */ export function Event_payment_sent(payment_id: number, payment_preimage: number, payment_hash: number, fee_paid_msat: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11249,6 +12448,7 @@ export function Event_payment_sent(payment_id: number, payment_preimage: number, return nativeResponseValue; } // struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry); +/* @internal */ export function Event_payment_path_failed(payment_id: number, payment_hash: number, rejected_by_dest: boolean, network_update: number, all_paths_failed: boolean, path: number, short_channel_id: number, retry: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11257,6 +12457,7 @@ export function Event_payment_path_failed(payment_id: number, payment_hash: numb return nativeResponseValue; } // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash); +/* @internal */ export function Event_payment_failed(payment_id: number, payment_hash: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11265,6 +12466,7 @@ export function Event_payment_failed(payment_id: number, payment_hash: number): return nativeResponseValue; } // struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable); +/* @internal */ export function Event_pending_htlcs_forwardable(time_forwardable: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11273,6 +12475,7 @@ export function Event_pending_htlcs_forwardable(time_forwardable: bigint): numbe return nativeResponseValue; } // struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs); +/* @internal */ export function Event_spendable_outputs(outputs: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11281,6 +12484,7 @@ export function Event_spendable_outputs(outputs: number): number { return nativeResponseValue; } // struct LDKEvent Event_payment_forwarded(struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx); +/* @internal */ export function Event_payment_forwarded(fee_earned_msat: number, claim_from_onchain_tx: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11289,6 +12493,7 @@ export function Event_payment_forwarded(fee_earned_msat: number, claim_from_onch return nativeResponseValue; } // struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason); +/* @internal */ export function Event_channel_closed(channel_id: number, user_channel_id: bigint, reason: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11297,6 +12502,7 @@ export function Event_channel_closed(channel_id: number, user_channel_id: bigint return nativeResponseValue; } // struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction); +/* @internal */ export function Event_discard_funding(channel_id: number, transaction: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11305,6 +12511,7 @@ export function Event_discard_funding(channel_id: number, transaction: number): return nativeResponseValue; } // struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path); +/* @internal */ export function Event_payment_path_successful(payment_id: number, payment_hash: number, path: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11313,6 +12520,7 @@ export function Event_payment_path_successful(payment_id: number, payment_hash: return nativeResponseValue; } // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); +/* @internal */ export function Event_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11321,6 +12529,7 @@ export function Event_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser); +/* @internal */ export function Event_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11329,6 +12538,7 @@ export function Event_read(ser: number): number { return nativeResponseValue; } // void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr); +/* @internal */ export function MessageSendEvent_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11337,6 +12547,7 @@ export function MessageSendEvent_free(this_ptr: number): void { // debug statements here } // uintptr_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg); +/* @internal */ export function MessageSendEvent_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11345,6 +12556,7 @@ export function MessageSendEvent_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig); +/* @internal */ export function MessageSendEvent_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11353,6 +12565,7 @@ export function MessageSendEvent_clone(orig: number): number { return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg); +/* @internal */ export function MessageSendEvent_send_accept_channel(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11361,6 +12574,7 @@ export function MessageSendEvent_send_accept_channel(node_id: number, msg: numbe return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg); +/* @internal */ export function MessageSendEvent_send_open_channel(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11369,6 +12583,7 @@ export function MessageSendEvent_send_open_channel(node_id: number, msg: number) return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg); +/* @internal */ export function MessageSendEvent_send_funding_created(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11377,6 +12592,7 @@ export function MessageSendEvent_send_funding_created(node_id: number, msg: numb return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg); +/* @internal */ export function MessageSendEvent_send_funding_signed(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11385,6 +12601,7 @@ export function MessageSendEvent_send_funding_signed(node_id: number, msg: numbe return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_funding_locked(struct LDKPublicKey node_id, struct LDKFundingLocked msg); +/* @internal */ export function MessageSendEvent_send_funding_locked(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11393,6 +12610,7 @@ export function MessageSendEvent_send_funding_locked(node_id: number, msg: numbe return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg); +/* @internal */ export function MessageSendEvent_send_announcement_signatures(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11401,6 +12619,7 @@ export function MessageSendEvent_send_announcement_signatures(node_id: number, m return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates); +/* @internal */ export function MessageSendEvent_update_htlcs(node_id: number, updates: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11409,6 +12628,7 @@ export function MessageSendEvent_update_htlcs(node_id: number, updates: number): return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg); +/* @internal */ export function MessageSendEvent_send_revoke_and_ack(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11417,6 +12637,7 @@ export function MessageSendEvent_send_revoke_and_ack(node_id: number, msg: numbe return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg); +/* @internal */ export function MessageSendEvent_send_closing_signed(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11425,6 +12646,7 @@ export function MessageSendEvent_send_closing_signed(node_id: number, msg: numbe return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg); +/* @internal */ export function MessageSendEvent_send_shutdown(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11433,6 +12655,7 @@ export function MessageSendEvent_send_shutdown(node_id: number, msg: number): nu return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg); +/* @internal */ export function MessageSendEvent_send_channel_reestablish(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11441,6 +12664,7 @@ export function MessageSendEvent_send_channel_reestablish(node_id: number, msg: return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg); +/* @internal */ export function MessageSendEvent_broadcast_channel_announcement(msg: number, update_msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11449,6 +12673,7 @@ export function MessageSendEvent_broadcast_channel_announcement(msg: number, upd return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg); +/* @internal */ export function MessageSendEvent_broadcast_node_announcement(msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11457,6 +12682,7 @@ export function MessageSendEvent_broadcast_node_announcement(msg: number): numbe return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg); +/* @internal */ export function MessageSendEvent_broadcast_channel_update(msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11465,6 +12691,7 @@ export function MessageSendEvent_broadcast_channel_update(msg: number): number { return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg); +/* @internal */ export function MessageSendEvent_send_channel_update(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11473,6 +12700,7 @@ export function MessageSendEvent_send_channel_update(node_id: number, msg: numbe return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action); +/* @internal */ export function MessageSendEvent_handle_error(node_id: number, action: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11481,6 +12709,7 @@ export function MessageSendEvent_handle_error(node_id: number, action: number): return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg); +/* @internal */ export function MessageSendEvent_send_channel_range_query(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11489,6 +12718,7 @@ export function MessageSendEvent_send_channel_range_query(node_id: number, msg: return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg); +/* @internal */ export function MessageSendEvent_send_short_ids_query(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11497,6 +12727,7 @@ export function MessageSendEvent_send_short_ids_query(node_id: number, msg: numb return nativeResponseValue; } // struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg); +/* @internal */ export function MessageSendEvent_send_reply_channel_range(node_id: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11505,6 +12736,7 @@ export function MessageSendEvent_send_reply_channel_range(node_id: number, msg: return nativeResponseValue; } // void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr); +/* @internal */ export function MessageSendEventsProvider_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11513,6 +12745,7 @@ export function MessageSendEventsProvider_free(this_ptr: number): void { // debug statements here } // void EventsProvider_free(struct LDKEventsProvider this_ptr); +/* @internal */ export function EventsProvider_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11521,6 +12754,7 @@ export function EventsProvider_free(this_ptr: number): void { // debug statements here } // void EventHandler_free(struct LDKEventHandler this_ptr); +/* @internal */ export function EventHandler_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11529,6 +12763,7 @@ export function EventHandler_free(this_ptr: number): void { // debug statements here } // void APIError_free(struct LDKAPIError this_ptr); +/* @internal */ export function APIError_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11537,6 +12772,7 @@ export function APIError_free(this_ptr: number): void { // debug statements here } // uintptr_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg); +/* @internal */ export function APIError_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11545,6 +12781,7 @@ export function APIError_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig); +/* @internal */ export function APIError_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11553,6 +12790,7 @@ export function APIError_clone(orig: number): number { return nativeResponseValue; } // struct LDKAPIError APIError_apimisuse_error(struct LDKStr err); +/* @internal */ export function APIError_apimisuse_error(err: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11561,6 +12799,7 @@ export function APIError_apimisuse_error(err: number): number { return nativeResponseValue; } // struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate); +/* @internal */ export function APIError_fee_rate_too_high(err: number, feerate: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11569,6 +12808,7 @@ export function APIError_fee_rate_too_high(err: number, feerate: number): number return nativeResponseValue; } // struct LDKAPIError APIError_route_error(struct LDKStr err); +/* @internal */ export function APIError_route_error(err: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11577,6 +12817,7 @@ export function APIError_route_error(err: number): number { return nativeResponseValue; } // struct LDKAPIError APIError_channel_unavailable(struct LDKStr err); +/* @internal */ export function APIError_channel_unavailable(err: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11585,6 +12826,7 @@ export function APIError_channel_unavailable(err: number): number { return nativeResponseValue; } // struct LDKAPIError APIError_monitor_update_failed(void); +/* @internal */ export function APIError_monitor_update_failed(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11593,6 +12835,7 @@ export function APIError_monitor_update_failed(): number { return nativeResponseValue; } // struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script); +/* @internal */ export function APIError_incompatible_shutdown_script(script: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11601,6 +12844,7 @@ export function APIError_incompatible_shutdown_script(script: number): number { return nativeResponseValue; } // struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]); +/* @internal */ export function sign(msg: number, sk: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11609,6 +12853,7 @@ export function sign(msg: number, sk: number): number { return nativeResponseValue; } // struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig); +/* @internal */ export function recover_pk(msg: number, sig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11617,6 +12862,7 @@ export function recover_pk(msg: number, sig: number): number { return nativeResponseValue; } // bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk); +/* @internal */ export function verify(msg: number, sig: number, pk: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11625,6 +12871,7 @@ export function verify(msg: number, sig: number, pk: number): boolean { return nativeResponseValue; } // enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig); +/* @internal */ export function Level_clone(orig: number): Level { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11633,6 +12880,7 @@ export function Level_clone(orig: number): Level { return nativeResponseValue; } // enum LDKLevel Level_gossip(void); +/* @internal */ export function Level_gossip(): Level { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11641,6 +12889,7 @@ export function Level_gossip(): Level { return nativeResponseValue; } // enum LDKLevel Level_trace(void); +/* @internal */ export function Level_trace(): Level { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11649,6 +12898,7 @@ export function Level_trace(): Level { return nativeResponseValue; } // enum LDKLevel Level_debug(void); +/* @internal */ export function Level_debug(): Level { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11657,6 +12907,7 @@ export function Level_debug(): Level { return nativeResponseValue; } // enum LDKLevel Level_info(void); +/* @internal */ export function Level_info(): Level { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11665,6 +12916,7 @@ export function Level_info(): Level { return nativeResponseValue; } // enum LDKLevel Level_warn(void); +/* @internal */ export function Level_warn(): Level { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11673,6 +12925,7 @@ export function Level_warn(): Level { return nativeResponseValue; } // enum LDKLevel Level_error(void); +/* @internal */ export function Level_error(): Level { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11681,6 +12934,7 @@ export function Level_error(): Level { return nativeResponseValue; } // bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b); +/* @internal */ export function Level_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11689,6 +12943,7 @@ export function Level_eq(a: number, b: number): boolean { return nativeResponseValue; } // uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o); +/* @internal */ export function Level_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11697,6 +12952,7 @@ export function Level_hash(o: number): bigint { return nativeResponseValue; } // MUST_USE_RES enum LDKLevel Level_max(void); +/* @internal */ export function Level_max(): Level { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11705,6 +12961,7 @@ export function Level_max(): Level { return nativeResponseValue; } // void Record_free(struct LDKRecord this_obj); +/* @internal */ export function Record_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11713,6 +12970,7 @@ export function Record_free(this_obj: number): void { // debug statements here } // enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr); +/* @internal */ export function Record_get_level(this_ptr: number): Level { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11721,6 +12979,7 @@ export function Record_get_level(this_ptr: number): Level { return nativeResponseValue; } // void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val); +/* @internal */ export function Record_set_level(this_ptr: number, val: Level): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11729,6 +12988,7 @@ export function Record_set_level(this_ptr: number, val: Level): void { // debug statements here } // struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr); +/* @internal */ export function Record_get_args(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11737,6 +12997,7 @@ export function Record_get_args(this_ptr: number): number { return nativeResponseValue; } // void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val); +/* @internal */ export function Record_set_args(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11745,6 +13006,7 @@ export function Record_set_args(this_ptr: number, val: number): void { // debug statements here } // struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr); +/* @internal */ export function Record_get_module_path(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11753,6 +13015,7 @@ export function Record_get_module_path(this_ptr: number): number { return nativeResponseValue; } // void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val); +/* @internal */ export function Record_set_module_path(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11761,6 +13024,7 @@ export function Record_set_module_path(this_ptr: number, val: number): void { // debug statements here } // struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr); +/* @internal */ export function Record_get_file(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11769,6 +13033,7 @@ export function Record_get_file(this_ptr: number): number { return nativeResponseValue; } // void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val); +/* @internal */ export function Record_set_file(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11777,6 +13042,7 @@ export function Record_set_file(this_ptr: number, val: number): void { // debug statements here } // uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr); +/* @internal */ export function Record_get_line(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11785,6 +13051,7 @@ export function Record_get_line(this_ptr: number): number { return nativeResponseValue; } // void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function Record_set_line(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11793,6 +13060,7 @@ export function Record_set_line(this_ptr: number, val: number): void { // debug statements here } // uintptr_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg); +/* @internal */ export function Record_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11801,6 +13069,7 @@ export function Record_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig); +/* @internal */ export function Record_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11809,6 +13078,7 @@ export function Record_clone(orig: number): number { return nativeResponseValue; } // void Logger_free(struct LDKLogger this_ptr); +/* @internal */ export function Logger_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11817,6 +13087,7 @@ export function Logger_free(this_ptr: number): void { // debug statements here } // void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj); +/* @internal */ export function ChannelHandshakeConfig_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11825,6 +13096,7 @@ export function ChannelHandshakeConfig_free(this_obj: number): void { // debug statements here } // uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelHandshakeConfig_get_minimum_depth(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11833,6 +13105,7 @@ export function ChannelHandshakeConfig_get_minimum_depth(this_ptr: number): numb return nativeResponseValue; } // void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function ChannelHandshakeConfig_set_minimum_depth(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11841,6 +13114,7 @@ export function ChannelHandshakeConfig_set_minimum_depth(this_ptr: number, val: // debug statements here } // uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelHandshakeConfig_get_our_to_self_delay(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11849,6 +13123,7 @@ export function ChannelHandshakeConfig_get_our_to_self_delay(this_ptr: number): return nativeResponseValue; } // void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function ChannelHandshakeConfig_set_our_to_self_delay(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11857,6 +13132,7 @@ export function ChannelHandshakeConfig_set_our_to_self_delay(this_ptr: number, v // debug statements here } // uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11865,6 +13141,7 @@ export function ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr: numbe return nativeResponseValue; } // void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11873,6 +13150,7 @@ export function ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr: numbe // debug statements here } // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg); +/* @internal */ export function ChannelHandshakeConfig_new(minimum_depth_arg: number, our_to_self_delay_arg: number, our_htlc_minimum_msat_arg: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11881,6 +13159,7 @@ export function ChannelHandshakeConfig_new(minimum_depth_arg: number, our_to_sel return nativeResponseValue; } // uintptr_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg); +/* @internal */ export function ChannelHandshakeConfig_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11889,6 +13168,7 @@ export function ChannelHandshakeConfig_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); +/* @internal */ export function ChannelHandshakeConfig_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11897,6 +13177,7 @@ export function ChannelHandshakeConfig_clone(orig: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void); +/* @internal */ export function ChannelHandshakeConfig_default(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11905,6 +13186,7 @@ export function ChannelHandshakeConfig_default(): number { return nativeResponseValue; } // void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj); +/* @internal */ export function ChannelHandshakeLimits_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11913,6 +13195,7 @@ export function ChannelHandshakeLimits_free(this_obj: number): void { // debug statements here } // uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11921,6 +13204,7 @@ export function ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr: number return nativeResponseValue; } // void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11929,6 +13213,7 @@ export function ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr: number // debug statements here } // uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11937,6 +13222,7 @@ export function ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr: numbe return nativeResponseValue; } // void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11945,6 +13231,7 @@ export function ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr: numbe // debug statements here } // uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11953,6 +13240,7 @@ export function ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(thi return nativeResponseValue; } // void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11961,6 +13249,7 @@ export function ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(thi // debug statements here } // uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11969,6 +13258,7 @@ export function ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr return nativeResponseValue; } // void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11977,6 +13267,7 @@ export function ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr // debug statements here } // uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11985,6 +13276,7 @@ export function ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr: numb return nativeResponseValue; } // void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -11993,6 +13285,7 @@ export function ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr: numb // debug statements here } // uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelHandshakeLimits_get_max_minimum_depth(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12001,6 +13294,7 @@ export function ChannelHandshakeLimits_get_max_minimum_depth(this_ptr: number): return nativeResponseValue; } // void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function ChannelHandshakeLimits_set_max_minimum_depth(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12009,6 +13303,7 @@ export function ChannelHandshakeLimits_set_max_minimum_depth(this_ptr: number, v // debug statements here } // bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12017,6 +13312,7 @@ export function ChannelHandshakeLimits_get_force_announced_channel_preference(th return nativeResponseValue; } // void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12025,6 +13321,7 @@ export function ChannelHandshakeLimits_set_force_announced_channel_preference(th // debug statements here } // uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelHandshakeLimits_get_their_to_self_delay(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12033,6 +13330,7 @@ export function ChannelHandshakeLimits_get_their_to_self_delay(this_ptr: number) return nativeResponseValue; } // void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function ChannelHandshakeLimits_set_their_to_self_delay(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12041,6 +13339,7 @@ export function ChannelHandshakeLimits_set_their_to_self_delay(this_ptr: number, // debug statements here } // MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint32_t max_minimum_depth_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg); +/* @internal */ export function ChannelHandshakeLimits_new(min_funding_satoshis_arg: bigint, max_htlc_minimum_msat_arg: bigint, min_max_htlc_value_in_flight_msat_arg: bigint, max_channel_reserve_satoshis_arg: bigint, min_max_accepted_htlcs_arg: number, max_minimum_depth_arg: number, force_announced_channel_preference_arg: boolean, their_to_self_delay_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12049,6 +13348,7 @@ export function ChannelHandshakeLimits_new(min_funding_satoshis_arg: bigint, max return nativeResponseValue; } // uintptr_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg); +/* @internal */ export function ChannelHandshakeLimits_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12057,6 +13357,7 @@ export function ChannelHandshakeLimits_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig); +/* @internal */ export function ChannelHandshakeLimits_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12065,6 +13366,7 @@ export function ChannelHandshakeLimits_clone(orig: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void); +/* @internal */ export function ChannelHandshakeLimits_default(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12073,6 +13375,7 @@ export function ChannelHandshakeLimits_default(): number { return nativeResponseValue; } // void ChannelConfig_free(struct LDKChannelConfig this_obj); +/* @internal */ export function ChannelConfig_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12081,6 +13384,7 @@ export function ChannelConfig_free(this_obj: number): void { // debug statements here } // uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelConfig_get_forwarding_fee_proportional_millionths(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12089,6 +13393,7 @@ export function ChannelConfig_get_forwarding_fee_proportional_millionths(this_pt return nativeResponseValue; } // void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function ChannelConfig_set_forwarding_fee_proportional_millionths(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12097,6 +13402,7 @@ export function ChannelConfig_set_forwarding_fee_proportional_millionths(this_pt // debug statements here } // uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelConfig_get_forwarding_fee_base_msat(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12105,6 +13411,7 @@ export function ChannelConfig_get_forwarding_fee_base_msat(this_ptr: number): nu return nativeResponseValue; } // void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function ChannelConfig_set_forwarding_fee_base_msat(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12113,6 +13420,7 @@ export function ChannelConfig_set_forwarding_fee_base_msat(this_ptr: number, val // debug statements here } // uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelConfig_get_cltv_expiry_delta(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12121,6 +13429,7 @@ export function ChannelConfig_get_cltv_expiry_delta(this_ptr: number): number { return nativeResponseValue; } // void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function ChannelConfig_set_cltv_expiry_delta(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12129,6 +13438,7 @@ export function ChannelConfig_set_cltv_expiry_delta(this_ptr: number, val: numbe // debug statements here } // bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelConfig_get_announced_channel(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12137,6 +13447,7 @@ export function ChannelConfig_get_announced_channel(this_ptr: number): boolean { return nativeResponseValue; } // void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function ChannelConfig_set_announced_channel(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12145,6 +13456,7 @@ export function ChannelConfig_set_announced_channel(this_ptr: number, val: boole // debug statements here } // bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12153,6 +13465,7 @@ export function ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr: numbe return nativeResponseValue; } // void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12161,6 +13474,7 @@ export function ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr: numbe // debug statements here } // uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelConfig_get_max_dust_htlc_exposure_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12169,6 +13483,7 @@ export function ChannelConfig_get_max_dust_htlc_exposure_msat(this_ptr: number): return nativeResponseValue; } // void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelConfig_set_max_dust_htlc_exposure_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12177,6 +13492,7 @@ export function ChannelConfig_set_max_dust_htlc_exposure_msat(this_ptr: number, // debug statements here } // uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelConfig_get_force_close_avoidance_max_fee_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12185,6 +13501,7 @@ export function ChannelConfig_get_force_close_avoidance_max_fee_satoshis(this_pt return nativeResponseValue; } // void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelConfig_set_force_close_avoidance_max_fee_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12193,6 +13510,7 @@ export function ChannelConfig_set_force_close_avoidance_max_fee_satoshis(this_pt // debug statements here } // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg); +/* @internal */ export function ChannelConfig_new(forwarding_fee_proportional_millionths_arg: number, forwarding_fee_base_msat_arg: number, cltv_expiry_delta_arg: number, announced_channel_arg: boolean, commit_upfront_shutdown_pubkey_arg: boolean, max_dust_htlc_exposure_msat_arg: bigint, force_close_avoidance_max_fee_satoshis_arg: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12201,6 +13519,7 @@ export function ChannelConfig_new(forwarding_fee_proportional_millionths_arg: nu return nativeResponseValue; } // uintptr_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg); +/* @internal */ export function ChannelConfig_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12209,6 +13528,7 @@ export function ChannelConfig_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig); +/* @internal */ export function ChannelConfig_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12217,6 +13537,7 @@ export function ChannelConfig_clone(orig: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void); +/* @internal */ export function ChannelConfig_default(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12225,6 +13546,7 @@ export function ChannelConfig_default(): number { return nativeResponseValue; } // struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj); +/* @internal */ export function ChannelConfig_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12233,6 +13555,7 @@ export function ChannelConfig_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser); +/* @internal */ export function ChannelConfig_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12241,6 +13564,7 @@ export function ChannelConfig_read(ser: number): number { return nativeResponseValue; } // void UserConfig_free(struct LDKUserConfig this_obj); +/* @internal */ export function UserConfig_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12249,6 +13573,7 @@ export function UserConfig_free(this_obj: number): void { // debug statements here } // struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr); +/* @internal */ export function UserConfig_get_own_channel_config(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12257,6 +13582,7 @@ export function UserConfig_get_own_channel_config(this_ptr: number): number { return nativeResponseValue; } // void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val); +/* @internal */ export function UserConfig_set_own_channel_config(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12265,6 +13591,7 @@ export function UserConfig_set_own_channel_config(this_ptr: number, val: number) // debug statements here } // struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr); +/* @internal */ export function UserConfig_get_peer_channel_config_limits(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12273,6 +13600,7 @@ export function UserConfig_get_peer_channel_config_limits(this_ptr: number): num return nativeResponseValue; } // void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val); +/* @internal */ export function UserConfig_set_peer_channel_config_limits(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12281,6 +13609,7 @@ export function UserConfig_set_peer_channel_config_limits(this_ptr: number, val: // debug statements here } // struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr); +/* @internal */ export function UserConfig_get_channel_options(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12289,6 +13618,7 @@ export function UserConfig_get_channel_options(this_ptr: number): number { return nativeResponseValue; } // void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val); +/* @internal */ export function UserConfig_set_channel_options(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12297,6 +13627,7 @@ export function UserConfig_set_channel_options(this_ptr: number, val: number): v // debug statements here } // bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr); +/* @internal */ export function UserConfig_get_accept_forwards_to_priv_channels(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12305,6 +13636,7 @@ export function UserConfig_get_accept_forwards_to_priv_channels(this_ptr: number return nativeResponseValue; } // void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function UserConfig_set_accept_forwards_to_priv_channels(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12313,6 +13645,7 @@ export function UserConfig_set_accept_forwards_to_priv_channels(this_ptr: number // debug statements here } // bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr); +/* @internal */ export function UserConfig_get_accept_inbound_channels(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12321,6 +13654,7 @@ export function UserConfig_get_accept_inbound_channels(this_ptr: number): boolea return nativeResponseValue; } // void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function UserConfig_set_accept_inbound_channels(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12329,6 +13663,7 @@ export function UserConfig_set_accept_inbound_channels(this_ptr: number, val: bo // debug statements here } // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg); +/* @internal */ export function UserConfig_new(own_channel_config_arg: number, peer_channel_config_limits_arg: number, channel_options_arg: number, accept_forwards_to_priv_channels_arg: boolean, accept_inbound_channels_arg: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12337,6 +13672,7 @@ export function UserConfig_new(own_channel_config_arg: number, peer_channel_conf return nativeResponseValue; } // uintptr_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg); +/* @internal */ export function UserConfig_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12345,6 +13681,7 @@ export function UserConfig_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig); +/* @internal */ export function UserConfig_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12353,6 +13690,7 @@ export function UserConfig_clone(orig: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKUserConfig UserConfig_default(void); +/* @internal */ export function UserConfig_default(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12361,6 +13699,7 @@ export function UserConfig_default(): number { return nativeResponseValue; } // void BestBlock_free(struct LDKBestBlock this_obj); +/* @internal */ export function BestBlock_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12369,6 +13708,7 @@ export function BestBlock_free(this_obj: number): void { // debug statements here } // uintptr_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg); +/* @internal */ export function BestBlock_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12377,6 +13717,7 @@ export function BestBlock_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig); +/* @internal */ export function BestBlock_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12385,6 +13726,7 @@ export function BestBlock_clone(orig: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network); +/* @internal */ export function BestBlock_from_genesis(network: Network): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12393,6 +13735,7 @@ export function BestBlock_from_genesis(network: Network): number { return nativeResponseValue; } // MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height); +/* @internal */ export function BestBlock_new(block_hash: number, height: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12401,6 +13744,7 @@ export function BestBlock_new(block_hash: number, height: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg); +/* @internal */ export function BestBlock_block_hash(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12409,6 +13753,7 @@ export function BestBlock_block_hash(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg); +/* @internal */ export function BestBlock_height(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12417,6 +13762,7 @@ export function BestBlock_height(this_arg: number): number { return nativeResponseValue; } // enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig); +/* @internal */ export function AccessError_clone(orig: number): AccessError { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12425,6 +13771,7 @@ export function AccessError_clone(orig: number): AccessError { return nativeResponseValue; } // enum LDKAccessError AccessError_unknown_chain(void); +/* @internal */ export function AccessError_unknown_chain(): AccessError { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12433,6 +13780,7 @@ export function AccessError_unknown_chain(): AccessError { return nativeResponseValue; } // enum LDKAccessError AccessError_unknown_tx(void); +/* @internal */ export function AccessError_unknown_tx(): AccessError { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12441,6 +13789,7 @@ export function AccessError_unknown_tx(): AccessError { return nativeResponseValue; } // void Access_free(struct LDKAccess this_ptr); +/* @internal */ export function Access_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12449,6 +13798,7 @@ export function Access_free(this_ptr: number): void { // debug statements here } // void Listen_free(struct LDKListen this_ptr); +/* @internal */ export function Listen_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12457,6 +13807,7 @@ export function Listen_free(this_ptr: number): void { // debug statements here } // void Confirm_free(struct LDKConfirm this_ptr); +/* @internal */ export function Confirm_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12465,6 +13816,7 @@ export function Confirm_free(this_ptr: number): void { // debug statements here } // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig); +/* @internal */ export function ChannelMonitorUpdateErr_clone(orig: number): ChannelMonitorUpdateErr { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12473,6 +13825,7 @@ export function ChannelMonitorUpdateErr_clone(orig: number): ChannelMonitorUpdat return nativeResponseValue; } // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void); +/* @internal */ export function ChannelMonitorUpdateErr_temporary_failure(): ChannelMonitorUpdateErr { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12481,6 +13834,7 @@ export function ChannelMonitorUpdateErr_temporary_failure(): ChannelMonitorUpdat return nativeResponseValue; } // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void); +/* @internal */ export function ChannelMonitorUpdateErr_permanent_failure(): ChannelMonitorUpdateErr { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12489,6 +13843,7 @@ export function ChannelMonitorUpdateErr_permanent_failure(): ChannelMonitorUpdat return nativeResponseValue; } // void Watch_free(struct LDKWatch this_ptr); +/* @internal */ export function Watch_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12497,6 +13852,7 @@ export function Watch_free(this_ptr: number): void { // debug statements here } // void Filter_free(struct LDKFilter this_ptr); +/* @internal */ export function Filter_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12505,6 +13861,7 @@ export function Filter_free(this_ptr: number): void { // debug statements here } // void WatchedOutput_free(struct LDKWatchedOutput this_obj); +/* @internal */ export function WatchedOutput_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12513,6 +13870,7 @@ export function WatchedOutput_free(this_obj: number): void { // debug statements here } // struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); +/* @internal */ export function WatchedOutput_get_block_hash(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12521,6 +13879,7 @@ export function WatchedOutput_get_block_hash(this_ptr: number): number { return nativeResponseValue; } // void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function WatchedOutput_set_block_hash(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12529,6 +13888,7 @@ export function WatchedOutput_set_block_hash(this_ptr: number, val: number): voi // debug statements here } // struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); +/* @internal */ export function WatchedOutput_get_outpoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12537,6 +13897,7 @@ export function WatchedOutput_get_outpoint(this_ptr: number): number { return nativeResponseValue; } // void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val); +/* @internal */ export function WatchedOutput_set_outpoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12545,6 +13906,7 @@ export function WatchedOutput_set_outpoint(this_ptr: number, val: number): void // debug statements here } // struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr); +/* @internal */ export function WatchedOutput_get_script_pubkey(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12553,6 +13915,7 @@ export function WatchedOutput_get_script_pubkey(this_ptr: number): number { return nativeResponseValue; } // void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); +/* @internal */ export function WatchedOutput_set_script_pubkey(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12561,6 +13924,7 @@ export function WatchedOutput_set_script_pubkey(this_ptr: number, val: number): // debug statements here } // MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg); +/* @internal */ export function WatchedOutput_new(block_hash_arg: number, outpoint_arg: number, script_pubkey_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12569,6 +13933,7 @@ export function WatchedOutput_new(block_hash_arg: number, outpoint_arg: number, return nativeResponseValue; } // uintptr_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg); +/* @internal */ export function WatchedOutput_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12577,6 +13942,7 @@ export function WatchedOutput_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig); +/* @internal */ export function WatchedOutput_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12585,6 +13951,7 @@ export function WatchedOutput_clone(orig: number): number { return nativeResponseValue; } // uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o); +/* @internal */ export function WatchedOutput_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12593,6 +13960,7 @@ export function WatchedOutput_hash(o: number): bigint { return nativeResponseValue; } // void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr); +/* @internal */ export function BroadcasterInterface_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12601,6 +13969,7 @@ export function BroadcasterInterface_free(this_ptr: number): void { // debug statements here } // enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig); +/* @internal */ export function ConfirmationTarget_clone(orig: number): ConfirmationTarget { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12609,6 +13978,7 @@ export function ConfirmationTarget_clone(orig: number): ConfirmationTarget { return nativeResponseValue; } // enum LDKConfirmationTarget ConfirmationTarget_background(void); +/* @internal */ export function ConfirmationTarget_background(): ConfirmationTarget { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12617,6 +13987,7 @@ export function ConfirmationTarget_background(): ConfirmationTarget { return nativeResponseValue; } // enum LDKConfirmationTarget ConfirmationTarget_normal(void); +/* @internal */ export function ConfirmationTarget_normal(): ConfirmationTarget { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12625,6 +13996,7 @@ export function ConfirmationTarget_normal(): ConfirmationTarget { return nativeResponseValue; } // enum LDKConfirmationTarget ConfirmationTarget_high_priority(void); +/* @internal */ export function ConfirmationTarget_high_priority(): ConfirmationTarget { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12633,6 +14005,7 @@ export function ConfirmationTarget_high_priority(): ConfirmationTarget { return nativeResponseValue; } // bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b); +/* @internal */ export function ConfirmationTarget_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12641,6 +14014,7 @@ export function ConfirmationTarget_eq(a: number, b: number): boolean { return nativeResponseValue; } // void FeeEstimator_free(struct LDKFeeEstimator this_ptr); +/* @internal */ export function FeeEstimator_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12649,6 +14023,7 @@ export function FeeEstimator_free(this_ptr: number): void { // debug statements here } // void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj); +/* @internal */ export function MonitorUpdateId_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12657,6 +14032,7 @@ export function MonitorUpdateId_free(this_obj: number): void { // debug statements here } // uintptr_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg); +/* @internal */ export function MonitorUpdateId_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12665,6 +14041,7 @@ export function MonitorUpdateId_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig); +/* @internal */ export function MonitorUpdateId_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12673,6 +14050,7 @@ export function MonitorUpdateId_clone(orig: number): number { return nativeResponseValue; } // uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o); +/* @internal */ export function MonitorUpdateId_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12681,6 +14059,7 @@ export function MonitorUpdateId_hash(o: number): bigint { return nativeResponseValue; } // bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b); +/* @internal */ export function MonitorUpdateId_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12689,6 +14068,7 @@ export function MonitorUpdateId_eq(a: number, b: number): boolean { return nativeResponseValue; } // void Persist_free(struct LDKPersist this_ptr); +/* @internal */ export function Persist_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12697,6 +14077,7 @@ export function Persist_free(this_ptr: number): void { // debug statements here } // void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj); +/* @internal */ export function LockedChannelMonitor_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12705,6 +14086,7 @@ export function LockedChannelMonitor_free(this_obj: number): void { // debug statements here } // void ChainMonitor_free(struct LDKChainMonitor this_obj); +/* @internal */ export function ChainMonitor_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12713,6 +14095,7 @@ export function ChainMonitor_free(this_obj: number): void { // debug statements here } // MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister); +/* @internal */ export function ChainMonitor_new(chain_source: number, broadcaster: number, logger: number, feeest: number, persister: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12721,6 +14104,7 @@ export function ChainMonitor_new(chain_source: number, broadcaster: number, logg return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels); +/* @internal */ export function ChainMonitor_get_claimable_balances(this_arg: number, ignored_channels: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12729,6 +14113,7 @@ export function ChainMonitor_get_claimable_balances(this_arg: number, ignored_ch return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo); +/* @internal */ export function ChainMonitor_get_monitor(this_arg: number, funding_txo: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12737,6 +14122,7 @@ export function ChainMonitor_get_monitor(this_arg: number, funding_txo: number): return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChainMonitor_list_monitors(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12745,6 +14131,7 @@ export function ChainMonitor_list_monitors(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id); +/* @internal */ export function ChainMonitor_channel_monitor_updated(this_arg: number, funding_txo: number, completed_update_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12753,6 +14140,7 @@ export function ChainMonitor_channel_monitor_updated(this_arg: number, funding_t return nativeResponseValue; } // struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChainMonitor_as_Listen(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12761,6 +14149,7 @@ export function ChainMonitor_as_Listen(this_arg: number): number { return nativeResponseValue; } // struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChainMonitor_as_Confirm(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12769,6 +14158,7 @@ export function ChainMonitor_as_Confirm(this_arg: number): number { return nativeResponseValue; } // struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChainMonitor_as_Watch(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12777,6 +14167,7 @@ export function ChainMonitor_as_Watch(this_arg: number): number { return nativeResponseValue; } // struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChainMonitor_as_EventsProvider(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12785,6 +14176,7 @@ export function ChainMonitor_as_EventsProvider(this_arg: number): number { return nativeResponseValue; } // void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj); +/* @internal */ export function ChannelMonitorUpdate_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12793,6 +14185,7 @@ export function ChannelMonitorUpdate_free(this_obj: number): void { // debug statements here } // uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelMonitorUpdate_get_update_id(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12801,6 +14194,7 @@ export function ChannelMonitorUpdate_get_update_id(this_ptr: number): bigint { return nativeResponseValue; } // void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelMonitorUpdate_set_update_id(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12809,6 +14203,7 @@ export function ChannelMonitorUpdate_set_update_id(this_ptr: number, val: bigint // debug statements here } // uintptr_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg); +/* @internal */ export function ChannelMonitorUpdate_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12817,6 +14212,7 @@ export function ChannelMonitorUpdate_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig); +/* @internal */ export function ChannelMonitorUpdate_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12825,6 +14221,7 @@ export function ChannelMonitorUpdate_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj); +/* @internal */ export function ChannelMonitorUpdate_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12833,6 +14230,7 @@ export function ChannelMonitorUpdate_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser); +/* @internal */ export function ChannelMonitorUpdate_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12841,6 +14239,7 @@ export function ChannelMonitorUpdate_read(ser: number): number { return nativeResponseValue; } // void MonitorEvent_free(struct LDKMonitorEvent this_ptr); +/* @internal */ export function MonitorEvent_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12849,6 +14248,7 @@ export function MonitorEvent_free(this_ptr: number): void { // debug statements here } // uintptr_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg); +/* @internal */ export function MonitorEvent_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12857,6 +14257,7 @@ export function MonitorEvent_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig); +/* @internal */ export function MonitorEvent_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12865,6 +14266,7 @@ export function MonitorEvent_clone(orig: number): number { return nativeResponseValue; } // struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a); +/* @internal */ export function MonitorEvent_htlcevent(a: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12873,6 +14275,7 @@ export function MonitorEvent_htlcevent(a: number): number { return nativeResponseValue; } // struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a); +/* @internal */ export function MonitorEvent_commitment_tx_confirmed(a: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12881,6 +14284,7 @@ export function MonitorEvent_commitment_tx_confirmed(a: number): number { return nativeResponseValue; } // struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id); +/* @internal */ export function MonitorEvent_update_completed(funding_txo: number, monitor_update_id: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12889,6 +14293,7 @@ export function MonitorEvent_update_completed(funding_txo: number, monitor_updat return nativeResponseValue; } // struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a); +/* @internal */ export function MonitorEvent_update_failed(a: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12897,6 +14302,7 @@ export function MonitorEvent_update_failed(a: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj); +/* @internal */ export function MonitorEvent_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12905,6 +14311,7 @@ export function MonitorEvent_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser); +/* @internal */ export function MonitorEvent_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12913,6 +14320,7 @@ export function MonitorEvent_read(ser: number): number { return nativeResponseValue; } // void HTLCUpdate_free(struct LDKHTLCUpdate this_obj); +/* @internal */ export function HTLCUpdate_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12921,6 +14329,7 @@ export function HTLCUpdate_free(this_obj: number): void { // debug statements here } // uintptr_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg); +/* @internal */ export function HTLCUpdate_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12929,6 +14338,7 @@ export function HTLCUpdate_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig); +/* @internal */ export function HTLCUpdate_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12937,6 +14347,7 @@ export function HTLCUpdate_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj); +/* @internal */ export function HTLCUpdate_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12945,6 +14356,7 @@ export function HTLCUpdate_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser); +/* @internal */ export function HTLCUpdate_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12953,6 +14365,7 @@ export function HTLCUpdate_read(ser: number): number { return nativeResponseValue; } // void Balance_free(struct LDKBalance this_ptr); +/* @internal */ export function Balance_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12961,6 +14374,7 @@ export function Balance_free(this_ptr: number): void { // debug statements here } // uintptr_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg); +/* @internal */ export function Balance_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12969,6 +14383,7 @@ export function Balance_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig); +/* @internal */ export function Balance_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12977,6 +14392,7 @@ export function Balance_clone(orig: number): number { return nativeResponseValue; } // struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis); +/* @internal */ export function Balance_claimable_on_channel_close(claimable_amount_satoshis: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12985,6 +14401,7 @@ export function Balance_claimable_on_channel_close(claimable_amount_satoshis: bi return nativeResponseValue; } // struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height); +/* @internal */ export function Balance_claimable_awaiting_confirmations(claimable_amount_satoshis: bigint, confirmation_height: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -12993,6 +14410,7 @@ export function Balance_claimable_awaiting_confirmations(claimable_amount_satosh return nativeResponseValue; } // struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height); +/* @internal */ export function Balance_contentious_claimable(claimable_amount_satoshis: bigint, timeout_height: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13001,6 +14419,7 @@ export function Balance_contentious_claimable(claimable_amount_satoshis: bigint, return nativeResponseValue; } // struct LDKBalance Balance_maybe_claimable_htlcawaiting_timeout(uint64_t claimable_amount_satoshis, uint32_t claimable_height); +/* @internal */ export function Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis: bigint, claimable_height: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13009,6 +14428,7 @@ export function Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_sa return nativeResponseValue; } // bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b); +/* @internal */ export function Balance_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13017,6 +14437,7 @@ export function Balance_eq(a: number, b: number): boolean { return nativeResponseValue; } // void ChannelMonitor_free(struct LDKChannelMonitor this_obj); +/* @internal */ export function ChannelMonitor_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13025,6 +14446,7 @@ export function ChannelMonitor_free(this_obj: number): void { // debug statements here } // uintptr_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg); +/* @internal */ export function ChannelMonitor_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13033,6 +14455,7 @@ export function ChannelMonitor_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig); +/* @internal */ export function ChannelMonitor_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13041,6 +14464,7 @@ export function ChannelMonitor_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj); +/* @internal */ export function ChannelMonitor_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13049,6 +14473,7 @@ export function ChannelMonitor_write(obj: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger); +/* @internal */ export function ChannelMonitor_update_monitor(this_arg: number, updates: number, broadcaster: number, fee_estimator: number, logger: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13057,6 +14482,7 @@ export function ChannelMonitor_update_monitor(this_arg: number, updates: number, return nativeResponseValue; } // MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChannelMonitor_get_latest_update_id(this_arg: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13065,6 +14491,7 @@ export function ChannelMonitor_get_latest_update_id(this_arg: number): bigint { return nativeResponseValue; } // MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChannelMonitor_get_funding_txo(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13073,6 +14500,7 @@ export function ChannelMonitor_get_funding_txo(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChannelMonitor_get_outputs_to_watch(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13081,6 +14509,7 @@ export function ChannelMonitor_get_outputs_to_watch(this_arg: number): number { return nativeResponseValue; } // void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter); +/* @internal */ export function ChannelMonitor_load_outputs_to_watch(this_arg: number, filter: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13089,6 +14518,7 @@ export function ChannelMonitor_load_outputs_to_watch(this_arg: number, filter: n // debug statements here } // MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChannelMonitor_get_and_clear_pending_monitor_events(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13097,6 +14527,7 @@ export function ChannelMonitor_get_and_clear_pending_monitor_events(this_arg: nu return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChannelMonitor_get_and_clear_pending_events(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13105,6 +14536,7 @@ export function ChannelMonitor_get_and_clear_pending_events(this_arg: number): n return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger); +/* @internal */ export function ChannelMonitor_get_latest_holder_commitment_txn(this_arg: number, logger: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13113,6 +14545,7 @@ export function ChannelMonitor_get_latest_holder_commitment_txn(this_arg: number return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); +/* @internal */ export function ChannelMonitor_block_connected(this_arg: number, header: number, txdata: number, height: number, broadcaster: number, fee_estimator: number, logger: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13121,6 +14554,7 @@ export function ChannelMonitor_block_connected(this_arg: number, header: number, return nativeResponseValue; } // void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); +/* @internal */ export function ChannelMonitor_block_disconnected(this_arg: number, header: number, height: number, broadcaster: number, fee_estimator: number, logger: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13129,6 +14563,7 @@ export function ChannelMonitor_block_disconnected(this_arg: number, header: numb // debug statements here } // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_transactions_confirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); +/* @internal */ export function ChannelMonitor_transactions_confirmed(this_arg: number, header: number, txdata: number, height: number, broadcaster: number, fee_estimator: number, logger: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13137,6 +14572,7 @@ export function ChannelMonitor_transactions_confirmed(this_arg: number, header: return nativeResponseValue; } // void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); +/* @internal */ export function ChannelMonitor_transaction_unconfirmed(this_arg: number, txid: number, broadcaster: number, fee_estimator: number, logger: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13145,6 +14581,7 @@ export function ChannelMonitor_transaction_unconfirmed(this_arg: number, txid: n // debug statements here } // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_best_block_updated(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); +/* @internal */ export function ChannelMonitor_best_block_updated(this_arg: number, header: number, height: number, broadcaster: number, fee_estimator: number, logger: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13153,6 +14590,7 @@ export function ChannelMonitor_best_block_updated(this_arg: number, header: numb return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChannelMonitor_get_relevant_txids(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13161,6 +14599,7 @@ export function ChannelMonitor_get_relevant_txids(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChannelMonitor_current_best_block(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13169,6 +14608,7 @@ export function ChannelMonitor_current_best_block(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg); +/* @internal */ export function ChannelMonitor_get_claimable_balances(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13177,6 +14617,7 @@ export function ChannelMonitor_get_claimable_balances(this_arg: number): number return nativeResponseValue; } // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg); +/* @internal */ export function C2Tuple_BlockHashChannelMonitorZ_read(ser: number, arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13185,6 +14626,7 @@ export function C2Tuple_BlockHashChannelMonitorZ_read(ser: number, arg: number): return nativeResponseValue; } // void OutPoint_free(struct LDKOutPoint this_obj); +/* @internal */ export function OutPoint_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13193,6 +14635,7 @@ export function OutPoint_free(this_obj: number): void { // debug statements here } // const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function OutPoint_get_txid(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13201,6 +14644,7 @@ export function OutPoint_get_txid(this_ptr: number): number { return nativeResponseValue; } // void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function OutPoint_set_txid(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13209,6 +14653,7 @@ export function OutPoint_set_txid(this_ptr: number, val: number): void { // debug statements here } // uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr); +/* @internal */ export function OutPoint_get_index(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13217,6 +14662,7 @@ export function OutPoint_get_index(this_ptr: number): number { return nativeResponseValue; } // void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function OutPoint_set_index(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13225,6 +14671,7 @@ export function OutPoint_set_index(this_ptr: number, val: number): void { // debug statements here } // MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg); +/* @internal */ export function OutPoint_new(txid_arg: number, index_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13233,6 +14680,7 @@ export function OutPoint_new(txid_arg: number, index_arg: number): number { return nativeResponseValue; } // uintptr_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg); +/* @internal */ export function OutPoint_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13241,6 +14689,7 @@ export function OutPoint_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig); +/* @internal */ export function OutPoint_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13249,6 +14698,7 @@ export function OutPoint_clone(orig: number): number { return nativeResponseValue; } // bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b); +/* @internal */ export function OutPoint_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13257,6 +14707,7 @@ export function OutPoint_eq(a: number, b: number): boolean { return nativeResponseValue; } // uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o); +/* @internal */ export function OutPoint_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13265,6 +14716,7 @@ export function OutPoint_hash(o: number): bigint { return nativeResponseValue; } // MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg); +/* @internal */ export function OutPoint_to_channel_id(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13273,6 +14725,7 @@ export function OutPoint_to_channel_id(this_arg: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj); +/* @internal */ export function OutPoint_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13281,6 +14734,7 @@ export function OutPoint_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser); +/* @internal */ export function OutPoint_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13289,6 +14743,7 @@ export function OutPoint_read(ser: number): number { return nativeResponseValue; } // void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj); +/* @internal */ export function DelayedPaymentOutputDescriptor_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13297,6 +14752,7 @@ export function DelayedPaymentOutputDescriptor_free(this_obj: number): void { // debug statements here } // struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); +/* @internal */ export function DelayedPaymentOutputDescriptor_get_outpoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13305,6 +14761,7 @@ export function DelayedPaymentOutputDescriptor_get_outpoint(this_ptr: number): n return nativeResponseValue; } // void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val); +/* @internal */ export function DelayedPaymentOutputDescriptor_set_outpoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13313,6 +14770,7 @@ export function DelayedPaymentOutputDescriptor_set_outpoint(this_ptr: number, va // debug statements here } // struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); +/* @internal */ export function DelayedPaymentOutputDescriptor_get_per_commitment_point(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13321,6 +14779,7 @@ export function DelayedPaymentOutputDescriptor_get_per_commitment_point(this_ptr return nativeResponseValue; } // void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function DelayedPaymentOutputDescriptor_set_per_commitment_point(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13329,6 +14788,7 @@ export function DelayedPaymentOutputDescriptor_set_per_commitment_point(this_ptr // debug statements here } // uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); +/* @internal */ export function DelayedPaymentOutputDescriptor_get_to_self_delay(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13337,6 +14797,7 @@ export function DelayedPaymentOutputDescriptor_get_to_self_delay(this_ptr: numbe return nativeResponseValue; } // void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function DelayedPaymentOutputDescriptor_set_to_self_delay(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13345,6 +14806,7 @@ export function DelayedPaymentOutputDescriptor_set_to_self_delay(this_ptr: numbe // debug statements here } // void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val); +/* @internal */ export function DelayedPaymentOutputDescriptor_set_output(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13353,6 +14815,7 @@ export function DelayedPaymentOutputDescriptor_set_output(this_ptr: number, val: // debug statements here } // struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); +/* @internal */ export function DelayedPaymentOutputDescriptor_get_revocation_pubkey(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13361,6 +14824,7 @@ export function DelayedPaymentOutputDescriptor_get_revocation_pubkey(this_ptr: n return nativeResponseValue; } // void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function DelayedPaymentOutputDescriptor_set_revocation_pubkey(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13369,6 +14833,7 @@ export function DelayedPaymentOutputDescriptor_set_revocation_pubkey(this_ptr: n // debug statements here } // const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function DelayedPaymentOutputDescriptor_get_channel_keys_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13377,6 +14842,7 @@ export function DelayedPaymentOutputDescriptor_get_channel_keys_id(this_ptr: num return nativeResponseValue; } // void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function DelayedPaymentOutputDescriptor_set_channel_keys_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13385,6 +14851,7 @@ export function DelayedPaymentOutputDescriptor_set_channel_keys_id(this_ptr: num // debug statements here } // uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); +/* @internal */ export function DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13393,6 +14860,7 @@ export function DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this_p return nativeResponseValue; } // void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13401,6 +14869,7 @@ export function DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this_p // debug statements here } // MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKPublicKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg); +/* @internal */ export function DelayedPaymentOutputDescriptor_new(outpoint_arg: number, per_commitment_point_arg: number, to_self_delay_arg: number, output_arg: number, revocation_pubkey_arg: number, channel_keys_id_arg: number, channel_value_satoshis_arg: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13409,6 +14878,7 @@ export function DelayedPaymentOutputDescriptor_new(outpoint_arg: number, per_com return nativeResponseValue; } // uintptr_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg); +/* @internal */ export function DelayedPaymentOutputDescriptor_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13417,6 +14887,7 @@ export function DelayedPaymentOutputDescriptor_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig); +/* @internal */ export function DelayedPaymentOutputDescriptor_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13425,6 +14896,7 @@ export function DelayedPaymentOutputDescriptor_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj); +/* @internal */ export function DelayedPaymentOutputDescriptor_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13433,6 +14905,7 @@ export function DelayedPaymentOutputDescriptor_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser); +/* @internal */ export function DelayedPaymentOutputDescriptor_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13441,6 +14914,7 @@ export function DelayedPaymentOutputDescriptor_read(ser: number): number { return nativeResponseValue; } // void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj); +/* @internal */ export function StaticPaymentOutputDescriptor_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13449,6 +14923,7 @@ export function StaticPaymentOutputDescriptor_free(this_obj: number): void { // debug statements here } // struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr); +/* @internal */ export function StaticPaymentOutputDescriptor_get_outpoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13457,6 +14932,7 @@ export function StaticPaymentOutputDescriptor_get_outpoint(this_ptr: number): nu return nativeResponseValue; } // void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val); +/* @internal */ export function StaticPaymentOutputDescriptor_set_outpoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13465,6 +14941,7 @@ export function StaticPaymentOutputDescriptor_set_outpoint(this_ptr: number, val // debug statements here } // void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val); +/* @internal */ export function StaticPaymentOutputDescriptor_set_output(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13473,6 +14950,7 @@ export function StaticPaymentOutputDescriptor_set_output(this_ptr: number, val: // debug statements here } // const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function StaticPaymentOutputDescriptor_get_channel_keys_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13481,6 +14959,7 @@ export function StaticPaymentOutputDescriptor_get_channel_keys_id(this_ptr: numb return nativeResponseValue; } // void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function StaticPaymentOutputDescriptor_set_channel_keys_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13489,6 +14968,7 @@ export function StaticPaymentOutputDescriptor_set_channel_keys_id(this_ptr: numb // debug statements here } // uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr); +/* @internal */ export function StaticPaymentOutputDescriptor_get_channel_value_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13497,6 +14977,7 @@ export function StaticPaymentOutputDescriptor_get_channel_value_satoshis(this_pt return nativeResponseValue; } // void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function StaticPaymentOutputDescriptor_set_channel_value_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13505,6 +14986,7 @@ export function StaticPaymentOutputDescriptor_set_channel_value_satoshis(this_pt // debug statements here } // MUST_USE_RES struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg); +/* @internal */ export function StaticPaymentOutputDescriptor_new(outpoint_arg: number, output_arg: number, channel_keys_id_arg: number, channel_value_satoshis_arg: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13513,6 +14995,7 @@ export function StaticPaymentOutputDescriptor_new(outpoint_arg: number, output_a return nativeResponseValue; } // uintptr_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg); +/* @internal */ export function StaticPaymentOutputDescriptor_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13521,6 +15004,7 @@ export function StaticPaymentOutputDescriptor_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig); +/* @internal */ export function StaticPaymentOutputDescriptor_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13529,6 +15013,7 @@ export function StaticPaymentOutputDescriptor_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj); +/* @internal */ export function StaticPaymentOutputDescriptor_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13537,6 +15022,7 @@ export function StaticPaymentOutputDescriptor_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser); +/* @internal */ export function StaticPaymentOutputDescriptor_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13545,6 +15031,7 @@ export function StaticPaymentOutputDescriptor_read(ser: number): number { return nativeResponseValue; } // void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr); +/* @internal */ export function SpendableOutputDescriptor_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13553,6 +15040,7 @@ export function SpendableOutputDescriptor_free(this_ptr: number): void { // debug statements here } // uintptr_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg); +/* @internal */ export function SpendableOutputDescriptor_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13561,6 +15049,7 @@ export function SpendableOutputDescriptor_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig); +/* @internal */ export function SpendableOutputDescriptor_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13569,6 +15058,7 @@ export function SpendableOutputDescriptor_clone(orig: number): number { return nativeResponseValue; } // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output); +/* @internal */ export function SpendableOutputDescriptor_static_output(outpoint: number, output: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13577,6 +15067,7 @@ export function SpendableOutputDescriptor_static_output(outpoint: number, output return nativeResponseValue; } // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a); +/* @internal */ export function SpendableOutputDescriptor_delayed_payment_output(a: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13585,6 +15076,7 @@ export function SpendableOutputDescriptor_delayed_payment_output(a: number): num return nativeResponseValue; } // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a); +/* @internal */ export function SpendableOutputDescriptor_static_payment_output(a: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13593,6 +15085,7 @@ export function SpendableOutputDescriptor_static_payment_output(a: number): numb return nativeResponseValue; } // struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj); +/* @internal */ export function SpendableOutputDescriptor_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13601,6 +15094,7 @@ export function SpendableOutputDescriptor_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser); +/* @internal */ export function SpendableOutputDescriptor_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13609,6 +15103,7 @@ export function SpendableOutputDescriptor_read(ser: number): number { return nativeResponseValue; } // void BaseSign_free(struct LDKBaseSign this_ptr); +/* @internal */ export function BaseSign_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13617,6 +15112,7 @@ export function BaseSign_free(this_ptr: number): void { // debug statements here } // uintptr_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg); +/* @internal */ export function Sign_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13625,6 +15121,7 @@ export function Sign_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig); +/* @internal */ export function Sign_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13633,6 +15130,7 @@ export function Sign_clone(orig: number): number { return nativeResponseValue; } // void Sign_free(struct LDKSign this_ptr); +/* @internal */ export function Sign_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13641,6 +15139,7 @@ export function Sign_free(this_ptr: number): void { // debug statements here } // void KeysInterface_free(struct LDKKeysInterface this_ptr); +/* @internal */ export function KeysInterface_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13649,6 +15148,7 @@ export function KeysInterface_free(this_ptr: number): void { // debug statements here } // void InMemorySigner_free(struct LDKInMemorySigner this_obj); +/* @internal */ export function InMemorySigner_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13657,6 +15157,7 @@ export function InMemorySigner_free(this_obj: number): void { // debug statements here } // const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function InMemorySigner_get_funding_key(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13665,6 +15166,7 @@ export function InMemorySigner_get_funding_key(this_ptr: number): number { return nativeResponseValue; } // void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); +/* @internal */ export function InMemorySigner_set_funding_key(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13673,6 +15175,7 @@ export function InMemorySigner_set_funding_key(this_ptr: number, val: number): v // debug statements here } // const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function InMemorySigner_get_revocation_base_key(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13681,6 +15184,7 @@ export function InMemorySigner_get_revocation_base_key(this_ptr: number): number return nativeResponseValue; } // void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); +/* @internal */ export function InMemorySigner_set_revocation_base_key(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13689,6 +15193,7 @@ export function InMemorySigner_set_revocation_base_key(this_ptr: number, val: nu // debug statements here } // const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function InMemorySigner_get_payment_key(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13697,6 +15202,7 @@ export function InMemorySigner_get_payment_key(this_ptr: number): number { return nativeResponseValue; } // void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); +/* @internal */ export function InMemorySigner_set_payment_key(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13705,6 +15211,7 @@ export function InMemorySigner_set_payment_key(this_ptr: number, val: number): v // debug statements here } // const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function InMemorySigner_get_delayed_payment_base_key(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13713,6 +15220,7 @@ export function InMemorySigner_get_delayed_payment_base_key(this_ptr: number): n return nativeResponseValue; } // void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); +/* @internal */ export function InMemorySigner_set_delayed_payment_base_key(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13721,6 +15229,7 @@ export function InMemorySigner_set_delayed_payment_base_key(this_ptr: number, va // debug statements here } // const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function InMemorySigner_get_htlc_base_key(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13729,6 +15238,7 @@ export function InMemorySigner_get_htlc_base_key(this_ptr: number): number { return nativeResponseValue; } // void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val); +/* @internal */ export function InMemorySigner_set_htlc_base_key(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13737,6 +15247,7 @@ export function InMemorySigner_set_htlc_base_key(this_ptr: number, val: number): // debug statements here } // const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function InMemorySigner_get_commitment_seed(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13745,6 +15256,7 @@ export function InMemorySigner_get_commitment_seed(this_ptr: number): number { return nativeResponseValue; } // void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function InMemorySigner_set_commitment_seed(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13753,6 +15265,7 @@ export function InMemorySigner_set_commitment_seed(this_ptr: number, val: number // debug statements here } // uintptr_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg); +/* @internal */ export function InMemorySigner_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13761,6 +15274,7 @@ export function InMemorySigner_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig); +/* @internal */ export function InMemorySigner_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13769,6 +15283,7 @@ export function InMemorySigner_clone(orig: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id); +/* @internal */ export function InMemorySigner_new(funding_key: number, revocation_base_key: number, payment_key: number, delayed_payment_base_key: number, htlc_base_key: number, commitment_seed: number, channel_value_satoshis: bigint, channel_keys_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13777,6 +15292,7 @@ export function InMemorySigner_new(funding_key: number, revocation_base_key: num return nativeResponseValue; } // MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg); +/* @internal */ export function InMemorySigner_counterparty_pubkeys(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13785,6 +15301,7 @@ export function InMemorySigner_counterparty_pubkeys(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg); +/* @internal */ export function InMemorySigner_counterparty_selected_contest_delay(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13793,6 +15310,7 @@ export function InMemorySigner_counterparty_selected_contest_delay(this_arg: num return nativeResponseValue; } // MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg); +/* @internal */ export function InMemorySigner_holder_selected_contest_delay(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13801,6 +15319,7 @@ export function InMemorySigner_holder_selected_contest_delay(this_arg: number): return nativeResponseValue; } // MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg); +/* @internal */ export function InMemorySigner_is_outbound(this_arg: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13809,6 +15328,7 @@ export function InMemorySigner_is_outbound(this_arg: number): boolean { return nativeResponseValue; } // MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg); +/* @internal */ export function InMemorySigner_funding_outpoint(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13817,6 +15337,7 @@ export function InMemorySigner_funding_outpoint(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg); +/* @internal */ export function InMemorySigner_get_channel_parameters(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13825,6 +15346,7 @@ export function InMemorySigner_get_channel_parameters(this_arg: number): number return nativeResponseValue; } // MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg); +/* @internal */ export function InMemorySigner_opt_anchors(this_arg: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13833,6 +15355,7 @@ export function InMemorySigner_opt_anchors(this_arg: number): boolean { return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_counterparty_payment_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR descriptor); +/* @internal */ export function InMemorySigner_sign_counterparty_payment_input(this_arg: number, spend_tx: number, input_idx: number, descriptor: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13841,6 +15364,7 @@ export function InMemorySigner_sign_counterparty_payment_input(this_arg: number, return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_CVec_CVec_u8ZZNoneZ InMemorySigner_sign_dynamic_p2wsh_input(const struct LDKInMemorySigner *NONNULL_PTR this_arg, struct LDKTransaction spend_tx, uintptr_t input_idx, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR descriptor); +/* @internal */ export function InMemorySigner_sign_dynamic_p2wsh_input(this_arg: number, spend_tx: number, input_idx: number, descriptor: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13849,6 +15373,7 @@ export function InMemorySigner_sign_dynamic_p2wsh_input(this_arg: number, spend_ return nativeResponseValue; } // struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg); +/* @internal */ export function InMemorySigner_as_BaseSign(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13857,6 +15382,7 @@ export function InMemorySigner_as_BaseSign(this_arg: number): number { return nativeResponseValue; } // struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg); +/* @internal */ export function InMemorySigner_as_Sign(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13865,6 +15391,7 @@ export function InMemorySigner_as_Sign(this_arg: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj); +/* @internal */ export function InMemorySigner_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13873,6 +15400,7 @@ export function InMemorySigner_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser); +/* @internal */ export function InMemorySigner_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13881,6 +15409,7 @@ export function InMemorySigner_read(ser: number): number { return nativeResponseValue; } // void KeysManager_free(struct LDKKeysManager this_obj); +/* @internal */ export function KeysManager_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13889,6 +15418,7 @@ export function KeysManager_free(this_obj: number): void { // debug statements here } // MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos); +/* @internal */ export function KeysManager_new(seed: number, starting_time_secs: bigint, starting_time_nanos: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13897,6 +15427,7 @@ export function KeysManager_new(seed: number, starting_time_secs: bigint, starti return nativeResponseValue; } // MUST_USE_RES struct LDKInMemorySigner KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]); +/* @internal */ export function KeysManager_derive_channel_keys(this_arg: number, channel_value_satoshis: bigint, params: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13905,6 +15436,7 @@ export function KeysManager_derive_channel_keys(this_arg: number, channel_value_ return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_TransactionNoneZ KeysManager_spend_spendable_outputs(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight); +/* @internal */ export function KeysManager_spend_spendable_outputs(this_arg: number, descriptors: number, outputs: number, change_destination_script: number, feerate_sat_per_1000_weight: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13913,6 +15445,7 @@ export function KeysManager_spend_spendable_outputs(this_arg: number, descriptor return nativeResponseValue; } // struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg); +/* @internal */ export function KeysManager_as_KeysInterface(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13921,6 +15454,7 @@ export function KeysManager_as_KeysInterface(this_arg: number): number { return nativeResponseValue; } // void ChannelManager_free(struct LDKChannelManager this_obj); +/* @internal */ export function ChannelManager_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13929,6 +15463,7 @@ export function ChannelManager_free(this_obj: number): void { // debug statements here } // void ChainParameters_free(struct LDKChainParameters this_obj); +/* @internal */ export function ChainParameters_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13937,6 +15472,7 @@ export function ChainParameters_free(this_obj: number): void { // debug statements here } // enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ChainParameters_get_network(this_ptr: number): Network { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13945,6 +15481,7 @@ export function ChainParameters_get_network(this_ptr: number): Network { return nativeResponseValue; } // void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val); +/* @internal */ export function ChainParameters_set_network(this_ptr: number, val: Network): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13953,6 +15490,7 @@ export function ChainParameters_set_network(this_ptr: number, val: Network): voi // debug statements here } // struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ChainParameters_get_best_block(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13961,6 +15499,7 @@ export function ChainParameters_get_best_block(this_ptr: number): number { return nativeResponseValue; } // void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val); +/* @internal */ export function ChainParameters_set_best_block(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13969,6 +15508,7 @@ export function ChainParameters_set_best_block(this_ptr: number, val: number): v // debug statements here } // MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg); +/* @internal */ export function ChainParameters_new(network_arg: Network, best_block_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13977,6 +15517,7 @@ export function ChainParameters_new(network_arg: Network, best_block_arg: number return nativeResponseValue; } // uintptr_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg); +/* @internal */ export function ChainParameters_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13985,6 +15526,7 @@ export function ChainParameters_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig); +/* @internal */ export function ChainParameters_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -13993,6 +15535,7 @@ export function ChainParameters_clone(orig: number): number { return nativeResponseValue; } // void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj); +/* @internal */ export function CounterpartyForwardingInfo_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14001,6 +15544,7 @@ export function CounterpartyForwardingInfo_free(this_obj: number): void { // debug statements here } // uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); +/* @internal */ export function CounterpartyForwardingInfo_get_fee_base_msat(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14009,6 +15553,7 @@ export function CounterpartyForwardingInfo_get_fee_base_msat(this_ptr: number): return nativeResponseValue; } // void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function CounterpartyForwardingInfo_set_fee_base_msat(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14017,6 +15562,7 @@ export function CounterpartyForwardingInfo_set_fee_base_msat(this_ptr: number, v // debug statements here } // uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); +/* @internal */ export function CounterpartyForwardingInfo_get_fee_proportional_millionths(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14025,6 +15571,7 @@ export function CounterpartyForwardingInfo_get_fee_proportional_millionths(this_ return nativeResponseValue; } // void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function CounterpartyForwardingInfo_set_fee_proportional_millionths(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14033,6 +15580,7 @@ export function CounterpartyForwardingInfo_set_fee_proportional_millionths(this_ // debug statements here } // uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr); +/* @internal */ export function CounterpartyForwardingInfo_get_cltv_expiry_delta(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14041,6 +15589,7 @@ export function CounterpartyForwardingInfo_get_cltv_expiry_delta(this_ptr: numbe return nativeResponseValue; } // void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function CounterpartyForwardingInfo_set_cltv_expiry_delta(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14049,6 +15598,7 @@ export function CounterpartyForwardingInfo_set_cltv_expiry_delta(this_ptr: numbe // debug statements here } // MUST_USE_RES struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg); +/* @internal */ export function CounterpartyForwardingInfo_new(fee_base_msat_arg: number, fee_proportional_millionths_arg: number, cltv_expiry_delta_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14057,6 +15607,7 @@ export function CounterpartyForwardingInfo_new(fee_base_msat_arg: number, fee_pr return nativeResponseValue; } // uintptr_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg); +/* @internal */ export function CounterpartyForwardingInfo_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14065,6 +15616,7 @@ export function CounterpartyForwardingInfo_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig); +/* @internal */ export function CounterpartyForwardingInfo_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14073,6 +15625,7 @@ export function CounterpartyForwardingInfo_clone(orig: number): number { return nativeResponseValue; } // void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj); +/* @internal */ export function ChannelCounterparty_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14081,6 +15634,7 @@ export function ChannelCounterparty_free(this_obj: number): void { // debug statements here } // struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelCounterparty_get_node_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14089,6 +15643,7 @@ export function ChannelCounterparty_get_node_id(this_ptr: number): number { return nativeResponseValue; } // void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function ChannelCounterparty_set_node_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14097,6 +15652,7 @@ export function ChannelCounterparty_set_node_id(this_ptr: number, val: number): // debug statements here } // struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelCounterparty_get_features(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14105,6 +15661,7 @@ export function ChannelCounterparty_get_features(this_ptr: number): number { return nativeResponseValue; } // void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val); +/* @internal */ export function ChannelCounterparty_set_features(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14113,6 +15670,7 @@ export function ChannelCounterparty_set_features(this_ptr: number, val: number): // debug statements here } // uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelCounterparty_get_unspendable_punishment_reserve(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14121,6 +15679,7 @@ export function ChannelCounterparty_get_unspendable_punishment_reserve(this_ptr: return nativeResponseValue; } // void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelCounterparty_set_unspendable_punishment_reserve(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14129,6 +15688,7 @@ export function ChannelCounterparty_set_unspendable_punishment_reserve(this_ptr: // debug statements here } // struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelCounterparty_get_forwarding_info(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14137,6 +15697,7 @@ export function ChannelCounterparty_get_forwarding_info(this_ptr: number): numbe return nativeResponseValue; } // void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val); +/* @internal */ export function ChannelCounterparty_set_forwarding_info(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14145,6 +15706,7 @@ export function ChannelCounterparty_set_forwarding_info(this_ptr: number, val: n // debug statements here } // MUST_USE_RES struct LDKChannelCounterparty ChannelCounterparty_new(struct LDKPublicKey node_id_arg, struct LDKInitFeatures features_arg, uint64_t unspendable_punishment_reserve_arg, struct LDKCounterpartyForwardingInfo forwarding_info_arg); +/* @internal */ export function ChannelCounterparty_new(node_id_arg: number, features_arg: number, unspendable_punishment_reserve_arg: bigint, forwarding_info_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14153,6 +15715,7 @@ export function ChannelCounterparty_new(node_id_arg: number, features_arg: numbe return nativeResponseValue; } // uintptr_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg); +/* @internal */ export function ChannelCounterparty_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14161,6 +15724,7 @@ export function ChannelCounterparty_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig); +/* @internal */ export function ChannelCounterparty_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14169,6 +15733,7 @@ export function ChannelCounterparty_clone(orig: number): number { return nativeResponseValue; } // void ChannelDetails_free(struct LDKChannelDetails this_obj); +/* @internal */ export function ChannelDetails_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14177,6 +15742,7 @@ export function ChannelDetails_free(this_obj: number): void { // debug statements here } // const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function ChannelDetails_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14185,6 +15751,7 @@ export function ChannelDetails_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function ChannelDetails_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14193,6 +15760,7 @@ export function ChannelDetails_set_channel_id(this_ptr: number, val: number): vo // debug statements here } // struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_counterparty(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14201,6 +15769,7 @@ export function ChannelDetails_get_counterparty(this_ptr: number): number { return nativeResponseValue; } // void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val); +/* @internal */ export function ChannelDetails_set_counterparty(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14209,6 +15778,7 @@ export function ChannelDetails_set_counterparty(this_ptr: number, val: number): // debug statements here } // struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_funding_txo(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14217,6 +15787,7 @@ export function ChannelDetails_get_funding_txo(this_ptr: number): number { return nativeResponseValue; } // void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val); +/* @internal */ export function ChannelDetails_set_funding_txo(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14225,6 +15796,7 @@ export function ChannelDetails_set_funding_txo(this_ptr: number, val: number): v // debug statements here } // struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_short_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14233,6 +15805,7 @@ export function ChannelDetails_get_short_channel_id(this_ptr: number): number { return nativeResponseValue; } // void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); +/* @internal */ export function ChannelDetails_set_short_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14241,6 +15814,7 @@ export function ChannelDetails_set_short_channel_id(this_ptr: number, val: numbe // debug statements here } // uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_channel_value_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14249,6 +15823,7 @@ export function ChannelDetails_get_channel_value_satoshis(this_ptr: number): big return nativeResponseValue; } // void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelDetails_set_channel_value_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14257,6 +15832,7 @@ export function ChannelDetails_set_channel_value_satoshis(this_ptr: number, val: // debug statements here } // struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_unspendable_punishment_reserve(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14265,6 +15841,7 @@ export function ChannelDetails_get_unspendable_punishment_reserve(this_ptr: numb return nativeResponseValue; } // void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); +/* @internal */ export function ChannelDetails_set_unspendable_punishment_reserve(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14273,6 +15850,7 @@ export function ChannelDetails_set_unspendable_punishment_reserve(this_ptr: numb // debug statements here } // uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_user_channel_id(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14281,6 +15859,7 @@ export function ChannelDetails_get_user_channel_id(this_ptr: number): bigint { return nativeResponseValue; } // void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelDetails_set_user_channel_id(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14289,6 +15868,7 @@ export function ChannelDetails_set_user_channel_id(this_ptr: number, val: bigint // debug statements here } // uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_balance_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14297,6 +15877,7 @@ export function ChannelDetails_get_balance_msat(this_ptr: number): bigint { return nativeResponseValue; } // void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelDetails_set_balance_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14305,6 +15886,7 @@ export function ChannelDetails_set_balance_msat(this_ptr: number, val: bigint): // debug statements here } // uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_outbound_capacity_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14313,6 +15895,7 @@ export function ChannelDetails_get_outbound_capacity_msat(this_ptr: number): big return nativeResponseValue; } // void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelDetails_set_outbound_capacity_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14321,6 +15904,7 @@ export function ChannelDetails_set_outbound_capacity_msat(this_ptr: number, val: // debug statements here } // uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_inbound_capacity_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14329,6 +15913,7 @@ export function ChannelDetails_get_inbound_capacity_msat(this_ptr: number): bigi return nativeResponseValue; } // void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelDetails_set_inbound_capacity_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14337,6 +15922,7 @@ export function ChannelDetails_set_inbound_capacity_msat(this_ptr: number, val: // debug statements here } // struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_confirmations_required(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14345,6 +15931,7 @@ export function ChannelDetails_get_confirmations_required(this_ptr: number): num return nativeResponseValue; } // void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); +/* @internal */ export function ChannelDetails_set_confirmations_required(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14353,6 +15940,7 @@ export function ChannelDetails_set_confirmations_required(this_ptr: number, val: // debug statements here } // struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_force_close_spend_delay(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14361,6 +15949,7 @@ export function ChannelDetails_get_force_close_spend_delay(this_ptr: number): nu return nativeResponseValue; } // void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val); +/* @internal */ export function ChannelDetails_set_force_close_spend_delay(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14369,6 +15958,7 @@ export function ChannelDetails_set_force_close_spend_delay(this_ptr: number, val // debug statements here } // bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_is_outbound(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14377,6 +15967,7 @@ export function ChannelDetails_get_is_outbound(this_ptr: number): boolean { return nativeResponseValue; } // void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function ChannelDetails_set_is_outbound(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14385,6 +15976,7 @@ export function ChannelDetails_set_is_outbound(this_ptr: number, val: boolean): // debug statements here } // bool ChannelDetails_get_is_funding_locked(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_is_funding_locked(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14393,6 +15985,7 @@ export function ChannelDetails_get_is_funding_locked(this_ptr: number): boolean return nativeResponseValue; } // void ChannelDetails_set_is_funding_locked(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function ChannelDetails_set_is_funding_locked(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14401,6 +15994,7 @@ export function ChannelDetails_set_is_funding_locked(this_ptr: number, val: bool // debug statements here } // bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_is_usable(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14409,6 +16003,7 @@ export function ChannelDetails_get_is_usable(this_ptr: number): boolean { return nativeResponseValue; } // void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function ChannelDetails_set_is_usable(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14417,6 +16012,7 @@ export function ChannelDetails_set_is_usable(this_ptr: number, val: boolean): vo // debug statements here } // bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelDetails_get_is_public(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14425,6 +16021,7 @@ export function ChannelDetails_get_is_public(this_ptr: number): boolean { return nativeResponseValue; } // void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function ChannelDetails_set_is_public(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14433,6 +16030,7 @@ export function ChannelDetails_set_is_public(this_ptr: number, val: boolean): vo // debug statements here } // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKCOption_u64Z short_channel_id_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_funding_locked_arg, bool is_usable_arg, bool is_public_arg); +/* @internal */ export function ChannelDetails_new(channel_id_arg: number, counterparty_arg: number, funding_txo_arg: number, short_channel_id_arg: number, channel_value_satoshis_arg: bigint, unspendable_punishment_reserve_arg: number, user_channel_id_arg: bigint, balance_msat_arg: bigint, outbound_capacity_msat_arg: bigint, inbound_capacity_msat_arg: bigint, confirmations_required_arg: number, force_close_spend_delay_arg: number, is_outbound_arg: boolean, is_funding_locked_arg: boolean, is_usable_arg: boolean, is_public_arg: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14441,6 +16039,7 @@ export function ChannelDetails_new(channel_id_arg: number, counterparty_arg: num return nativeResponseValue; } // uintptr_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg); +/* @internal */ export function ChannelDetails_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14449,6 +16048,7 @@ export function ChannelDetails_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); +/* @internal */ export function ChannelDetails_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14457,6 +16057,7 @@ export function ChannelDetails_clone(orig: number): number { return nativeResponseValue; } // void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr); +/* @internal */ export function PaymentSendFailure_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14465,6 +16066,7 @@ export function PaymentSendFailure_free(this_ptr: number): void { // debug statements here } // uintptr_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg); +/* @internal */ export function PaymentSendFailure_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14473,6 +16075,7 @@ export function PaymentSendFailure_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig); +/* @internal */ export function PaymentSendFailure_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14481,6 +16084,7 @@ export function PaymentSendFailure_clone(orig: number): number { return nativeResponseValue; } // struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a); +/* @internal */ export function PaymentSendFailure_parameter_error(a: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14489,6 +16093,7 @@ export function PaymentSendFailure_parameter_error(a: number): number { return nativeResponseValue; } // struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a); +/* @internal */ export function PaymentSendFailure_path_parameter_error(a: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14497,6 +16102,7 @@ export function PaymentSendFailure_path_parameter_error(a: number): number { return nativeResponseValue; } // struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a); +/* @internal */ export function PaymentSendFailure_all_failed_retry_safe(a: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14505,6 +16111,7 @@ export function PaymentSendFailure_all_failed_retry_safe(a: number): number { return nativeResponseValue; } // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id); +/* @internal */ export function PaymentSendFailure_partial_failure(results: number, failed_paths_retry: number, payment_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14513,6 +16120,7 @@ export function PaymentSendFailure_partial_failure(results: number, failed_paths return nativeResponseValue; } // MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, struct LDKChainParameters params); +/* @internal */ export function ChannelManager_new(fee_est: number, chain_monitor: number, tx_broadcaster: number, logger: number, keys_manager: number, config: number, params: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14521,6 +16129,7 @@ export function ChannelManager_new(fee_est: number, chain_monitor: number, tx_br return nativeResponseValue; } // MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_get_current_default_configuration(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14529,6 +16138,7 @@ export function ChannelManager_get_current_default_configuration(this_arg: numbe return nativeResponseValue; } // MUST_USE_RES struct LDKCResult__u832APIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_channel_id, struct LDKUserConfig override_config); +/* @internal */ export function ChannelManager_create_channel(this_arg: number, their_network_key: number, channel_value_satoshis: bigint, push_msat: bigint, user_channel_id: bigint, override_config: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14537,6 +16147,7 @@ export function ChannelManager_create_channel(this_arg: number, their_network_ke return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_list_channels(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14545,6 +16156,7 @@ export function ChannelManager_list_channels(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_list_usable_channels(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14553,6 +16165,7 @@ export function ChannelManager_list_usable_channels(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]); +/* @internal */ export function ChannelManager_close_channel(this_arg: number, channel_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14561,6 +16174,7 @@ export function ChannelManager_close_channel(this_arg: number, channel_id: numbe return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_target_feerate(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], uint32_t target_feerate_sats_per_1000_weight); +/* @internal */ export function ChannelManager_close_channel_with_target_feerate(this_arg: number, channel_id: number, target_feerate_sats_per_1000_weight: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14569,6 +16183,7 @@ export function ChannelManager_close_channel_with_target_feerate(this_arg: numbe return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]); +/* @internal */ export function ChannelManager_force_close_channel(this_arg: number, channel_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14577,6 +16192,7 @@ export function ChannelManager_force_close_channel(this_arg: number, channel_id: return nativeResponseValue; } // void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_force_close_all_channels(this_arg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14585,6 +16201,7 @@ export function ChannelManager_force_close_all_channels(this_arg: number): void // debug statements here } // MUST_USE_RES struct LDKCResult_PaymentIdPaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret); +/* @internal */ export function ChannelManager_send_payment(this_arg: number, route: number, payment_hash: number, payment_secret: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14593,6 +16210,7 @@ export function ChannelManager_send_payment(this_arg: number, route: number, pay return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_retry_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id); +/* @internal */ export function ChannelManager_retry_payment(this_arg: number, route: number, payment_id: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14601,6 +16219,7 @@ export function ChannelManager_retry_payment(this_arg: number, route: number, pa return nativeResponseValue; } // void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id); +/* @internal */ export function ChannelManager_abandon_payment(this_arg: number, payment_id: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14609,6 +16228,7 @@ export function ChannelManager_abandon_payment(this_arg: number, payment_id: num // debug statements here } // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage); +/* @internal */ export function ChannelManager_send_spontaneous_payment(this_arg: number, route: number, payment_preimage: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14617,6 +16237,7 @@ export function ChannelManager_send_spontaneous_payment(this_arg: number, route: return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKTransaction funding_transaction); +/* @internal */ export function ChannelManager_funding_transaction_generated(this_arg: number, temporary_channel_id: number, funding_transaction: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14625,6 +16246,7 @@ export function ChannelManager_funding_transaction_generated(this_arg: number, t return nativeResponseValue; } // void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses); +/* @internal */ export function ChannelManager_broadcast_node_announcement(this_arg: number, rgb: number, alias: number, addresses: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14633,6 +16255,7 @@ export function ChannelManager_broadcast_node_announcement(this_arg: number, rgb // debug statements here } // void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_process_pending_htlc_forwards(this_arg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14641,6 +16264,7 @@ export function ChannelManager_process_pending_htlc_forwards(this_arg: number): // debug statements here } // void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_timer_tick_occurred(this_arg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14649,6 +16273,7 @@ export function ChannelManager_timer_tick_occurred(this_arg: number): void { // debug statements here } // MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]); +/* @internal */ export function ChannelManager_fail_htlc_backwards(this_arg: number, payment_hash: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14657,6 +16282,7 @@ export function ChannelManager_fail_htlc_backwards(this_arg: number, payment_has return nativeResponseValue; } // MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage); +/* @internal */ export function ChannelManager_claim_funds(this_arg: number, payment_preimage: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14665,6 +16291,7 @@ export function ChannelManager_claim_funds(this_arg: number, payment_preimage: n return nativeResponseValue; } // MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_get_our_node_id(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14673,6 +16300,7 @@ export function ChannelManager_get_our_node_id(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs); +/* @internal */ export function ChannelManager_create_inbound_payment(this_arg: number, min_value_msat: number, invoice_expiry_delta_secs: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14681,6 +16309,7 @@ export function ChannelManager_create_inbound_payment(this_arg: number, min_valu return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ChannelManager_create_inbound_payment_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs); +/* @internal */ export function ChannelManager_create_inbound_payment_legacy(this_arg: number, min_value_msat: number, invoice_expiry_delta_secs: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14689,6 +16318,7 @@ export function ChannelManager_create_inbound_payment_legacy(this_arg: number, m return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_PaymentSecretNoneZ ChannelManager_create_inbound_payment_for_hash(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs); +/* @internal */ export function ChannelManager_create_inbound_payment_for_hash(this_arg: number, payment_hash: number, min_value_msat: number, invoice_expiry_delta_secs: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14697,6 +16327,7 @@ export function ChannelManager_create_inbound_payment_for_hash(this_arg: number, return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_PaymentSecretAPIErrorZ ChannelManager_create_inbound_payment_for_hash_legacy(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs); +/* @internal */ export function ChannelManager_create_inbound_payment_for_hash_legacy(this_arg: number, payment_hash: number, min_value_msat: number, invoice_expiry_delta_secs: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14705,6 +16336,7 @@ export function ChannelManager_create_inbound_payment_for_hash_legacy(this_arg: return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_PaymentPreimageAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret); +/* @internal */ export function ChannelManager_get_payment_preimage(this_arg: number, payment_hash: number, payment_secret: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14713,6 +16345,7 @@ export function ChannelManager_get_payment_preimage(this_arg: number, payment_ha return nativeResponseValue; } // struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_as_MessageSendEventsProvider(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14721,6 +16354,7 @@ export function ChannelManager_as_MessageSendEventsProvider(this_arg: number): n return nativeResponseValue; } // struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_as_EventsProvider(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14729,6 +16363,7 @@ export function ChannelManager_as_EventsProvider(this_arg: number): number { return nativeResponseValue; } // struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_as_Listen(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14737,6 +16372,7 @@ export function ChannelManager_as_Listen(this_arg: number): number { return nativeResponseValue; } // struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_as_Confirm(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14745,6 +16381,7 @@ export function ChannelManager_as_Confirm(this_arg: number): number { return nativeResponseValue; } // void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_await_persistable_update(this_arg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14753,6 +16390,7 @@ export function ChannelManager_await_persistable_update(this_arg: number): void // debug statements here } // MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_current_best_block(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14761,6 +16399,7 @@ export function ChannelManager_current_best_block(this_arg: number): number { return nativeResponseValue; } // struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg); +/* @internal */ export function ChannelManager_as_ChannelMessageHandler(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14769,6 +16408,7 @@ export function ChannelManager_as_ChannelMessageHandler(this_arg: number): numbe return nativeResponseValue; } // struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj); +/* @internal */ export function ChannelManager_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14777,6 +16417,7 @@ export function ChannelManager_write(obj: number): number { return nativeResponseValue; } // void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj); +/* @internal */ export function ChannelManagerReadArgs_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14785,6 +16426,7 @@ export function ChannelManagerReadArgs_free(this_obj: number): void { // debug statements here } // const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelManagerReadArgs_get_keys_manager(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14793,6 +16435,7 @@ export function ChannelManagerReadArgs_get_keys_manager(this_ptr: number): numbe return nativeResponseValue; } // void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val); +/* @internal */ export function ChannelManagerReadArgs_set_keys_manager(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14801,6 +16444,7 @@ export function ChannelManagerReadArgs_set_keys_manager(this_ptr: number, val: n // debug statements here } // const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelManagerReadArgs_get_fee_estimator(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14809,6 +16453,7 @@ export function ChannelManagerReadArgs_get_fee_estimator(this_ptr: number): numb return nativeResponseValue; } // void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val); +/* @internal */ export function ChannelManagerReadArgs_set_fee_estimator(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14817,6 +16462,7 @@ export function ChannelManagerReadArgs_set_fee_estimator(this_ptr: number, val: // debug statements here } // const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelManagerReadArgs_get_chain_monitor(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14825,6 +16471,7 @@ export function ChannelManagerReadArgs_get_chain_monitor(this_ptr: number): numb return nativeResponseValue; } // void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val); +/* @internal */ export function ChannelManagerReadArgs_set_chain_monitor(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14833,6 +16480,7 @@ export function ChannelManagerReadArgs_set_chain_monitor(this_ptr: number, val: // debug statements here } // const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelManagerReadArgs_get_tx_broadcaster(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14841,6 +16489,7 @@ export function ChannelManagerReadArgs_get_tx_broadcaster(this_ptr: number): num return nativeResponseValue; } // void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val); +/* @internal */ export function ChannelManagerReadArgs_set_tx_broadcaster(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14849,6 +16498,7 @@ export function ChannelManagerReadArgs_set_tx_broadcaster(this_ptr: number, val: // debug statements here } // const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelManagerReadArgs_get_logger(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14857,6 +16507,7 @@ export function ChannelManagerReadArgs_get_logger(this_ptr: number): number { return nativeResponseValue; } // void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val); +/* @internal */ export function ChannelManagerReadArgs_set_logger(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14865,6 +16516,7 @@ export function ChannelManagerReadArgs_set_logger(this_ptr: number, val: number) // debug statements here } // struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelManagerReadArgs_get_default_config(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14873,6 +16525,7 @@ export function ChannelManagerReadArgs_get_default_config(this_ptr: number): num return nativeResponseValue; } // void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val); +/* @internal */ export function ChannelManagerReadArgs_set_default_config(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14881,6 +16534,7 @@ export function ChannelManagerReadArgs_set_default_config(this_ptr: number, val: // debug statements here } // MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKKeysInterface keys_manager, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors); +/* @internal */ export function ChannelManagerReadArgs_new(keys_manager: number, fee_estimator: number, chain_monitor: number, tx_broadcaster: number, logger: number, default_config: number, channel_monitors: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14889,6 +16543,7 @@ export function ChannelManagerReadArgs_new(keys_manager: number, fee_estimator: return nativeResponseValue; } // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg); +/* @internal */ export function C2Tuple_BlockHashChannelManagerZ_read(ser: number, arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14897,6 +16552,7 @@ export function C2Tuple_BlockHashChannelManagerZ_read(ser: number, arg: number): return nativeResponseValue; } // void DecodeError_free(struct LDKDecodeError this_obj); +/* @internal */ export function DecodeError_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14905,6 +16561,7 @@ export function DecodeError_free(this_obj: number): void { // debug statements here } // uintptr_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg); +/* @internal */ export function DecodeError_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14913,6 +16570,7 @@ export function DecodeError_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig); +/* @internal */ export function DecodeError_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14921,6 +16579,7 @@ export function DecodeError_clone(orig: number): number { return nativeResponseValue; } // void Init_free(struct LDKInit this_obj); +/* @internal */ export function Init_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14929,6 +16588,7 @@ export function Init_free(this_obj: number): void { // debug statements here } // struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr); +/* @internal */ export function Init_get_features(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14937,6 +16597,7 @@ export function Init_get_features(this_ptr: number): number { return nativeResponseValue; } // void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val); +/* @internal */ export function Init_set_features(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14945,6 +16606,7 @@ export function Init_set_features(this_ptr: number, val: number): void { // debug statements here } // MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg); +/* @internal */ export function Init_new(features_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14953,6 +16615,7 @@ export function Init_new(features_arg: number): number { return nativeResponseValue; } // uintptr_t Init_clone_ptr(LDKInit *NONNULL_PTR arg); +/* @internal */ export function Init_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14961,6 +16624,7 @@ export function Init_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig); +/* @internal */ export function Init_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14969,6 +16633,7 @@ export function Init_clone(orig: number): number { return nativeResponseValue; } // void ErrorMessage_free(struct LDKErrorMessage this_obj); +/* @internal */ export function ErrorMessage_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14977,6 +16642,7 @@ export function ErrorMessage_free(this_obj: number): void { // debug statements here } // const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function ErrorMessage_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14985,6 +16651,7 @@ export function ErrorMessage_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function ErrorMessage_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -14993,6 +16660,7 @@ export function ErrorMessage_set_channel_id(this_ptr: number, val: number): void // debug statements here } // struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr); +/* @internal */ export function ErrorMessage_get_data(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15001,6 +16669,7 @@ export function ErrorMessage_get_data(this_ptr: number): number { return nativeResponseValue; } // void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val); +/* @internal */ export function ErrorMessage_set_data(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15009,6 +16678,7 @@ export function ErrorMessage_set_data(this_ptr: number, val: number): void { // debug statements here } // MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg); +/* @internal */ export function ErrorMessage_new(channel_id_arg: number, data_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15017,6 +16687,7 @@ export function ErrorMessage_new(channel_id_arg: number, data_arg: number): numb return nativeResponseValue; } // uintptr_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg); +/* @internal */ export function ErrorMessage_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15025,6 +16696,7 @@ export function ErrorMessage_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig); +/* @internal */ export function ErrorMessage_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15033,6 +16705,7 @@ export function ErrorMessage_clone(orig: number): number { return nativeResponseValue; } // void Ping_free(struct LDKPing this_obj); +/* @internal */ export function Ping_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15041,6 +16714,7 @@ export function Ping_free(this_obj: number): void { // debug statements here } // uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr); +/* @internal */ export function Ping_get_ponglen(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15049,6 +16723,7 @@ export function Ping_get_ponglen(this_ptr: number): number { return nativeResponseValue; } // void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function Ping_set_ponglen(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15057,6 +16732,7 @@ export function Ping_set_ponglen(this_ptr: number, val: number): void { // debug statements here } // uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr); +/* @internal */ export function Ping_get_byteslen(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15065,6 +16741,7 @@ export function Ping_get_byteslen(this_ptr: number): number { return nativeResponseValue; } // void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function Ping_set_byteslen(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15073,6 +16750,7 @@ export function Ping_set_byteslen(this_ptr: number, val: number): void { // debug statements here } // MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg); +/* @internal */ export function Ping_new(ponglen_arg: number, byteslen_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15081,6 +16759,7 @@ export function Ping_new(ponglen_arg: number, byteslen_arg: number): number { return nativeResponseValue; } // uintptr_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg); +/* @internal */ export function Ping_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15089,6 +16768,7 @@ export function Ping_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig); +/* @internal */ export function Ping_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15097,6 +16777,7 @@ export function Ping_clone(orig: number): number { return nativeResponseValue; } // void Pong_free(struct LDKPong this_obj); +/* @internal */ export function Pong_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15105,6 +16786,7 @@ export function Pong_free(this_obj: number): void { // debug statements here } // uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr); +/* @internal */ export function Pong_get_byteslen(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15113,6 +16795,7 @@ export function Pong_get_byteslen(this_ptr: number): number { return nativeResponseValue; } // void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function Pong_set_byteslen(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15121,6 +16804,7 @@ export function Pong_set_byteslen(this_ptr: number, val: number): void { // debug statements here } // MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg); +/* @internal */ export function Pong_new(byteslen_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15129,6 +16813,7 @@ export function Pong_new(byteslen_arg: number): number { return nativeResponseValue; } // uintptr_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg); +/* @internal */ export function Pong_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15137,6 +16822,7 @@ export function Pong_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig); +/* @internal */ export function Pong_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15145,6 +16831,7 @@ export function Pong_clone(orig: number): number { return nativeResponseValue; } // void OpenChannel_free(struct LDKOpenChannel this_obj); +/* @internal */ export function OpenChannel_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15153,6 +16840,7 @@ export function OpenChannel_free(this_obj: number): void { // debug statements here } // const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function OpenChannel_get_chain_hash(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15161,6 +16849,7 @@ export function OpenChannel_get_chain_hash(this_ptr: number): number { return nativeResponseValue; } // void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function OpenChannel_set_chain_hash(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15169,6 +16858,7 @@ export function OpenChannel_set_chain_hash(this_ptr: number, val: number): void // debug statements here } // const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function OpenChannel_get_temporary_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15177,6 +16867,7 @@ export function OpenChannel_get_temporary_channel_id(this_ptr: number): number { return nativeResponseValue; } // void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function OpenChannel_set_temporary_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15185,6 +16876,7 @@ export function OpenChannel_set_temporary_channel_id(this_ptr: number, val: numb // debug statements here } // uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_funding_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15193,6 +16885,7 @@ export function OpenChannel_get_funding_satoshis(this_ptr: number): bigint { return nativeResponseValue; } // void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function OpenChannel_set_funding_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15201,6 +16894,7 @@ export function OpenChannel_set_funding_satoshis(this_ptr: number, val: bigint): // debug statements here } // uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_push_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15209,6 +16903,7 @@ export function OpenChannel_get_push_msat(this_ptr: number): bigint { return nativeResponseValue; } // void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function OpenChannel_set_push_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15217,6 +16912,7 @@ export function OpenChannel_set_push_msat(this_ptr: number, val: bigint): void { // debug statements here } // uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_dust_limit_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15225,6 +16921,7 @@ export function OpenChannel_get_dust_limit_satoshis(this_ptr: number): bigint { return nativeResponseValue; } // void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function OpenChannel_set_dust_limit_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15233,6 +16930,7 @@ export function OpenChannel_set_dust_limit_satoshis(this_ptr: number, val: bigin // debug statements here } // uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15241,6 +16939,7 @@ export function OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr: number): return nativeResponseValue; } // void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15249,6 +16948,7 @@ export function OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr: number, // debug statements here } // uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_channel_reserve_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15257,6 +16957,7 @@ export function OpenChannel_get_channel_reserve_satoshis(this_ptr: number): bigi return nativeResponseValue; } // void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function OpenChannel_set_channel_reserve_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15265,6 +16966,7 @@ export function OpenChannel_set_channel_reserve_satoshis(this_ptr: number, val: // debug statements here } // uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_htlc_minimum_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15273,6 +16975,7 @@ export function OpenChannel_get_htlc_minimum_msat(this_ptr: number): bigint { return nativeResponseValue; } // void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function OpenChannel_set_htlc_minimum_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15281,6 +16984,7 @@ export function OpenChannel_set_htlc_minimum_msat(this_ptr: number, val: bigint) // debug statements here } // uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_feerate_per_kw(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15289,6 +16993,7 @@ export function OpenChannel_get_feerate_per_kw(this_ptr: number): number { return nativeResponseValue; } // void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function OpenChannel_set_feerate_per_kw(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15297,6 +17002,7 @@ export function OpenChannel_set_feerate_per_kw(this_ptr: number, val: number): v // debug statements here } // uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_to_self_delay(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15305,6 +17011,7 @@ export function OpenChannel_get_to_self_delay(this_ptr: number): number { return nativeResponseValue; } // void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function OpenChannel_set_to_self_delay(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15313,6 +17020,7 @@ export function OpenChannel_set_to_self_delay(this_ptr: number, val: number): vo // debug statements here } // uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_max_accepted_htlcs(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15321,6 +17029,7 @@ export function OpenChannel_get_max_accepted_htlcs(this_ptr: number): number { return nativeResponseValue; } // void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function OpenChannel_set_max_accepted_htlcs(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15329,6 +17038,7 @@ export function OpenChannel_set_max_accepted_htlcs(this_ptr: number, val: number // debug statements here } // struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_funding_pubkey(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15337,6 +17047,7 @@ export function OpenChannel_get_funding_pubkey(this_ptr: number): number { return nativeResponseValue; } // void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function OpenChannel_set_funding_pubkey(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15345,6 +17056,7 @@ export function OpenChannel_set_funding_pubkey(this_ptr: number, val: number): v // debug statements here } // struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_revocation_basepoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15353,6 +17065,7 @@ export function OpenChannel_get_revocation_basepoint(this_ptr: number): number { return nativeResponseValue; } // void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function OpenChannel_set_revocation_basepoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15361,6 +17074,7 @@ export function OpenChannel_set_revocation_basepoint(this_ptr: number, val: numb // debug statements here } // struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_payment_point(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15369,6 +17083,7 @@ export function OpenChannel_get_payment_point(this_ptr: number): number { return nativeResponseValue; } // void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function OpenChannel_set_payment_point(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15377,6 +17092,7 @@ export function OpenChannel_set_payment_point(this_ptr: number, val: number): vo // debug statements here } // struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_delayed_payment_basepoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15385,6 +17101,7 @@ export function OpenChannel_get_delayed_payment_basepoint(this_ptr: number): num return nativeResponseValue; } // void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function OpenChannel_set_delayed_payment_basepoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15393,6 +17110,7 @@ export function OpenChannel_set_delayed_payment_basepoint(this_ptr: number, val: // debug statements here } // struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_htlc_basepoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15401,6 +17119,7 @@ export function OpenChannel_get_htlc_basepoint(this_ptr: number): number { return nativeResponseValue; } // void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function OpenChannel_set_htlc_basepoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15409,6 +17128,7 @@ export function OpenChannel_set_htlc_basepoint(this_ptr: number, val: number): v // debug statements here } // struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_first_per_commitment_point(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15417,6 +17137,7 @@ export function OpenChannel_get_first_per_commitment_point(this_ptr: number): nu return nativeResponseValue; } // void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function OpenChannel_set_first_per_commitment_point(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15425,6 +17146,7 @@ export function OpenChannel_set_first_per_commitment_point(this_ptr: number, val // debug statements here } // uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_channel_flags(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15433,6 +17155,7 @@ export function OpenChannel_get_channel_flags(this_ptr: number): number { return nativeResponseValue; } // void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val); +/* @internal */ export function OpenChannel_set_channel_flags(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15441,6 +17164,7 @@ export function OpenChannel_set_channel_flags(this_ptr: number, val: number): vo // debug statements here } // struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr); +/* @internal */ export function OpenChannel_get_channel_type(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15449,6 +17173,7 @@ export function OpenChannel_get_channel_type(this_ptr: number): number { return nativeResponseValue; } // void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); +/* @internal */ export function OpenChannel_set_channel_type(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15457,6 +17182,7 @@ export function OpenChannel_set_channel_type(this_ptr: number, val: number): voi // debug statements here } // uintptr_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg); +/* @internal */ export function OpenChannel_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15465,6 +17191,7 @@ export function OpenChannel_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig); +/* @internal */ export function OpenChannel_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15473,6 +17200,7 @@ export function OpenChannel_clone(orig: number): number { return nativeResponseValue; } // void AcceptChannel_free(struct LDKAcceptChannel this_obj); +/* @internal */ export function AcceptChannel_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15481,6 +17209,7 @@ export function AcceptChannel_free(this_obj: number): void { // debug statements here } // const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function AcceptChannel_get_temporary_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15489,6 +17218,7 @@ export function AcceptChannel_get_temporary_channel_id(this_ptr: number): number return nativeResponseValue; } // void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function AcceptChannel_set_temporary_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15497,6 +17227,7 @@ export function AcceptChannel_set_temporary_channel_id(this_ptr: number, val: nu // debug statements here } // uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_dust_limit_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15505,6 +17236,7 @@ export function AcceptChannel_get_dust_limit_satoshis(this_ptr: number): bigint return nativeResponseValue; } // void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function AcceptChannel_set_dust_limit_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15513,6 +17245,7 @@ export function AcceptChannel_set_dust_limit_satoshis(this_ptr: number, val: big // debug statements here } // uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15521,6 +17254,7 @@ export function AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr: number return nativeResponseValue; } // void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15529,6 +17263,7 @@ export function AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr: number // debug statements here } // uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_channel_reserve_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15537,6 +17272,7 @@ export function AcceptChannel_get_channel_reserve_satoshis(this_ptr: number): bi return nativeResponseValue; } // void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function AcceptChannel_set_channel_reserve_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15545,6 +17281,7 @@ export function AcceptChannel_set_channel_reserve_satoshis(this_ptr: number, val // debug statements here } // uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_htlc_minimum_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15553,6 +17290,7 @@ export function AcceptChannel_get_htlc_minimum_msat(this_ptr: number): bigint { return nativeResponseValue; } // void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function AcceptChannel_set_htlc_minimum_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15561,6 +17299,7 @@ export function AcceptChannel_set_htlc_minimum_msat(this_ptr: number, val: bigin // debug statements here } // uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_minimum_depth(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15569,6 +17308,7 @@ export function AcceptChannel_get_minimum_depth(this_ptr: number): number { return nativeResponseValue; } // void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function AcceptChannel_set_minimum_depth(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15577,6 +17317,7 @@ export function AcceptChannel_set_minimum_depth(this_ptr: number, val: number): // debug statements here } // uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_to_self_delay(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15585,6 +17326,7 @@ export function AcceptChannel_get_to_self_delay(this_ptr: number): number { return nativeResponseValue; } // void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function AcceptChannel_set_to_self_delay(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15593,6 +17335,7 @@ export function AcceptChannel_set_to_self_delay(this_ptr: number, val: number): // debug statements here } // uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_max_accepted_htlcs(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15601,6 +17344,7 @@ export function AcceptChannel_get_max_accepted_htlcs(this_ptr: number): number { return nativeResponseValue; } // void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function AcceptChannel_set_max_accepted_htlcs(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15609,6 +17353,7 @@ export function AcceptChannel_set_max_accepted_htlcs(this_ptr: number, val: numb // debug statements here } // struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_funding_pubkey(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15617,6 +17362,7 @@ export function AcceptChannel_get_funding_pubkey(this_ptr: number): number { return nativeResponseValue; } // void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function AcceptChannel_set_funding_pubkey(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15625,6 +17371,7 @@ export function AcceptChannel_set_funding_pubkey(this_ptr: number, val: number): // debug statements here } // struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_revocation_basepoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15633,6 +17380,7 @@ export function AcceptChannel_get_revocation_basepoint(this_ptr: number): number return nativeResponseValue; } // void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function AcceptChannel_set_revocation_basepoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15641,6 +17389,7 @@ export function AcceptChannel_set_revocation_basepoint(this_ptr: number, val: nu // debug statements here } // struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_payment_point(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15649,6 +17398,7 @@ export function AcceptChannel_get_payment_point(this_ptr: number): number { return nativeResponseValue; } // void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function AcceptChannel_set_payment_point(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15657,6 +17407,7 @@ export function AcceptChannel_set_payment_point(this_ptr: number, val: number): // debug statements here } // struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_delayed_payment_basepoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15665,6 +17416,7 @@ export function AcceptChannel_get_delayed_payment_basepoint(this_ptr: number): n return nativeResponseValue; } // void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function AcceptChannel_set_delayed_payment_basepoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15673,6 +17425,7 @@ export function AcceptChannel_set_delayed_payment_basepoint(this_ptr: number, va // debug statements here } // struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_htlc_basepoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15681,6 +17434,7 @@ export function AcceptChannel_get_htlc_basepoint(this_ptr: number): number { return nativeResponseValue; } // void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function AcceptChannel_set_htlc_basepoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15689,6 +17443,7 @@ export function AcceptChannel_set_htlc_basepoint(this_ptr: number, val: number): // debug statements here } // struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); +/* @internal */ export function AcceptChannel_get_first_per_commitment_point(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15697,6 +17452,7 @@ export function AcceptChannel_get_first_per_commitment_point(this_ptr: number): return nativeResponseValue; } // void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function AcceptChannel_set_first_per_commitment_point(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15705,6 +17461,7 @@ export function AcceptChannel_set_first_per_commitment_point(this_ptr: number, v // debug statements here } // uintptr_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg); +/* @internal */ export function AcceptChannel_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15713,6 +17470,7 @@ export function AcceptChannel_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig); +/* @internal */ export function AcceptChannel_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15721,6 +17479,7 @@ export function AcceptChannel_clone(orig: number): number { return nativeResponseValue; } // void FundingCreated_free(struct LDKFundingCreated this_obj); +/* @internal */ export function FundingCreated_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15729,6 +17488,7 @@ export function FundingCreated_free(this_obj: number): void { // debug statements here } // const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function FundingCreated_get_temporary_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15737,6 +17497,7 @@ export function FundingCreated_get_temporary_channel_id(this_ptr: number): numbe return nativeResponseValue; } // void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function FundingCreated_set_temporary_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15745,6 +17506,7 @@ export function FundingCreated_set_temporary_channel_id(this_ptr: number, val: n // debug statements here } // const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function FundingCreated_get_funding_txid(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15753,6 +17515,7 @@ export function FundingCreated_get_funding_txid(this_ptr: number): number { return nativeResponseValue; } // void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function FundingCreated_set_funding_txid(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15761,6 +17524,7 @@ export function FundingCreated_set_funding_txid(this_ptr: number, val: number): // debug statements here } // uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr); +/* @internal */ export function FundingCreated_get_funding_output_index(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15769,6 +17533,7 @@ export function FundingCreated_get_funding_output_index(this_ptr: number): numbe return nativeResponseValue; } // void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function FundingCreated_set_funding_output_index(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15777,6 +17542,7 @@ export function FundingCreated_set_funding_output_index(this_ptr: number, val: n // debug statements here } // struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr); +/* @internal */ export function FundingCreated_get_signature(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15785,6 +17551,7 @@ export function FundingCreated_get_signature(this_ptr: number): number { return nativeResponseValue; } // void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function FundingCreated_set_signature(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15793,6 +17560,7 @@ export function FundingCreated_set_signature(this_ptr: number, val: number): voi // debug statements here } // MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKSignature signature_arg); +/* @internal */ export function FundingCreated_new(temporary_channel_id_arg: number, funding_txid_arg: number, funding_output_index_arg: number, signature_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15801,6 +17569,7 @@ export function FundingCreated_new(temporary_channel_id_arg: number, funding_txi return nativeResponseValue; } // uintptr_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg); +/* @internal */ export function FundingCreated_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15809,6 +17578,7 @@ export function FundingCreated_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig); +/* @internal */ export function FundingCreated_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15817,6 +17587,7 @@ export function FundingCreated_clone(orig: number): number { return nativeResponseValue; } // void FundingSigned_free(struct LDKFundingSigned this_obj); +/* @internal */ export function FundingSigned_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15825,6 +17596,7 @@ export function FundingSigned_free(this_obj: number): void { // debug statements here } // const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function FundingSigned_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15833,6 +17605,7 @@ export function FundingSigned_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function FundingSigned_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15841,6 +17614,7 @@ export function FundingSigned_set_channel_id(this_ptr: number, val: number): voi // debug statements here } // struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr); +/* @internal */ export function FundingSigned_get_signature(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15849,6 +17623,7 @@ export function FundingSigned_get_signature(this_ptr: number): number { return nativeResponseValue; } // void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function FundingSigned_set_signature(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15857,6 +17632,7 @@ export function FundingSigned_set_signature(this_ptr: number, val: number): void // debug statements here } // MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg); +/* @internal */ export function FundingSigned_new(channel_id_arg: number, signature_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15865,6 +17641,7 @@ export function FundingSigned_new(channel_id_arg: number, signature_arg: number) return nativeResponseValue; } // uintptr_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg); +/* @internal */ export function FundingSigned_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15873,6 +17650,7 @@ export function FundingSigned_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig); +/* @internal */ export function FundingSigned_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15881,6 +17659,7 @@ export function FundingSigned_clone(orig: number): number { return nativeResponseValue; } // void FundingLocked_free(struct LDKFundingLocked this_obj); +/* @internal */ export function FundingLocked_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15889,6 +17668,7 @@ export function FundingLocked_free(this_obj: number): void { // debug statements here } // const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function FundingLocked_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15897,6 +17677,7 @@ export function FundingLocked_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function FundingLocked_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15905,6 +17686,7 @@ export function FundingLocked_set_channel_id(this_ptr: number, val: number): voi // debug statements here } // struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr); +/* @internal */ export function FundingLocked_get_next_per_commitment_point(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15913,6 +17695,7 @@ export function FundingLocked_get_next_per_commitment_point(this_ptr: number): n return nativeResponseValue; } // void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function FundingLocked_set_next_per_commitment_point(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15921,6 +17704,7 @@ export function FundingLocked_set_next_per_commitment_point(this_ptr: number, va // debug statements here } // MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg); +/* @internal */ export function FundingLocked_new(channel_id_arg: number, next_per_commitment_point_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15929,6 +17713,7 @@ export function FundingLocked_new(channel_id_arg: number, next_per_commitment_po return nativeResponseValue; } // uintptr_t FundingLocked_clone_ptr(LDKFundingLocked *NONNULL_PTR arg); +/* @internal */ export function FundingLocked_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15937,6 +17722,7 @@ export function FundingLocked_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig); +/* @internal */ export function FundingLocked_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15945,6 +17731,7 @@ export function FundingLocked_clone(orig: number): number { return nativeResponseValue; } // void Shutdown_free(struct LDKShutdown this_obj); +/* @internal */ export function Shutdown_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15953,6 +17740,7 @@ export function Shutdown_free(this_obj: number): void { // debug statements here } // const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function Shutdown_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15961,6 +17749,7 @@ export function Shutdown_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function Shutdown_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15969,6 +17758,7 @@ export function Shutdown_set_channel_id(this_ptr: number, val: number): void { // debug statements here } // struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr); +/* @internal */ export function Shutdown_get_scriptpubkey(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15977,6 +17767,7 @@ export function Shutdown_get_scriptpubkey(this_ptr: number): number { return nativeResponseValue; } // void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); +/* @internal */ export function Shutdown_set_scriptpubkey(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15985,6 +17776,7 @@ export function Shutdown_set_scriptpubkey(this_ptr: number, val: number): void { // debug statements here } // MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg); +/* @internal */ export function Shutdown_new(channel_id_arg: number, scriptpubkey_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -15993,6 +17785,7 @@ export function Shutdown_new(channel_id_arg: number, scriptpubkey_arg: number): return nativeResponseValue; } // uintptr_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg); +/* @internal */ export function Shutdown_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16001,6 +17794,7 @@ export function Shutdown_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig); +/* @internal */ export function Shutdown_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16009,6 +17803,7 @@ export function Shutdown_clone(orig: number): number { return nativeResponseValue; } // void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj); +/* @internal */ export function ClosingSignedFeeRange_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16017,6 +17812,7 @@ export function ClosingSignedFeeRange_free(this_obj: number): void { // debug statements here } // uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr); +/* @internal */ export function ClosingSignedFeeRange_get_min_fee_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16025,6 +17821,7 @@ export function ClosingSignedFeeRange_get_min_fee_satoshis(this_ptr: number): bi return nativeResponseValue; } // void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ClosingSignedFeeRange_set_min_fee_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16033,6 +17830,7 @@ export function ClosingSignedFeeRange_set_min_fee_satoshis(this_ptr: number, val // debug statements here } // uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr); +/* @internal */ export function ClosingSignedFeeRange_get_max_fee_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16041,6 +17839,7 @@ export function ClosingSignedFeeRange_get_max_fee_satoshis(this_ptr: number): bi return nativeResponseValue; } // void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ClosingSignedFeeRange_set_max_fee_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16049,6 +17848,7 @@ export function ClosingSignedFeeRange_set_max_fee_satoshis(this_ptr: number, val // debug statements here } // MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg); +/* @internal */ export function ClosingSignedFeeRange_new(min_fee_satoshis_arg: bigint, max_fee_satoshis_arg: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16057,6 +17857,7 @@ export function ClosingSignedFeeRange_new(min_fee_satoshis_arg: bigint, max_fee_ return nativeResponseValue; } // uintptr_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg); +/* @internal */ export function ClosingSignedFeeRange_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16065,6 +17866,7 @@ export function ClosingSignedFeeRange_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig); +/* @internal */ export function ClosingSignedFeeRange_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16073,6 +17875,7 @@ export function ClosingSignedFeeRange_clone(orig: number): number { return nativeResponseValue; } // void ClosingSigned_free(struct LDKClosingSigned this_obj); +/* @internal */ export function ClosingSigned_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16081,6 +17884,7 @@ export function ClosingSigned_free(this_obj: number): void { // debug statements here } // const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function ClosingSigned_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16089,6 +17893,7 @@ export function ClosingSigned_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function ClosingSigned_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16097,6 +17902,7 @@ export function ClosingSigned_set_channel_id(this_ptr: number, val: number): voi // debug statements here } // uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr); +/* @internal */ export function ClosingSigned_get_fee_satoshis(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16105,6 +17911,7 @@ export function ClosingSigned_get_fee_satoshis(this_ptr: number): bigint { return nativeResponseValue; } // void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ClosingSigned_set_fee_satoshis(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16113,6 +17920,7 @@ export function ClosingSigned_set_fee_satoshis(this_ptr: number, val: bigint): v // debug statements here } // struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr); +/* @internal */ export function ClosingSigned_get_signature(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16121,6 +17929,7 @@ export function ClosingSigned_get_signature(this_ptr: number): number { return nativeResponseValue; } // void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function ClosingSigned_set_signature(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16129,6 +17938,7 @@ export function ClosingSigned_set_signature(this_ptr: number, val: number): void // debug statements here } // struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr); +/* @internal */ export function ClosingSigned_get_fee_range(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16137,6 +17947,7 @@ export function ClosingSigned_get_fee_range(this_ptr: number): number { return nativeResponseValue; } // void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val); +/* @internal */ export function ClosingSigned_set_fee_range(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16145,6 +17956,7 @@ export function ClosingSigned_set_fee_range(this_ptr: number, val: number): void // debug statements here } // MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg); +/* @internal */ export function ClosingSigned_new(channel_id_arg: number, fee_satoshis_arg: bigint, signature_arg: number, fee_range_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16153,6 +17965,7 @@ export function ClosingSigned_new(channel_id_arg: number, fee_satoshis_arg: bigi return nativeResponseValue; } // uintptr_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg); +/* @internal */ export function ClosingSigned_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16161,6 +17974,7 @@ export function ClosingSigned_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig); +/* @internal */ export function ClosingSigned_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16169,6 +17983,7 @@ export function ClosingSigned_clone(orig: number): number { return nativeResponseValue; } // void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj); +/* @internal */ export function UpdateAddHTLC_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16177,6 +17992,7 @@ export function UpdateAddHTLC_free(this_obj: number): void { // debug statements here } // const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function UpdateAddHTLC_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16185,6 +18001,7 @@ export function UpdateAddHTLC_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function UpdateAddHTLC_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16193,6 +18010,7 @@ export function UpdateAddHTLC_set_channel_id(this_ptr: number, val: number): voi // debug statements here } // uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); +/* @internal */ export function UpdateAddHTLC_get_htlc_id(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16201,6 +18019,7 @@ export function UpdateAddHTLC_get_htlc_id(this_ptr: number): bigint { return nativeResponseValue; } // void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function UpdateAddHTLC_set_htlc_id(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16209,6 +18028,7 @@ export function UpdateAddHTLC_set_htlc_id(this_ptr: number, val: bigint): void { // debug statements here } // uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); +/* @internal */ export function UpdateAddHTLC_get_amount_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16217,6 +18037,7 @@ export function UpdateAddHTLC_get_amount_msat(this_ptr: number): bigint { return nativeResponseValue; } // void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function UpdateAddHTLC_set_amount_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16225,6 +18046,7 @@ export function UpdateAddHTLC_set_amount_msat(this_ptr: number, val: bigint): vo // debug statements here } // const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function UpdateAddHTLC_get_payment_hash(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16233,6 +18055,7 @@ export function UpdateAddHTLC_get_payment_hash(this_ptr: number): number { return nativeResponseValue; } // void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function UpdateAddHTLC_set_payment_hash(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16241,6 +18064,7 @@ export function UpdateAddHTLC_set_payment_hash(this_ptr: number, val: number): v // debug statements here } // uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); +/* @internal */ export function UpdateAddHTLC_get_cltv_expiry(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16249,6 +18073,7 @@ export function UpdateAddHTLC_get_cltv_expiry(this_ptr: number): number { return nativeResponseValue; } // void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function UpdateAddHTLC_set_cltv_expiry(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16257,6 +18082,7 @@ export function UpdateAddHTLC_set_cltv_expiry(this_ptr: number, val: number): vo // debug statements here } // uintptr_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg); +/* @internal */ export function UpdateAddHTLC_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16265,6 +18091,7 @@ export function UpdateAddHTLC_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig); +/* @internal */ export function UpdateAddHTLC_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16273,6 +18100,7 @@ export function UpdateAddHTLC_clone(orig: number): number { return nativeResponseValue; } // void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj); +/* @internal */ export function UpdateFulfillHTLC_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16281,6 +18109,7 @@ export function UpdateFulfillHTLC_free(this_obj: number): void { // debug statements here } // const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function UpdateFulfillHTLC_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16289,6 +18118,7 @@ export function UpdateFulfillHTLC_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function UpdateFulfillHTLC_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16297,6 +18127,7 @@ export function UpdateFulfillHTLC_set_channel_id(this_ptr: number, val: number): // debug statements here } // uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr); +/* @internal */ export function UpdateFulfillHTLC_get_htlc_id(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16305,6 +18136,7 @@ export function UpdateFulfillHTLC_get_htlc_id(this_ptr: number): bigint { return nativeResponseValue; } // void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function UpdateFulfillHTLC_set_htlc_id(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16313,6 +18145,7 @@ export function UpdateFulfillHTLC_set_htlc_id(this_ptr: number, val: bigint): vo // debug statements here } // const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function UpdateFulfillHTLC_get_payment_preimage(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16321,6 +18154,7 @@ export function UpdateFulfillHTLC_get_payment_preimage(this_ptr: number): number return nativeResponseValue; } // void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function UpdateFulfillHTLC_set_payment_preimage(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16329,6 +18163,7 @@ export function UpdateFulfillHTLC_set_payment_preimage(this_ptr: number, val: nu // debug statements here } // MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg); +/* @internal */ export function UpdateFulfillHTLC_new(channel_id_arg: number, htlc_id_arg: bigint, payment_preimage_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16337,6 +18172,7 @@ export function UpdateFulfillHTLC_new(channel_id_arg: number, htlc_id_arg: bigin return nativeResponseValue; } // uintptr_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg); +/* @internal */ export function UpdateFulfillHTLC_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16345,6 +18181,7 @@ export function UpdateFulfillHTLC_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig); +/* @internal */ export function UpdateFulfillHTLC_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16353,6 +18190,7 @@ export function UpdateFulfillHTLC_clone(orig: number): number { return nativeResponseValue; } // void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj); +/* @internal */ export function UpdateFailHTLC_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16361,6 +18199,7 @@ export function UpdateFailHTLC_free(this_obj: number): void { // debug statements here } // const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function UpdateFailHTLC_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16369,6 +18208,7 @@ export function UpdateFailHTLC_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function UpdateFailHTLC_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16377,6 +18217,7 @@ export function UpdateFailHTLC_set_channel_id(this_ptr: number, val: number): vo // debug statements here } // uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr); +/* @internal */ export function UpdateFailHTLC_get_htlc_id(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16385,6 +18226,7 @@ export function UpdateFailHTLC_get_htlc_id(this_ptr: number): bigint { return nativeResponseValue; } // void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function UpdateFailHTLC_set_htlc_id(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16393,6 +18235,7 @@ export function UpdateFailHTLC_set_htlc_id(this_ptr: number, val: bigint): void // debug statements here } // uintptr_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg); +/* @internal */ export function UpdateFailHTLC_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16401,6 +18244,7 @@ export function UpdateFailHTLC_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig); +/* @internal */ export function UpdateFailHTLC_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16409,6 +18253,7 @@ export function UpdateFailHTLC_clone(orig: number): number { return nativeResponseValue; } // void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj); +/* @internal */ export function UpdateFailMalformedHTLC_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16417,6 +18262,7 @@ export function UpdateFailMalformedHTLC_free(this_obj: number): void { // debug statements here } // const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function UpdateFailMalformedHTLC_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16425,6 +18271,7 @@ export function UpdateFailMalformedHTLC_get_channel_id(this_ptr: number): number return nativeResponseValue; } // void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function UpdateFailMalformedHTLC_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16433,6 +18280,7 @@ export function UpdateFailMalformedHTLC_set_channel_id(this_ptr: number, val: nu // debug statements here } // uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr); +/* @internal */ export function UpdateFailMalformedHTLC_get_htlc_id(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16441,6 +18289,7 @@ export function UpdateFailMalformedHTLC_get_htlc_id(this_ptr: number): bigint { return nativeResponseValue; } // void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function UpdateFailMalformedHTLC_set_htlc_id(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16449,6 +18298,7 @@ export function UpdateFailMalformedHTLC_set_htlc_id(this_ptr: number, val: bigin // debug statements here } // uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr); +/* @internal */ export function UpdateFailMalformedHTLC_get_failure_code(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16457,6 +18307,7 @@ export function UpdateFailMalformedHTLC_get_failure_code(this_ptr: number): numb return nativeResponseValue; } // void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function UpdateFailMalformedHTLC_set_failure_code(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16465,6 +18316,7 @@ export function UpdateFailMalformedHTLC_set_failure_code(this_ptr: number, val: // debug statements here } // uintptr_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg); +/* @internal */ export function UpdateFailMalformedHTLC_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16473,6 +18325,7 @@ export function UpdateFailMalformedHTLC_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig); +/* @internal */ export function UpdateFailMalformedHTLC_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16481,6 +18334,7 @@ export function UpdateFailMalformedHTLC_clone(orig: number): number { return nativeResponseValue; } // void CommitmentSigned_free(struct LDKCommitmentSigned this_obj); +/* @internal */ export function CommitmentSigned_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16489,6 +18343,7 @@ export function CommitmentSigned_free(this_obj: number): void { // debug statements here } // const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function CommitmentSigned_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16497,6 +18352,7 @@ export function CommitmentSigned_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function CommitmentSigned_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16505,6 +18361,7 @@ export function CommitmentSigned_set_channel_id(this_ptr: number, val: number): // debug statements here } // struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr); +/* @internal */ export function CommitmentSigned_get_signature(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16513,6 +18370,7 @@ export function CommitmentSigned_get_signature(this_ptr: number): number { return nativeResponseValue; } // void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function CommitmentSigned_set_signature(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16521,6 +18379,7 @@ export function CommitmentSigned_set_signature(this_ptr: number, val: number): v // debug statements here } // void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val); +/* @internal */ export function CommitmentSigned_set_htlc_signatures(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16529,6 +18388,7 @@ export function CommitmentSigned_set_htlc_signatures(this_ptr: number, val: numb // debug statements here } // MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg); +/* @internal */ export function CommitmentSigned_new(channel_id_arg: number, signature_arg: number, htlc_signatures_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16537,6 +18397,7 @@ export function CommitmentSigned_new(channel_id_arg: number, signature_arg: numb return nativeResponseValue; } // uintptr_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg); +/* @internal */ export function CommitmentSigned_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16545,6 +18406,7 @@ export function CommitmentSigned_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig); +/* @internal */ export function CommitmentSigned_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16553,6 +18415,7 @@ export function CommitmentSigned_clone(orig: number): number { return nativeResponseValue; } // void RevokeAndACK_free(struct LDKRevokeAndACK this_obj); +/* @internal */ export function RevokeAndACK_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16561,6 +18424,7 @@ export function RevokeAndACK_free(this_obj: number): void { // debug statements here } // const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function RevokeAndACK_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16569,6 +18433,7 @@ export function RevokeAndACK_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function RevokeAndACK_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16577,6 +18442,7 @@ export function RevokeAndACK_set_channel_id(this_ptr: number, val: number): void // debug statements here } // const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function RevokeAndACK_get_per_commitment_secret(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16585,6 +18451,7 @@ export function RevokeAndACK_get_per_commitment_secret(this_ptr: number): number return nativeResponseValue; } // void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function RevokeAndACK_set_per_commitment_secret(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16593,6 +18460,7 @@ export function RevokeAndACK_set_per_commitment_secret(this_ptr: number, val: nu // debug statements here } // struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr); +/* @internal */ export function RevokeAndACK_get_next_per_commitment_point(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16601,6 +18469,7 @@ export function RevokeAndACK_get_next_per_commitment_point(this_ptr: number): nu return nativeResponseValue; } // void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function RevokeAndACK_set_next_per_commitment_point(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16609,6 +18478,7 @@ export function RevokeAndACK_set_next_per_commitment_point(this_ptr: number, val // debug statements here } // MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg); +/* @internal */ export function RevokeAndACK_new(channel_id_arg: number, per_commitment_secret_arg: number, next_per_commitment_point_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16617,6 +18487,7 @@ export function RevokeAndACK_new(channel_id_arg: number, per_commitment_secret_a return nativeResponseValue; } // uintptr_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg); +/* @internal */ export function RevokeAndACK_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16625,6 +18496,7 @@ export function RevokeAndACK_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig); +/* @internal */ export function RevokeAndACK_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16633,6 +18505,7 @@ export function RevokeAndACK_clone(orig: number): number { return nativeResponseValue; } // void UpdateFee_free(struct LDKUpdateFee this_obj); +/* @internal */ export function UpdateFee_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16641,6 +18514,7 @@ export function UpdateFee_free(this_obj: number): void { // debug statements here } // const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function UpdateFee_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16649,6 +18523,7 @@ export function UpdateFee_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function UpdateFee_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16657,6 +18532,7 @@ export function UpdateFee_set_channel_id(this_ptr: number, val: number): void { // debug statements here } // uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr); +/* @internal */ export function UpdateFee_get_feerate_per_kw(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16665,6 +18541,7 @@ export function UpdateFee_get_feerate_per_kw(this_ptr: number): number { return nativeResponseValue; } // void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function UpdateFee_set_feerate_per_kw(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16673,6 +18550,7 @@ export function UpdateFee_set_feerate_per_kw(this_ptr: number, val: number): voi // debug statements here } // MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg); +/* @internal */ export function UpdateFee_new(channel_id_arg: number, feerate_per_kw_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16681,6 +18559,7 @@ export function UpdateFee_new(channel_id_arg: number, feerate_per_kw_arg: number return nativeResponseValue; } // uintptr_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg); +/* @internal */ export function UpdateFee_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16689,6 +18568,7 @@ export function UpdateFee_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig); +/* @internal */ export function UpdateFee_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16697,6 +18577,7 @@ export function UpdateFee_clone(orig: number): number { return nativeResponseValue; } // void DataLossProtect_free(struct LDKDataLossProtect this_obj); +/* @internal */ export function DataLossProtect_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16705,6 +18586,7 @@ export function DataLossProtect_free(this_obj: number): void { // debug statements here } // const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function DataLossProtect_get_your_last_per_commitment_secret(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16713,6 +18595,7 @@ export function DataLossProtect_get_your_last_per_commitment_secret(this_ptr: nu return nativeResponseValue; } // void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function DataLossProtect_set_your_last_per_commitment_secret(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16721,6 +18604,7 @@ export function DataLossProtect_set_your_last_per_commitment_secret(this_ptr: nu // debug statements here } // struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr); +/* @internal */ export function DataLossProtect_get_my_current_per_commitment_point(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16729,6 +18613,7 @@ export function DataLossProtect_get_my_current_per_commitment_point(this_ptr: nu return nativeResponseValue; } // void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function DataLossProtect_set_my_current_per_commitment_point(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16737,6 +18622,7 @@ export function DataLossProtect_set_my_current_per_commitment_point(this_ptr: nu // debug statements here } // MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg); +/* @internal */ export function DataLossProtect_new(your_last_per_commitment_secret_arg: number, my_current_per_commitment_point_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16745,6 +18631,7 @@ export function DataLossProtect_new(your_last_per_commitment_secret_arg: number, return nativeResponseValue; } // uintptr_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg); +/* @internal */ export function DataLossProtect_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16753,6 +18640,7 @@ export function DataLossProtect_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig); +/* @internal */ export function DataLossProtect_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16761,6 +18649,7 @@ export function DataLossProtect_clone(orig: number): number { return nativeResponseValue; } // void ChannelReestablish_free(struct LDKChannelReestablish this_obj); +/* @internal */ export function ChannelReestablish_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16769,6 +18658,7 @@ export function ChannelReestablish_free(this_obj: number): void { // debug statements here } // const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function ChannelReestablish_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16777,6 +18667,7 @@ export function ChannelReestablish_get_channel_id(this_ptr: number): number { return nativeResponseValue; } // void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function ChannelReestablish_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16785,6 +18676,7 @@ export function ChannelReestablish_set_channel_id(this_ptr: number, val: number) // debug statements here } // uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelReestablish_get_next_local_commitment_number(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16793,6 +18685,7 @@ export function ChannelReestablish_get_next_local_commitment_number(this_ptr: nu return nativeResponseValue; } // void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelReestablish_set_next_local_commitment_number(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16801,6 +18694,7 @@ export function ChannelReestablish_set_next_local_commitment_number(this_ptr: nu // debug statements here } // uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelReestablish_get_next_remote_commitment_number(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16809,6 +18703,7 @@ export function ChannelReestablish_get_next_remote_commitment_number(this_ptr: n return nativeResponseValue; } // void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ChannelReestablish_set_next_remote_commitment_number(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16817,6 +18712,7 @@ export function ChannelReestablish_set_next_remote_commitment_number(this_ptr: n // debug statements here } // uintptr_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg); +/* @internal */ export function ChannelReestablish_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16825,6 +18721,7 @@ export function ChannelReestablish_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig); +/* @internal */ export function ChannelReestablish_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16833,6 +18730,7 @@ export function ChannelReestablish_clone(orig: number): number { return nativeResponseValue; } // void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj); +/* @internal */ export function AnnouncementSignatures_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16841,6 +18739,7 @@ export function AnnouncementSignatures_free(this_obj: number): void { // debug statements here } // const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function AnnouncementSignatures_get_channel_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16849,6 +18748,7 @@ export function AnnouncementSignatures_get_channel_id(this_ptr: number): number return nativeResponseValue; } // void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function AnnouncementSignatures_set_channel_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16857,6 +18757,7 @@ export function AnnouncementSignatures_set_channel_id(this_ptr: number, val: num // debug statements here } // uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); +/* @internal */ export function AnnouncementSignatures_get_short_channel_id(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16865,6 +18766,7 @@ export function AnnouncementSignatures_get_short_channel_id(this_ptr: number): b return nativeResponseValue; } // void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function AnnouncementSignatures_set_short_channel_id(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16873,6 +18775,7 @@ export function AnnouncementSignatures_set_short_channel_id(this_ptr: number, va // debug statements here } // struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); +/* @internal */ export function AnnouncementSignatures_get_node_signature(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16881,6 +18784,7 @@ export function AnnouncementSignatures_get_node_signature(this_ptr: number): num return nativeResponseValue; } // void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function AnnouncementSignatures_set_node_signature(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16889,6 +18793,7 @@ export function AnnouncementSignatures_set_node_signature(this_ptr: number, val: // debug statements here } // struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); +/* @internal */ export function AnnouncementSignatures_get_bitcoin_signature(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16897,6 +18802,7 @@ export function AnnouncementSignatures_get_bitcoin_signature(this_ptr: number): return nativeResponseValue; } // void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function AnnouncementSignatures_set_bitcoin_signature(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16905,6 +18811,7 @@ export function AnnouncementSignatures_set_bitcoin_signature(this_ptr: number, v // debug statements here } // MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKSignature node_signature_arg, struct LDKSignature bitcoin_signature_arg); +/* @internal */ export function AnnouncementSignatures_new(channel_id_arg: number, short_channel_id_arg: bigint, node_signature_arg: number, bitcoin_signature_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16913,6 +18820,7 @@ export function AnnouncementSignatures_new(channel_id_arg: number, short_channel return nativeResponseValue; } // uintptr_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg); +/* @internal */ export function AnnouncementSignatures_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16921,6 +18829,7 @@ export function AnnouncementSignatures_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig); +/* @internal */ export function AnnouncementSignatures_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16929,6 +18838,7 @@ export function AnnouncementSignatures_clone(orig: number): number { return nativeResponseValue; } // void NetAddress_free(struct LDKNetAddress this_ptr); +/* @internal */ export function NetAddress_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16937,6 +18847,7 @@ export function NetAddress_free(this_ptr: number): void { // debug statements here } // uintptr_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg); +/* @internal */ export function NetAddress_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16945,6 +18856,7 @@ export function NetAddress_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig); +/* @internal */ export function NetAddress_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16953,6 +18865,7 @@ export function NetAddress_clone(orig: number): number { return nativeResponseValue; } // struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port); +/* @internal */ export function NetAddress_ipv4(addr: number, port: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16961,6 +18874,7 @@ export function NetAddress_ipv4(addr: number, port: number): number { return nativeResponseValue; } // struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port); +/* @internal */ export function NetAddress_ipv6(addr: number, port: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16969,6 +18883,7 @@ export function NetAddress_ipv6(addr: number, port: number): number { return nativeResponseValue; } // struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a); +/* @internal */ export function NetAddress_onion_v2(a: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16977,6 +18892,7 @@ export function NetAddress_onion_v2(a: number): number { return nativeResponseValue; } // struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port); +/* @internal */ export function NetAddress_onion_v3(ed25519_pubkey: number, checksum: number, version: number, port: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16985,6 +18901,7 @@ export function NetAddress_onion_v3(ed25519_pubkey: number, checksum: number, ve return nativeResponseValue; } // struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj); +/* @internal */ export function NetAddress_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -16993,6 +18910,7 @@ export function NetAddress_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser); +/* @internal */ export function NetAddress_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17001,6 +18919,7 @@ export function NetAddress_read(ser: number): number { return nativeResponseValue; } // void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj); +/* @internal */ export function UnsignedNodeAnnouncement_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17009,6 +18928,7 @@ export function UnsignedNodeAnnouncement_free(this_obj: number): void { // debug statements here } // struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedNodeAnnouncement_get_features(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17017,6 +18937,7 @@ export function UnsignedNodeAnnouncement_get_features(this_ptr: number): number return nativeResponseValue; } // void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); +/* @internal */ export function UnsignedNodeAnnouncement_set_features(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17025,6 +18946,7 @@ export function UnsignedNodeAnnouncement_set_features(this_ptr: number, val: num // debug statements here } // uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedNodeAnnouncement_get_timestamp(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17033,6 +18955,7 @@ export function UnsignedNodeAnnouncement_get_timestamp(this_ptr: number): number return nativeResponseValue; } // void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function UnsignedNodeAnnouncement_set_timestamp(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17041,6 +18964,7 @@ export function UnsignedNodeAnnouncement_set_timestamp(this_ptr: number, val: nu // debug statements here } // struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedNodeAnnouncement_get_node_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17049,6 +18973,7 @@ export function UnsignedNodeAnnouncement_get_node_id(this_ptr: number): number { return nativeResponseValue; } // void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function UnsignedNodeAnnouncement_set_node_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17057,6 +18982,7 @@ export function UnsignedNodeAnnouncement_set_node_id(this_ptr: number, val: numb // debug statements here } // const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3]; +/* @internal */ export function UnsignedNodeAnnouncement_get_rgb(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17065,6 +18991,7 @@ export function UnsignedNodeAnnouncement_get_rgb(this_ptr: number): number { return nativeResponseValue; } // void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val); +/* @internal */ export function UnsignedNodeAnnouncement_set_rgb(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17073,6 +19000,7 @@ export function UnsignedNodeAnnouncement_set_rgb(this_ptr: number, val: number): // debug statements here } // const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function UnsignedNodeAnnouncement_get_alias(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17081,6 +19009,7 @@ export function UnsignedNodeAnnouncement_get_alias(this_ptr: number): number { return nativeResponseValue; } // void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function UnsignedNodeAnnouncement_set_alias(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17089,6 +19018,7 @@ export function UnsignedNodeAnnouncement_set_alias(this_ptr: number, val: number // debug statements here } // void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val); +/* @internal */ export function UnsignedNodeAnnouncement_set_addresses(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17097,6 +19027,7 @@ export function UnsignedNodeAnnouncement_set_addresses(this_ptr: number, val: nu // debug statements here } // uintptr_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg); +/* @internal */ export function UnsignedNodeAnnouncement_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17105,6 +19036,7 @@ export function UnsignedNodeAnnouncement_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig); +/* @internal */ export function UnsignedNodeAnnouncement_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17113,6 +19045,7 @@ export function UnsignedNodeAnnouncement_clone(orig: number): number { return nativeResponseValue; } // void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj); +/* @internal */ export function NodeAnnouncement_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17121,6 +19054,7 @@ export function NodeAnnouncement_free(this_obj: number): void { // debug statements here } // struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function NodeAnnouncement_get_signature(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17129,6 +19063,7 @@ export function NodeAnnouncement_get_signature(this_ptr: number): number { return nativeResponseValue; } // void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function NodeAnnouncement_set_signature(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17137,6 +19072,7 @@ export function NodeAnnouncement_set_signature(this_ptr: number, val: number): v // debug statements here } // struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function NodeAnnouncement_get_contents(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17145,6 +19081,7 @@ export function NodeAnnouncement_get_contents(this_ptr: number): number { return nativeResponseValue; } // void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val); +/* @internal */ export function NodeAnnouncement_set_contents(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17153,6 +19090,7 @@ export function NodeAnnouncement_set_contents(this_ptr: number, val: number): vo // debug statements here } // MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg); +/* @internal */ export function NodeAnnouncement_new(signature_arg: number, contents_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17161,6 +19099,7 @@ export function NodeAnnouncement_new(signature_arg: number, contents_arg: number return nativeResponseValue; } // uintptr_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg); +/* @internal */ export function NodeAnnouncement_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17169,6 +19108,7 @@ export function NodeAnnouncement_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig); +/* @internal */ export function NodeAnnouncement_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17177,6 +19117,7 @@ export function NodeAnnouncement_clone(orig: number): number { return nativeResponseValue; } // void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj); +/* @internal */ export function UnsignedChannelAnnouncement_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17185,6 +19126,7 @@ export function UnsignedChannelAnnouncement_free(this_obj: number): void { // debug statements here } // struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelAnnouncement_get_features(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17193,6 +19135,7 @@ export function UnsignedChannelAnnouncement_get_features(this_ptr: number): numb return nativeResponseValue; } // void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); +/* @internal */ export function UnsignedChannelAnnouncement_set_features(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17201,6 +19144,7 @@ export function UnsignedChannelAnnouncement_set_features(this_ptr: number, val: // debug statements here } // const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function UnsignedChannelAnnouncement_get_chain_hash(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17209,6 +19153,7 @@ export function UnsignedChannelAnnouncement_get_chain_hash(this_ptr: number): nu return nativeResponseValue; } // void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function UnsignedChannelAnnouncement_set_chain_hash(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17217,6 +19162,7 @@ export function UnsignedChannelAnnouncement_set_chain_hash(this_ptr: number, val // debug statements here } // uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelAnnouncement_get_short_channel_id(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17225,6 +19171,7 @@ export function UnsignedChannelAnnouncement_get_short_channel_id(this_ptr: numbe return nativeResponseValue; } // void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function UnsignedChannelAnnouncement_set_short_channel_id(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17233,6 +19180,7 @@ export function UnsignedChannelAnnouncement_set_short_channel_id(this_ptr: numbe // debug statements here } // struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelAnnouncement_get_node_id_1(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17241,6 +19189,7 @@ export function UnsignedChannelAnnouncement_get_node_id_1(this_ptr: number): num return nativeResponseValue; } // void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function UnsignedChannelAnnouncement_set_node_id_1(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17249,6 +19198,7 @@ export function UnsignedChannelAnnouncement_set_node_id_1(this_ptr: number, val: // debug statements here } // struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelAnnouncement_get_node_id_2(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17257,6 +19207,7 @@ export function UnsignedChannelAnnouncement_get_node_id_2(this_ptr: number): num return nativeResponseValue; } // void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function UnsignedChannelAnnouncement_set_node_id_2(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17265,6 +19216,7 @@ export function UnsignedChannelAnnouncement_set_node_id_2(this_ptr: number, val: // debug statements here } // struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17273,6 +19225,7 @@ export function UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr: number): return nativeResponseValue; } // void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17281,6 +19234,7 @@ export function UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr: number, // debug statements here } // struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17289,6 +19243,7 @@ export function UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr: number): return nativeResponseValue; } // void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17297,6 +19252,7 @@ export function UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr: number, // debug statements here } // uintptr_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg); +/* @internal */ export function UnsignedChannelAnnouncement_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17305,6 +19261,7 @@ export function UnsignedChannelAnnouncement_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig); +/* @internal */ export function UnsignedChannelAnnouncement_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17313,6 +19270,7 @@ export function UnsignedChannelAnnouncement_clone(orig: number): number { return nativeResponseValue; } // void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj); +/* @internal */ export function ChannelAnnouncement_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17321,6 +19279,7 @@ export function ChannelAnnouncement_free(this_obj: number): void { // debug statements here } // struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelAnnouncement_get_node_signature_1(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17329,6 +19288,7 @@ export function ChannelAnnouncement_get_node_signature_1(this_ptr: number): numb return nativeResponseValue; } // void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function ChannelAnnouncement_set_node_signature_1(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17337,6 +19297,7 @@ export function ChannelAnnouncement_set_node_signature_1(this_ptr: number, val: // debug statements here } // struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelAnnouncement_get_node_signature_2(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17345,6 +19306,7 @@ export function ChannelAnnouncement_get_node_signature_2(this_ptr: number): numb return nativeResponseValue; } // void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function ChannelAnnouncement_set_node_signature_2(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17353,6 +19315,7 @@ export function ChannelAnnouncement_set_node_signature_2(this_ptr: number, val: // debug statements here } // struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelAnnouncement_get_bitcoin_signature_1(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17361,6 +19324,7 @@ export function ChannelAnnouncement_get_bitcoin_signature_1(this_ptr: number): n return nativeResponseValue; } // void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function ChannelAnnouncement_set_bitcoin_signature_1(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17369,6 +19333,7 @@ export function ChannelAnnouncement_set_bitcoin_signature_1(this_ptr: number, va // debug statements here } // struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelAnnouncement_get_bitcoin_signature_2(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17377,6 +19342,7 @@ export function ChannelAnnouncement_get_bitcoin_signature_2(this_ptr: number): n return nativeResponseValue; } // void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function ChannelAnnouncement_set_bitcoin_signature_2(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17385,6 +19351,7 @@ export function ChannelAnnouncement_set_bitcoin_signature_2(this_ptr: number, va // debug statements here } // struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelAnnouncement_get_contents(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17393,6 +19360,7 @@ export function ChannelAnnouncement_get_contents(this_ptr: number): number { return nativeResponseValue; } // void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val); +/* @internal */ export function ChannelAnnouncement_set_contents(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17401,6 +19369,7 @@ export function ChannelAnnouncement_set_contents(this_ptr: number, val: number): // debug statements here } // MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKSignature node_signature_1_arg, struct LDKSignature node_signature_2_arg, struct LDKSignature bitcoin_signature_1_arg, struct LDKSignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg); +/* @internal */ export function ChannelAnnouncement_new(node_signature_1_arg: number, node_signature_2_arg: number, bitcoin_signature_1_arg: number, bitcoin_signature_2_arg: number, contents_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17409,6 +19378,7 @@ export function ChannelAnnouncement_new(node_signature_1_arg: number, node_signa return nativeResponseValue; } // uintptr_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg); +/* @internal */ export function ChannelAnnouncement_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17417,6 +19387,7 @@ export function ChannelAnnouncement_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig); +/* @internal */ export function ChannelAnnouncement_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17425,6 +19396,7 @@ export function ChannelAnnouncement_clone(orig: number): number { return nativeResponseValue; } // void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj); +/* @internal */ export function UnsignedChannelUpdate_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17433,6 +19405,7 @@ export function UnsignedChannelUpdate_free(this_obj: number): void { // debug statements here } // const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function UnsignedChannelUpdate_get_chain_hash(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17441,6 +19414,7 @@ export function UnsignedChannelUpdate_get_chain_hash(this_ptr: number): number { return nativeResponseValue; } // void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function UnsignedChannelUpdate_set_chain_hash(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17449,6 +19423,7 @@ export function UnsignedChannelUpdate_set_chain_hash(this_ptr: number, val: numb // debug statements here } // uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelUpdate_get_short_channel_id(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17457,6 +19432,7 @@ export function UnsignedChannelUpdate_get_short_channel_id(this_ptr: number): bi return nativeResponseValue; } // void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function UnsignedChannelUpdate_set_short_channel_id(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17465,6 +19441,7 @@ export function UnsignedChannelUpdate_set_short_channel_id(this_ptr: number, val // debug statements here } // uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelUpdate_get_timestamp(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17473,6 +19450,7 @@ export function UnsignedChannelUpdate_get_timestamp(this_ptr: number): number { return nativeResponseValue; } // void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function UnsignedChannelUpdate_set_timestamp(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17481,6 +19459,7 @@ export function UnsignedChannelUpdate_set_timestamp(this_ptr: number, val: numbe // debug statements here } // uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelUpdate_get_flags(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17489,6 +19468,7 @@ export function UnsignedChannelUpdate_get_flags(this_ptr: number): number { return nativeResponseValue; } // void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val); +/* @internal */ export function UnsignedChannelUpdate_set_flags(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17497,6 +19477,7 @@ export function UnsignedChannelUpdate_set_flags(this_ptr: number, val: number): // debug statements here } // uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17505,6 +19486,7 @@ export function UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr: number): n return nativeResponseValue; } // void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17513,6 +19495,7 @@ export function UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr: number, va // debug statements here } // uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17521,6 +19504,7 @@ export function UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr: number): b return nativeResponseValue; } // void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17529,6 +19513,7 @@ export function UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr: number, va // debug statements here } // uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelUpdate_get_fee_base_msat(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17537,6 +19522,7 @@ export function UnsignedChannelUpdate_get_fee_base_msat(this_ptr: number): numbe return nativeResponseValue; } // void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function UnsignedChannelUpdate_set_fee_base_msat(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17545,6 +19531,7 @@ export function UnsignedChannelUpdate_set_fee_base_msat(this_ptr: number, val: n // debug statements here } // uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17553,6 +19540,7 @@ export function UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr: return nativeResponseValue; } // void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17561,6 +19549,7 @@ export function UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr: // debug statements here } // uintptr_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg); +/* @internal */ export function UnsignedChannelUpdate_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17569,6 +19558,7 @@ export function UnsignedChannelUpdate_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); +/* @internal */ export function UnsignedChannelUpdate_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17577,6 +19567,7 @@ export function UnsignedChannelUpdate_clone(orig: number): number { return nativeResponseValue; } // void ChannelUpdate_free(struct LDKChannelUpdate this_obj); +/* @internal */ export function ChannelUpdate_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17585,6 +19576,7 @@ export function ChannelUpdate_free(this_obj: number): void { // debug statements here } // struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelUpdate_get_signature(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17593,6 +19585,7 @@ export function ChannelUpdate_get_signature(this_ptr: number): number { return nativeResponseValue; } // void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function ChannelUpdate_set_signature(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17601,6 +19594,7 @@ export function ChannelUpdate_set_signature(this_ptr: number, val: number): void // debug statements here } // struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelUpdate_get_contents(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17609,6 +19603,7 @@ export function ChannelUpdate_get_contents(this_ptr: number): number { return nativeResponseValue; } // void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val); +/* @internal */ export function ChannelUpdate_set_contents(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17617,6 +19612,7 @@ export function ChannelUpdate_set_contents(this_ptr: number, val: number): void // debug statements here } // MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg); +/* @internal */ export function ChannelUpdate_new(signature_arg: number, contents_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17625,6 +19621,7 @@ export function ChannelUpdate_new(signature_arg: number, contents_arg: number): return nativeResponseValue; } // uintptr_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg); +/* @internal */ export function ChannelUpdate_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17633,6 +19630,7 @@ export function ChannelUpdate_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig); +/* @internal */ export function ChannelUpdate_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17641,6 +19639,7 @@ export function ChannelUpdate_clone(orig: number): number { return nativeResponseValue; } // void QueryChannelRange_free(struct LDKQueryChannelRange this_obj); +/* @internal */ export function QueryChannelRange_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17649,6 +19648,7 @@ export function QueryChannelRange_free(this_obj: number): void { // debug statements here } // const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function QueryChannelRange_get_chain_hash(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17657,6 +19657,7 @@ export function QueryChannelRange_get_chain_hash(this_ptr: number): number { return nativeResponseValue; } // void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function QueryChannelRange_set_chain_hash(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17665,6 +19666,7 @@ export function QueryChannelRange_set_chain_hash(this_ptr: number, val: number): // debug statements here } // uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr); +/* @internal */ export function QueryChannelRange_get_first_blocknum(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17673,6 +19675,7 @@ export function QueryChannelRange_get_first_blocknum(this_ptr: number): number { return nativeResponseValue; } // void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function QueryChannelRange_set_first_blocknum(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17681,6 +19684,7 @@ export function QueryChannelRange_set_first_blocknum(this_ptr: number, val: numb // debug statements here } // uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr); +/* @internal */ export function QueryChannelRange_get_number_of_blocks(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17689,6 +19693,7 @@ export function QueryChannelRange_get_number_of_blocks(this_ptr: number): number return nativeResponseValue; } // void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function QueryChannelRange_set_number_of_blocks(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17697,6 +19702,7 @@ export function QueryChannelRange_set_number_of_blocks(this_ptr: number, val: nu // debug statements here } // MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg); +/* @internal */ export function QueryChannelRange_new(chain_hash_arg: number, first_blocknum_arg: number, number_of_blocks_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17705,6 +19711,7 @@ export function QueryChannelRange_new(chain_hash_arg: number, first_blocknum_arg return nativeResponseValue; } // uintptr_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg); +/* @internal */ export function QueryChannelRange_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17713,6 +19720,7 @@ export function QueryChannelRange_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig); +/* @internal */ export function QueryChannelRange_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17721,6 +19729,7 @@ export function QueryChannelRange_clone(orig: number): number { return nativeResponseValue; } // void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj); +/* @internal */ export function ReplyChannelRange_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17729,6 +19738,7 @@ export function ReplyChannelRange_free(this_obj: number): void { // debug statements here } // const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function ReplyChannelRange_get_chain_hash(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17737,6 +19747,7 @@ export function ReplyChannelRange_get_chain_hash(this_ptr: number): number { return nativeResponseValue; } // void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function ReplyChannelRange_set_chain_hash(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17745,6 +19756,7 @@ export function ReplyChannelRange_set_chain_hash(this_ptr: number, val: number): // debug statements here } // uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr); +/* @internal */ export function ReplyChannelRange_get_first_blocknum(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17753,6 +19765,7 @@ export function ReplyChannelRange_get_first_blocknum(this_ptr: number): number { return nativeResponseValue; } // void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function ReplyChannelRange_set_first_blocknum(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17761,6 +19774,7 @@ export function ReplyChannelRange_set_first_blocknum(this_ptr: number, val: numb // debug statements here } // uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr); +/* @internal */ export function ReplyChannelRange_get_number_of_blocks(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17769,6 +19783,7 @@ export function ReplyChannelRange_get_number_of_blocks(this_ptr: number): number return nativeResponseValue; } // void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function ReplyChannelRange_set_number_of_blocks(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17777,6 +19792,7 @@ export function ReplyChannelRange_set_number_of_blocks(this_ptr: number, val: nu // debug statements here } // bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr); +/* @internal */ export function ReplyChannelRange_get_sync_complete(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17785,6 +19801,7 @@ export function ReplyChannelRange_get_sync_complete(this_ptr: number): boolean { return nativeResponseValue; } // void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function ReplyChannelRange_set_sync_complete(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17793,6 +19810,7 @@ export function ReplyChannelRange_set_sync_complete(this_ptr: number, val: boole // debug statements here } // void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); +/* @internal */ export function ReplyChannelRange_set_short_channel_ids(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17801,6 +19819,7 @@ export function ReplyChannelRange_set_short_channel_ids(this_ptr: number, val: n // debug statements here } // MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool sync_complete_arg, struct LDKCVec_u64Z short_channel_ids_arg); +/* @internal */ export function ReplyChannelRange_new(chain_hash_arg: number, first_blocknum_arg: number, number_of_blocks_arg: number, sync_complete_arg: boolean, short_channel_ids_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17809,6 +19828,7 @@ export function ReplyChannelRange_new(chain_hash_arg: number, first_blocknum_arg return nativeResponseValue; } // uintptr_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg); +/* @internal */ export function ReplyChannelRange_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17817,6 +19837,7 @@ export function ReplyChannelRange_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig); +/* @internal */ export function ReplyChannelRange_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17825,6 +19846,7 @@ export function ReplyChannelRange_clone(orig: number): number { return nativeResponseValue; } // void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj); +/* @internal */ export function QueryShortChannelIds_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17833,6 +19855,7 @@ export function QueryShortChannelIds_free(this_obj: number): void { // debug statements here } // const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function QueryShortChannelIds_get_chain_hash(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17841,6 +19864,7 @@ export function QueryShortChannelIds_get_chain_hash(this_ptr: number): number { return nativeResponseValue; } // void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function QueryShortChannelIds_set_chain_hash(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17849,6 +19873,7 @@ export function QueryShortChannelIds_set_chain_hash(this_ptr: number, val: numbe // debug statements here } // void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); +/* @internal */ export function QueryShortChannelIds_set_short_channel_ids(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17857,6 +19882,7 @@ export function QueryShortChannelIds_set_short_channel_ids(this_ptr: number, val // debug statements here } // MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg); +/* @internal */ export function QueryShortChannelIds_new(chain_hash_arg: number, short_channel_ids_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17865,6 +19891,7 @@ export function QueryShortChannelIds_new(chain_hash_arg: number, short_channel_i return nativeResponseValue; } // uintptr_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg); +/* @internal */ export function QueryShortChannelIds_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17873,6 +19900,7 @@ export function QueryShortChannelIds_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig); +/* @internal */ export function QueryShortChannelIds_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17881,6 +19909,7 @@ export function QueryShortChannelIds_clone(orig: number): number { return nativeResponseValue; } // void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj); +/* @internal */ export function ReplyShortChannelIdsEnd_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17889,6 +19918,7 @@ export function ReplyShortChannelIdsEnd_free(this_obj: number): void { // debug statements here } // const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function ReplyShortChannelIdsEnd_get_chain_hash(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17897,6 +19927,7 @@ export function ReplyShortChannelIdsEnd_get_chain_hash(this_ptr: number): number return nativeResponseValue; } // void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function ReplyShortChannelIdsEnd_set_chain_hash(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17905,6 +19936,7 @@ export function ReplyShortChannelIdsEnd_set_chain_hash(this_ptr: number, val: nu // debug statements here } // bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr); +/* @internal */ export function ReplyShortChannelIdsEnd_get_full_information(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17913,6 +19945,7 @@ export function ReplyShortChannelIdsEnd_get_full_information(this_ptr: number): return nativeResponseValue; } // void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function ReplyShortChannelIdsEnd_set_full_information(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17921,6 +19954,7 @@ export function ReplyShortChannelIdsEnd_set_full_information(this_ptr: number, v // debug statements here } // MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg); +/* @internal */ export function ReplyShortChannelIdsEnd_new(chain_hash_arg: number, full_information_arg: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17929,6 +19963,7 @@ export function ReplyShortChannelIdsEnd_new(chain_hash_arg: number, full_informa return nativeResponseValue; } // uintptr_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg); +/* @internal */ export function ReplyShortChannelIdsEnd_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17937,6 +19972,7 @@ export function ReplyShortChannelIdsEnd_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig); +/* @internal */ export function ReplyShortChannelIdsEnd_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17945,6 +19981,7 @@ export function ReplyShortChannelIdsEnd_clone(orig: number): number { return nativeResponseValue; } // void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj); +/* @internal */ export function GossipTimestampFilter_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17953,6 +19990,7 @@ export function GossipTimestampFilter_free(this_obj: number): void { // debug statements here } // const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function GossipTimestampFilter_get_chain_hash(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17961,6 +19999,7 @@ export function GossipTimestampFilter_get_chain_hash(this_ptr: number): number { return nativeResponseValue; } // void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function GossipTimestampFilter_set_chain_hash(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17969,6 +20008,7 @@ export function GossipTimestampFilter_set_chain_hash(this_ptr: number, val: numb // debug statements here } // uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr); +/* @internal */ export function GossipTimestampFilter_get_first_timestamp(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17977,6 +20017,7 @@ export function GossipTimestampFilter_get_first_timestamp(this_ptr: number): num return nativeResponseValue; } // void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function GossipTimestampFilter_set_first_timestamp(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17985,6 +20026,7 @@ export function GossipTimestampFilter_set_first_timestamp(this_ptr: number, val: // debug statements here } // uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr); +/* @internal */ export function GossipTimestampFilter_get_timestamp_range(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -17993,6 +20035,7 @@ export function GossipTimestampFilter_get_timestamp_range(this_ptr: number): num return nativeResponseValue; } // void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function GossipTimestampFilter_set_timestamp_range(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18001,6 +20044,7 @@ export function GossipTimestampFilter_set_timestamp_range(this_ptr: number, val: // debug statements here } // MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg); +/* @internal */ export function GossipTimestampFilter_new(chain_hash_arg: number, first_timestamp_arg: number, timestamp_range_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18009,6 +20053,7 @@ export function GossipTimestampFilter_new(chain_hash_arg: number, first_timestam return nativeResponseValue; } // uintptr_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg); +/* @internal */ export function GossipTimestampFilter_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18017,6 +20062,7 @@ export function GossipTimestampFilter_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig); +/* @internal */ export function GossipTimestampFilter_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18025,6 +20071,7 @@ export function GossipTimestampFilter_clone(orig: number): number { return nativeResponseValue; } // void ErrorAction_free(struct LDKErrorAction this_ptr); +/* @internal */ export function ErrorAction_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18033,6 +20080,7 @@ export function ErrorAction_free(this_ptr: number): void { // debug statements here } // uintptr_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg); +/* @internal */ export function ErrorAction_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18041,6 +20089,7 @@ export function ErrorAction_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig); +/* @internal */ export function ErrorAction_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18049,6 +20098,7 @@ export function ErrorAction_clone(orig: number): number { return nativeResponseValue; } // struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg); +/* @internal */ export function ErrorAction_disconnect_peer(msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18057,6 +20107,7 @@ export function ErrorAction_disconnect_peer(msg: number): number { return nativeResponseValue; } // struct LDKErrorAction ErrorAction_ignore_error(void); +/* @internal */ export function ErrorAction_ignore_error(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18065,6 +20116,7 @@ export function ErrorAction_ignore_error(): number { return nativeResponseValue; } // struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a); +/* @internal */ export function ErrorAction_ignore_and_log(a: Level): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18073,6 +20125,7 @@ export function ErrorAction_ignore_and_log(a: Level): number { return nativeResponseValue; } // struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void); +/* @internal */ export function ErrorAction_ignore_duplicate_gossip(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18081,6 +20134,7 @@ export function ErrorAction_ignore_duplicate_gossip(): number { return nativeResponseValue; } // struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg); +/* @internal */ export function ErrorAction_send_error_message(msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18089,6 +20143,7 @@ export function ErrorAction_send_error_message(msg: number): number { return nativeResponseValue; } // void LightningError_free(struct LDKLightningError this_obj); +/* @internal */ export function LightningError_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18097,6 +20152,7 @@ export function LightningError_free(this_obj: number): void { // debug statements here } // struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr); +/* @internal */ export function LightningError_get_err(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18105,6 +20161,7 @@ export function LightningError_get_err(this_ptr: number): number { return nativeResponseValue; } // void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val); +/* @internal */ export function LightningError_set_err(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18113,6 +20170,7 @@ export function LightningError_set_err(this_ptr: number, val: number): void { // debug statements here } // struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr); +/* @internal */ export function LightningError_get_action(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18121,6 +20179,7 @@ export function LightningError_get_action(this_ptr: number): number { return nativeResponseValue; } // void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val); +/* @internal */ export function LightningError_set_action(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18129,6 +20188,7 @@ export function LightningError_set_action(this_ptr: number, val: number): void { // debug statements here } // MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg); +/* @internal */ export function LightningError_new(err_arg: number, action_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18137,6 +20197,7 @@ export function LightningError_new(err_arg: number, action_arg: number): number return nativeResponseValue; } // uintptr_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg); +/* @internal */ export function LightningError_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18145,6 +20206,7 @@ export function LightningError_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig); +/* @internal */ export function LightningError_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18153,6 +20215,7 @@ export function LightningError_clone(orig: number): number { return nativeResponseValue; } // void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj); +/* @internal */ export function CommitmentUpdate_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18161,6 +20224,7 @@ export function CommitmentUpdate_free(this_obj: number): void { // debug statements here } // struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function CommitmentUpdate_get_update_add_htlcs(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18169,6 +20233,7 @@ export function CommitmentUpdate_get_update_add_htlcs(this_ptr: number): number return nativeResponseValue; } // void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val); +/* @internal */ export function CommitmentUpdate_set_update_add_htlcs(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18177,6 +20242,7 @@ export function CommitmentUpdate_set_update_add_htlcs(this_ptr: number, val: num // debug statements here } // struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function CommitmentUpdate_get_update_fulfill_htlcs(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18185,6 +20251,7 @@ export function CommitmentUpdate_get_update_fulfill_htlcs(this_ptr: number): num return nativeResponseValue; } // void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val); +/* @internal */ export function CommitmentUpdate_set_update_fulfill_htlcs(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18193,6 +20260,7 @@ export function CommitmentUpdate_set_update_fulfill_htlcs(this_ptr: number, val: // debug statements here } // struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function CommitmentUpdate_get_update_fail_htlcs(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18201,6 +20269,7 @@ export function CommitmentUpdate_get_update_fail_htlcs(this_ptr: number): number return nativeResponseValue; } // void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val); +/* @internal */ export function CommitmentUpdate_set_update_fail_htlcs(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18209,6 +20278,7 @@ export function CommitmentUpdate_set_update_fail_htlcs(this_ptr: number, val: nu // debug statements here } // struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function CommitmentUpdate_get_update_fail_malformed_htlcs(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18217,6 +20287,7 @@ export function CommitmentUpdate_get_update_fail_malformed_htlcs(this_ptr: numbe return nativeResponseValue; } // void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val); +/* @internal */ export function CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18225,6 +20296,7 @@ export function CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr: numbe // debug statements here } // struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function CommitmentUpdate_get_update_fee(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18233,6 +20305,7 @@ export function CommitmentUpdate_get_update_fee(this_ptr: number): number { return nativeResponseValue; } // void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val); +/* @internal */ export function CommitmentUpdate_set_update_fee(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18241,6 +20314,7 @@ export function CommitmentUpdate_set_update_fee(this_ptr: number, val: number): // debug statements here } // struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); +/* @internal */ export function CommitmentUpdate_get_commitment_signed(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18249,6 +20323,7 @@ export function CommitmentUpdate_get_commitment_signed(this_ptr: number): number return nativeResponseValue; } // void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val); +/* @internal */ export function CommitmentUpdate_set_commitment_signed(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18257,6 +20332,7 @@ export function CommitmentUpdate_set_commitment_signed(this_ptr: number, val: nu // debug statements here } // MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, struct LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, struct LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, struct LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg); +/* @internal */ export function CommitmentUpdate_new(update_add_htlcs_arg: number, update_fulfill_htlcs_arg: number, update_fail_htlcs_arg: number, update_fail_malformed_htlcs_arg: number, update_fee_arg: number, commitment_signed_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18265,6 +20341,7 @@ export function CommitmentUpdate_new(update_add_htlcs_arg: number, update_fulfil return nativeResponseValue; } // uintptr_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg); +/* @internal */ export function CommitmentUpdate_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18273,6 +20350,7 @@ export function CommitmentUpdate_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig); +/* @internal */ export function CommitmentUpdate_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18281,6 +20359,7 @@ export function CommitmentUpdate_clone(orig: number): number { return nativeResponseValue; } // void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr); +/* @internal */ export function ChannelMessageHandler_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18289,6 +20368,7 @@ export function ChannelMessageHandler_free(this_ptr: number): void { // debug statements here } // void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr); +/* @internal */ export function RoutingMessageHandler_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18297,6 +20377,7 @@ export function RoutingMessageHandler_free(this_ptr: number): void { // debug statements here } // struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj); +/* @internal */ export function AcceptChannel_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18305,6 +20386,7 @@ export function AcceptChannel_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser); +/* @internal */ export function AcceptChannel_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18313,6 +20395,7 @@ export function AcceptChannel_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj); +/* @internal */ export function AnnouncementSignatures_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18321,6 +20404,7 @@ export function AnnouncementSignatures_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser); +/* @internal */ export function AnnouncementSignatures_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18329,6 +20413,7 @@ export function AnnouncementSignatures_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj); +/* @internal */ export function ChannelReestablish_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18337,6 +20422,7 @@ export function ChannelReestablish_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser); +/* @internal */ export function ChannelReestablish_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18345,6 +20431,7 @@ export function ChannelReestablish_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj); +/* @internal */ export function ClosingSigned_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18353,6 +20440,7 @@ export function ClosingSigned_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser); +/* @internal */ export function ClosingSigned_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18361,6 +20449,7 @@ export function ClosingSigned_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj); +/* @internal */ export function ClosingSignedFeeRange_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18369,6 +20458,7 @@ export function ClosingSignedFeeRange_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser); +/* @internal */ export function ClosingSignedFeeRange_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18377,6 +20467,7 @@ export function ClosingSignedFeeRange_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj); +/* @internal */ export function CommitmentSigned_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18385,6 +20476,7 @@ export function CommitmentSigned_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser); +/* @internal */ export function CommitmentSigned_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18393,6 +20485,7 @@ export function CommitmentSigned_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj); +/* @internal */ export function FundingCreated_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18401,6 +20494,7 @@ export function FundingCreated_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser); +/* @internal */ export function FundingCreated_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18409,6 +20503,7 @@ export function FundingCreated_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj); +/* @internal */ export function FundingSigned_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18417,6 +20512,7 @@ export function FundingSigned_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser); +/* @internal */ export function FundingSigned_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18425,6 +20521,7 @@ export function FundingSigned_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj); +/* @internal */ export function FundingLocked_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18433,6 +20530,7 @@ export function FundingLocked_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_FundingLockedDecodeErrorZ FundingLocked_read(struct LDKu8slice ser); +/* @internal */ export function FundingLocked_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18441,6 +20539,7 @@ export function FundingLocked_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj); +/* @internal */ export function Init_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18449,6 +20548,7 @@ export function Init_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser); +/* @internal */ export function Init_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18457,6 +20557,7 @@ export function Init_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj); +/* @internal */ export function OpenChannel_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18465,6 +20566,7 @@ export function OpenChannel_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser); +/* @internal */ export function OpenChannel_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18473,6 +20575,7 @@ export function OpenChannel_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj); +/* @internal */ export function RevokeAndACK_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18481,6 +20584,7 @@ export function RevokeAndACK_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser); +/* @internal */ export function RevokeAndACK_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18489,6 +20593,7 @@ export function RevokeAndACK_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj); +/* @internal */ export function Shutdown_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18497,6 +20602,7 @@ export function Shutdown_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser); +/* @internal */ export function Shutdown_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18505,6 +20611,7 @@ export function Shutdown_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj); +/* @internal */ export function UpdateFailHTLC_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18513,6 +20620,7 @@ export function UpdateFailHTLC_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser); +/* @internal */ export function UpdateFailHTLC_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18521,6 +20629,7 @@ export function UpdateFailHTLC_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj); +/* @internal */ export function UpdateFailMalformedHTLC_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18529,6 +20638,7 @@ export function UpdateFailMalformedHTLC_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser); +/* @internal */ export function UpdateFailMalformedHTLC_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18537,6 +20647,7 @@ export function UpdateFailMalformedHTLC_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj); +/* @internal */ export function UpdateFee_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18545,6 +20656,7 @@ export function UpdateFee_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser); +/* @internal */ export function UpdateFee_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18553,6 +20665,7 @@ export function UpdateFee_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj); +/* @internal */ export function UpdateFulfillHTLC_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18561,6 +20674,7 @@ export function UpdateFulfillHTLC_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser); +/* @internal */ export function UpdateFulfillHTLC_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18569,6 +20683,7 @@ export function UpdateFulfillHTLC_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj); +/* @internal */ export function UpdateAddHTLC_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18577,6 +20692,7 @@ export function UpdateAddHTLC_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser); +/* @internal */ export function UpdateAddHTLC_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18585,6 +20701,7 @@ export function UpdateAddHTLC_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj); +/* @internal */ export function Ping_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18593,6 +20710,7 @@ export function Ping_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser); +/* @internal */ export function Ping_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18601,6 +20719,7 @@ export function Ping_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj); +/* @internal */ export function Pong_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18609,6 +20728,7 @@ export function Pong_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser); +/* @internal */ export function Pong_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18617,6 +20737,7 @@ export function Pong_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj); +/* @internal */ export function UnsignedChannelAnnouncement_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18625,6 +20746,7 @@ export function UnsignedChannelAnnouncement_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser); +/* @internal */ export function UnsignedChannelAnnouncement_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18633,6 +20755,7 @@ export function UnsignedChannelAnnouncement_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj); +/* @internal */ export function ChannelAnnouncement_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18641,6 +20764,7 @@ export function ChannelAnnouncement_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser); +/* @internal */ export function ChannelAnnouncement_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18649,6 +20773,7 @@ export function ChannelAnnouncement_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj); +/* @internal */ export function UnsignedChannelUpdate_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18657,6 +20782,7 @@ export function UnsignedChannelUpdate_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser); +/* @internal */ export function UnsignedChannelUpdate_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18665,6 +20791,7 @@ export function UnsignedChannelUpdate_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj); +/* @internal */ export function ChannelUpdate_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18673,6 +20800,7 @@ export function ChannelUpdate_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser); +/* @internal */ export function ChannelUpdate_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18681,6 +20809,7 @@ export function ChannelUpdate_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj); +/* @internal */ export function ErrorMessage_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18689,6 +20818,7 @@ export function ErrorMessage_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser); +/* @internal */ export function ErrorMessage_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18697,6 +20827,7 @@ export function ErrorMessage_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj); +/* @internal */ export function UnsignedNodeAnnouncement_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18705,6 +20836,7 @@ export function UnsignedNodeAnnouncement_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser); +/* @internal */ export function UnsignedNodeAnnouncement_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18713,6 +20845,7 @@ export function UnsignedNodeAnnouncement_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj); +/* @internal */ export function NodeAnnouncement_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18721,6 +20854,7 @@ export function NodeAnnouncement_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser); +/* @internal */ export function NodeAnnouncement_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18729,6 +20863,7 @@ export function NodeAnnouncement_read(ser: number): number { return nativeResponseValue; } // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser); +/* @internal */ export function QueryShortChannelIds_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18737,6 +20872,7 @@ export function QueryShortChannelIds_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj); +/* @internal */ export function QueryShortChannelIds_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18745,6 +20881,7 @@ export function QueryShortChannelIds_write(obj: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj); +/* @internal */ export function ReplyShortChannelIdsEnd_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18753,6 +20890,7 @@ export function ReplyShortChannelIdsEnd_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser); +/* @internal */ export function ReplyShortChannelIdsEnd_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18761,6 +20899,7 @@ export function ReplyShortChannelIdsEnd_read(ser: number): number { return nativeResponseValue; } // MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg); +/* @internal */ export function QueryChannelRange_end_blocknum(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18769,6 +20908,7 @@ export function QueryChannelRange_end_blocknum(this_arg: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj); +/* @internal */ export function QueryChannelRange_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18777,6 +20917,7 @@ export function QueryChannelRange_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser); +/* @internal */ export function QueryChannelRange_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18785,6 +20926,7 @@ export function QueryChannelRange_read(ser: number): number { return nativeResponseValue; } // struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser); +/* @internal */ export function ReplyChannelRange_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18793,6 +20935,7 @@ export function ReplyChannelRange_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj); +/* @internal */ export function ReplyChannelRange_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18801,6 +20944,7 @@ export function ReplyChannelRange_write(obj: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj); +/* @internal */ export function GossipTimestampFilter_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18809,6 +20953,7 @@ export function GossipTimestampFilter_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser); +/* @internal */ export function GossipTimestampFilter_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18817,6 +20962,7 @@ export function GossipTimestampFilter_read(ser: number): number { return nativeResponseValue; } // void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr); +/* @internal */ export function CustomMessageHandler_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18825,6 +20971,7 @@ export function CustomMessageHandler_free(this_ptr: number): void { // debug statements here } // void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj); +/* @internal */ export function IgnoringMessageHandler_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18833,6 +20980,7 @@ export function IgnoringMessageHandler_free(this_obj: number): void { // debug statements here } // MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void); +/* @internal */ export function IgnoringMessageHandler_new(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18841,6 +20989,7 @@ export function IgnoringMessageHandler_new(): number { return nativeResponseValue; } // struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); +/* @internal */ export function IgnoringMessageHandler_as_MessageSendEventsProvider(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18849,6 +20998,7 @@ export function IgnoringMessageHandler_as_MessageSendEventsProvider(this_arg: nu return nativeResponseValue; } // struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); +/* @internal */ export function IgnoringMessageHandler_as_RoutingMessageHandler(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18857,6 +21007,7 @@ export function IgnoringMessageHandler_as_RoutingMessageHandler(this_arg: number return nativeResponseValue; } // struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); +/* @internal */ export function IgnoringMessageHandler_as_CustomMessageReader(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18865,6 +21016,7 @@ export function IgnoringMessageHandler_as_CustomMessageReader(this_arg: number): return nativeResponseValue; } // struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg); +/* @internal */ export function IgnoringMessageHandler_as_CustomMessageHandler(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18873,6 +21025,7 @@ export function IgnoringMessageHandler_as_CustomMessageHandler(this_arg: number) return nativeResponseValue; } // void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj); +/* @internal */ export function ErroringMessageHandler_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18881,6 +21034,7 @@ export function ErroringMessageHandler_free(this_obj: number): void { // debug statements here } // MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void); +/* @internal */ export function ErroringMessageHandler_new(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18889,6 +21043,7 @@ export function ErroringMessageHandler_new(): number { return nativeResponseValue; } // struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg); +/* @internal */ export function ErroringMessageHandler_as_MessageSendEventsProvider(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18897,6 +21052,7 @@ export function ErroringMessageHandler_as_MessageSendEventsProvider(this_arg: nu return nativeResponseValue; } // struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg); +/* @internal */ export function ErroringMessageHandler_as_ChannelMessageHandler(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18905,6 +21061,7 @@ export function ErroringMessageHandler_as_ChannelMessageHandler(this_arg: number return nativeResponseValue; } // void MessageHandler_free(struct LDKMessageHandler this_obj); +/* @internal */ export function MessageHandler_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18913,6 +21070,7 @@ export function MessageHandler_free(this_obj: number): void { // debug statements here } // const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr); +/* @internal */ export function MessageHandler_get_chan_handler(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18921,6 +21079,7 @@ export function MessageHandler_get_chan_handler(this_ptr: number): number { return nativeResponseValue; } // void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val); +/* @internal */ export function MessageHandler_set_chan_handler(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18929,6 +21088,7 @@ export function MessageHandler_set_chan_handler(this_ptr: number, val: number): // debug statements here } // const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr); +/* @internal */ export function MessageHandler_get_route_handler(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18937,6 +21097,7 @@ export function MessageHandler_get_route_handler(this_ptr: number): number { return nativeResponseValue; } // void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val); +/* @internal */ export function MessageHandler_set_route_handler(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18945,6 +21106,7 @@ export function MessageHandler_set_route_handler(this_ptr: number, val: number): // debug statements here } // MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg); +/* @internal */ export function MessageHandler_new(chan_handler_arg: number, route_handler_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18953,6 +21115,7 @@ export function MessageHandler_new(chan_handler_arg: number, route_handler_arg: return nativeResponseValue; } // uintptr_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg); +/* @internal */ export function SocketDescriptor_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18961,6 +21124,7 @@ export function SocketDescriptor_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig); +/* @internal */ export function SocketDescriptor_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18969,6 +21133,7 @@ export function SocketDescriptor_clone(orig: number): number { return nativeResponseValue; } // void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr); +/* @internal */ export function SocketDescriptor_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18977,6 +21142,7 @@ export function SocketDescriptor_free(this_ptr: number): void { // debug statements here } // void PeerHandleError_free(struct LDKPeerHandleError this_obj); +/* @internal */ export function PeerHandleError_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18985,6 +21151,7 @@ export function PeerHandleError_free(this_obj: number): void { // debug statements here } // bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr); +/* @internal */ export function PeerHandleError_get_no_connection_possible(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -18993,6 +21160,7 @@ export function PeerHandleError_get_no_connection_possible(this_ptr: number): bo return nativeResponseValue; } // void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function PeerHandleError_set_no_connection_possible(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19001,6 +21169,7 @@ export function PeerHandleError_set_no_connection_possible(this_ptr: number, val // debug statements here } // MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg); +/* @internal */ export function PeerHandleError_new(no_connection_possible_arg: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19009,6 +21178,7 @@ export function PeerHandleError_new(no_connection_possible_arg: boolean): number return nativeResponseValue; } // uintptr_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg); +/* @internal */ export function PeerHandleError_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19017,6 +21187,7 @@ export function PeerHandleError_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig); +/* @internal */ export function PeerHandleError_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19025,6 +21196,7 @@ export function PeerHandleError_clone(orig: number): number { return nativeResponseValue; } // void PeerManager_free(struct LDKPeerManager this_obj); +/* @internal */ export function PeerManager_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19033,6 +21205,7 @@ export function PeerManager_free(this_obj: number): void { // debug statements here } // MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKCustomMessageHandler custom_message_handler); +/* @internal */ export function PeerManager_new(message_handler: number, our_node_secret: number, ephemeral_random_data: number, logger: number, custom_message_handler: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19041,6 +21214,7 @@ export function PeerManager_new(message_handler: number, our_node_secret: number return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg); +/* @internal */ export function PeerManager_get_peer_node_ids(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19049,6 +21223,7 @@ export function PeerManager_get_peer_node_ids(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor); +/* @internal */ export function PeerManager_new_outbound_connection(this_arg: number, their_node_id: number, descriptor: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19057,6 +21232,7 @@ export function PeerManager_new_outbound_connection(this_arg: number, their_node return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor); +/* @internal */ export function PeerManager_new_inbound_connection(this_arg: number, descriptor: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19065,6 +21241,7 @@ export function PeerManager_new_inbound_connection(this_arg: number, descriptor: return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor); +/* @internal */ export function PeerManager_write_buffer_space_avail(this_arg: number, descriptor: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19073,6 +21250,7 @@ export function PeerManager_write_buffer_space_avail(this_arg: number, descripto return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR peer_descriptor, struct LDKu8slice data); +/* @internal */ export function PeerManager_read_event(this_arg: number, peer_descriptor: number, data: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19081,6 +21259,7 @@ export function PeerManager_read_event(this_arg: number, peer_descriptor: number return nativeResponseValue; } // void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg); +/* @internal */ export function PeerManager_process_events(this_arg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19089,6 +21268,7 @@ export function PeerManager_process_events(this_arg: number): void { // debug statements here } // void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor); +/* @internal */ export function PeerManager_socket_disconnected(this_arg: number, descriptor: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19097,6 +21277,7 @@ export function PeerManager_socket_disconnected(this_arg: number, descriptor: nu // debug statements here } // void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible); +/* @internal */ export function PeerManager_disconnect_by_node_id(this_arg: number, node_id: number, no_connection_possible: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19105,6 +21286,7 @@ export function PeerManager_disconnect_by_node_id(this_arg: number, node_id: num // debug statements here } // void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg); +/* @internal */ export function PeerManager_disconnect_all_peers(this_arg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19113,6 +21295,7 @@ export function PeerManager_disconnect_all_peers(this_arg: number): void { // debug statements here } // void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg); +/* @internal */ export function PeerManager_timer_tick_occurred(this_arg: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19121,6 +21304,7 @@ export function PeerManager_timer_tick_occurred(this_arg: number): void { // debug statements here } // uint64_t htlc_success_tx_weight(bool opt_anchors); +/* @internal */ export function htlc_success_tx_weight(opt_anchors: boolean): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19129,6 +21313,7 @@ export function htlc_success_tx_weight(opt_anchors: boolean): bigint { return nativeResponseValue; } // uint64_t htlc_timeout_tx_weight(bool opt_anchors); +/* @internal */ export function htlc_timeout_tx_weight(opt_anchors: boolean): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19137,6 +21322,7 @@ export function htlc_timeout_tx_weight(opt_anchors: boolean): bigint { return nativeResponseValue; } // struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx); +/* @internal */ export function build_commitment_secret(commitment_seed: number, idx: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19145,6 +21331,7 @@ export function build_commitment_secret(commitment_seed: number, idx: bigint): n return nativeResponseValue; } // struct LDKTransaction build_closing_transaction(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint); +/* @internal */ export function build_closing_transaction(to_holder_value_sat: bigint, to_counterparty_value_sat: bigint, to_holder_script: number, to_counterparty_script: number, funding_outpoint: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19153,6 +21340,7 @@ export function build_closing_transaction(to_holder_value_sat: bigint, to_counte return nativeResponseValue; } // struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); +/* @internal */ export function derive_private_key(per_commitment_point: number, base_secret: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19161,6 +21349,7 @@ export function derive_private_key(per_commitment_point: number, base_secret: nu return nativeResponseValue; } // struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point); +/* @internal */ export function derive_public_key(per_commitment_point: number, base_point: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19169,6 +21358,7 @@ export function derive_public_key(per_commitment_point: number, base_point: numb return nativeResponseValue; } // struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); +/* @internal */ export function derive_private_revocation_key(per_commitment_secret: number, countersignatory_revocation_base_secret: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19177,6 +21367,7 @@ export function derive_private_revocation_key(per_commitment_secret: number, cou return nativeResponseValue; } // struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point); +/* @internal */ export function derive_public_revocation_key(per_commitment_point: number, countersignatory_revocation_base_point: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19185,6 +21376,7 @@ export function derive_public_revocation_key(per_commitment_point: number, count return nativeResponseValue; } // void TxCreationKeys_free(struct LDKTxCreationKeys this_obj); +/* @internal */ export function TxCreationKeys_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19193,6 +21385,7 @@ export function TxCreationKeys_free(this_obj: number): void { // debug statements here } // struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); +/* @internal */ export function TxCreationKeys_get_per_commitment_point(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19201,6 +21394,7 @@ export function TxCreationKeys_get_per_commitment_point(this_ptr: number): numbe return nativeResponseValue; } // void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function TxCreationKeys_set_per_commitment_point(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19209,6 +21403,7 @@ export function TxCreationKeys_set_per_commitment_point(this_ptr: number, val: n // debug statements here } // struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); +/* @internal */ export function TxCreationKeys_get_revocation_key(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19217,6 +21412,7 @@ export function TxCreationKeys_get_revocation_key(this_ptr: number): number { return nativeResponseValue; } // void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function TxCreationKeys_set_revocation_key(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19225,6 +21421,7 @@ export function TxCreationKeys_set_revocation_key(this_ptr: number, val: number) // debug statements here } // struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); +/* @internal */ export function TxCreationKeys_get_broadcaster_htlc_key(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19233,6 +21430,7 @@ export function TxCreationKeys_get_broadcaster_htlc_key(this_ptr: number): numbe return nativeResponseValue; } // void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function TxCreationKeys_set_broadcaster_htlc_key(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19241,6 +21439,7 @@ export function TxCreationKeys_set_broadcaster_htlc_key(this_ptr: number, val: n // debug statements here } // struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); +/* @internal */ export function TxCreationKeys_get_countersignatory_htlc_key(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19249,6 +21448,7 @@ export function TxCreationKeys_get_countersignatory_htlc_key(this_ptr: number): return nativeResponseValue; } // void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function TxCreationKeys_set_countersignatory_htlc_key(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19257,6 +21457,7 @@ export function TxCreationKeys_set_countersignatory_htlc_key(this_ptr: number, v // debug statements here } // struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); +/* @internal */ export function TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19265,6 +21466,7 @@ export function TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr: num return nativeResponseValue; } // void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19273,6 +21475,7 @@ export function TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr: num // debug statements here } // MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg); +/* @internal */ export function TxCreationKeys_new(per_commitment_point_arg: number, revocation_key_arg: number, broadcaster_htlc_key_arg: number, countersignatory_htlc_key_arg: number, broadcaster_delayed_payment_key_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19281,6 +21484,7 @@ export function TxCreationKeys_new(per_commitment_point_arg: number, revocation_ return nativeResponseValue; } // uintptr_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg); +/* @internal */ export function TxCreationKeys_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19289,6 +21493,7 @@ export function TxCreationKeys_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig); +/* @internal */ export function TxCreationKeys_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19297,6 +21502,7 @@ export function TxCreationKeys_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj); +/* @internal */ export function TxCreationKeys_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19305,6 +21511,7 @@ export function TxCreationKeys_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser); +/* @internal */ export function TxCreationKeys_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19313,6 +21520,7 @@ export function TxCreationKeys_read(ser: number): number { return nativeResponseValue; } // void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj); +/* @internal */ export function ChannelPublicKeys_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19321,6 +21529,7 @@ export function ChannelPublicKeys_free(this_obj: number): void { // debug statements here } // struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelPublicKeys_get_funding_pubkey(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19329,6 +21538,7 @@ export function ChannelPublicKeys_get_funding_pubkey(this_ptr: number): number { return nativeResponseValue; } // void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function ChannelPublicKeys_set_funding_pubkey(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19337,6 +21547,7 @@ export function ChannelPublicKeys_set_funding_pubkey(this_ptr: number, val: numb // debug statements here } // struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelPublicKeys_get_revocation_basepoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19345,6 +21556,7 @@ export function ChannelPublicKeys_get_revocation_basepoint(this_ptr: number): nu return nativeResponseValue; } // void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function ChannelPublicKeys_set_revocation_basepoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19353,6 +21565,7 @@ export function ChannelPublicKeys_set_revocation_basepoint(this_ptr: number, val // debug statements here } // struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelPublicKeys_get_payment_point(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19361,6 +21574,7 @@ export function ChannelPublicKeys_get_payment_point(this_ptr: number): number { return nativeResponseValue; } // void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function ChannelPublicKeys_set_payment_point(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19369,6 +21583,7 @@ export function ChannelPublicKeys_set_payment_point(this_ptr: number, val: numbe // debug statements here } // struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19377,6 +21592,7 @@ export function ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr: number return nativeResponseValue; } // void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19385,6 +21601,7 @@ export function ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr: number // debug statements here } // struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelPublicKeys_get_htlc_basepoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19393,6 +21610,7 @@ export function ChannelPublicKeys_get_htlc_basepoint(this_ptr: number): number { return nativeResponseValue; } // void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function ChannelPublicKeys_set_htlc_basepoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19401,6 +21619,7 @@ export function ChannelPublicKeys_set_htlc_basepoint(this_ptr: number, val: numb // debug statements here } // MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg); +/* @internal */ export function ChannelPublicKeys_new(funding_pubkey_arg: number, revocation_basepoint_arg: number, payment_point_arg: number, delayed_payment_basepoint_arg: number, htlc_basepoint_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19409,6 +21628,7 @@ export function ChannelPublicKeys_new(funding_pubkey_arg: number, revocation_bas return nativeResponseValue; } // uintptr_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg); +/* @internal */ export function ChannelPublicKeys_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19417,6 +21637,7 @@ export function ChannelPublicKeys_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig); +/* @internal */ export function ChannelPublicKeys_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19425,6 +21646,7 @@ export function ChannelPublicKeys_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj); +/* @internal */ export function ChannelPublicKeys_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19433,6 +21655,7 @@ export function ChannelPublicKeys_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser); +/* @internal */ export function ChannelPublicKeys_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19441,6 +21664,7 @@ export function ChannelPublicKeys_read(ser: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base); +/* @internal */ export function TxCreationKeys_derive_new(per_commitment_point: number, broadcaster_delayed_payment_base: number, broadcaster_htlc_base: number, countersignatory_revocation_base: number, countersignatory_htlc_base: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19449,6 +21673,7 @@ export function TxCreationKeys_derive_new(per_commitment_point: number, broadcas return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); +/* @internal */ export function TxCreationKeys_from_channel_static_keys(per_commitment_point: number, broadcaster_keys: number, countersignatory_keys: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19457,6 +21682,7 @@ export function TxCreationKeys_from_channel_static_keys(per_commitment_point: nu return nativeResponseValue; } // struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key); +/* @internal */ export function get_revokeable_redeemscript(revocation_key: number, contest_delay: number, broadcaster_delayed_payment_key: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19465,6 +21691,7 @@ export function get_revokeable_redeemscript(revocation_key: number, contest_dela return nativeResponseValue; } // void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj); +/* @internal */ export function HTLCOutputInCommitment_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19473,6 +21700,7 @@ export function HTLCOutputInCommitment_free(this_obj: number): void { // debug statements here } // bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); +/* @internal */ export function HTLCOutputInCommitment_get_offered(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19481,6 +21709,7 @@ export function HTLCOutputInCommitment_get_offered(this_ptr: number): boolean { return nativeResponseValue; } // void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function HTLCOutputInCommitment_set_offered(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19489,6 +21718,7 @@ export function HTLCOutputInCommitment_set_offered(this_ptr: number, val: boolea // debug statements here } // uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); +/* @internal */ export function HTLCOutputInCommitment_get_amount_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19497,6 +21727,7 @@ export function HTLCOutputInCommitment_get_amount_msat(this_ptr: number): bigint return nativeResponseValue; } // void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function HTLCOutputInCommitment_set_amount_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19505,6 +21736,7 @@ export function HTLCOutputInCommitment_set_amount_msat(this_ptr: number, val: bi // debug statements here } // uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); +/* @internal */ export function HTLCOutputInCommitment_get_cltv_expiry(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19513,6 +21745,7 @@ export function HTLCOutputInCommitment_get_cltv_expiry(this_ptr: number): number return nativeResponseValue; } // void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function HTLCOutputInCommitment_set_cltv_expiry(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19521,6 +21754,7 @@ export function HTLCOutputInCommitment_set_cltv_expiry(this_ptr: number, val: nu // debug statements here } // const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function HTLCOutputInCommitment_get_payment_hash(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19529,6 +21763,7 @@ export function HTLCOutputInCommitment_get_payment_hash(this_ptr: number): numbe return nativeResponseValue; } // void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function HTLCOutputInCommitment_set_payment_hash(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19537,6 +21772,7 @@ export function HTLCOutputInCommitment_set_payment_hash(this_ptr: number, val: n // debug statements here } // struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); +/* @internal */ export function HTLCOutputInCommitment_get_transaction_output_index(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19545,6 +21781,7 @@ export function HTLCOutputInCommitment_get_transaction_output_index(this_ptr: nu return nativeResponseValue; } // void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); +/* @internal */ export function HTLCOutputInCommitment_set_transaction_output_index(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19553,6 +21790,7 @@ export function HTLCOutputInCommitment_set_transaction_output_index(this_ptr: nu // debug statements here } // MUST_USE_RES struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_new(bool offered_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u32Z transaction_output_index_arg); +/* @internal */ export function HTLCOutputInCommitment_new(offered_arg: boolean, amount_msat_arg: bigint, cltv_expiry_arg: number, payment_hash_arg: number, transaction_output_index_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19561,6 +21799,7 @@ export function HTLCOutputInCommitment_new(offered_arg: boolean, amount_msat_arg return nativeResponseValue; } // uintptr_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg); +/* @internal */ export function HTLCOutputInCommitment_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19569,6 +21808,7 @@ export function HTLCOutputInCommitment_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig); +/* @internal */ export function HTLCOutputInCommitment_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19577,6 +21817,7 @@ export function HTLCOutputInCommitment_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj); +/* @internal */ export function HTLCOutputInCommitment_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19585,6 +21826,7 @@ export function HTLCOutputInCommitment_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser); +/* @internal */ export function HTLCOutputInCommitment_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19593,6 +21835,7 @@ export function HTLCOutputInCommitment_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys); +/* @internal */ export function get_htlc_redeemscript(htlc: number, opt_anchors: boolean, keys: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19601,6 +21844,7 @@ export function get_htlc_redeemscript(htlc: number, opt_anchors: boolean, keys: return nativeResponseValue; } // struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory); +/* @internal */ export function make_funding_redeemscript(broadcaster: number, countersignatory: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19609,6 +21853,7 @@ export function make_funding_redeemscript(broadcaster: number, countersignatory: return nativeResponseValue; } // struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key); +/* @internal */ export function build_htlc_transaction(commitment_txid: number, feerate_per_kw: number, contest_delay: number, htlc: number, opt_anchors: boolean, broadcaster_delayed_payment_key: number, revocation_key: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19617,6 +21862,7 @@ export function build_htlc_transaction(commitment_txid: number, feerate_per_kw: return nativeResponseValue; } // struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey); +/* @internal */ export function get_anchor_redeemscript(funding_pubkey: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19625,6 +21871,7 @@ export function get_anchor_redeemscript(funding_pubkey: number): number { return nativeResponseValue; } // void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj); +/* @internal */ export function ChannelTransactionParameters_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19633,6 +21880,7 @@ export function ChannelTransactionParameters_free(this_obj: number): void { // debug statements here } // struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelTransactionParameters_get_holder_pubkeys(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19641,6 +21889,7 @@ export function ChannelTransactionParameters_get_holder_pubkeys(this_ptr: number return nativeResponseValue; } // void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val); +/* @internal */ export function ChannelTransactionParameters_set_holder_pubkeys(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19649,6 +21898,7 @@ export function ChannelTransactionParameters_set_holder_pubkeys(this_ptr: number // debug statements here } // uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelTransactionParameters_get_holder_selected_contest_delay(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19657,6 +21907,7 @@ export function ChannelTransactionParameters_get_holder_selected_contest_delay(t return nativeResponseValue; } // void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function ChannelTransactionParameters_set_holder_selected_contest_delay(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19665,6 +21916,7 @@ export function ChannelTransactionParameters_set_holder_selected_contest_delay(t // debug statements here } // bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelTransactionParameters_get_is_outbound_from_holder(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19673,6 +21925,7 @@ export function ChannelTransactionParameters_get_is_outbound_from_holder(this_pt return nativeResponseValue; } // void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function ChannelTransactionParameters_set_is_outbound_from_holder(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19681,6 +21934,7 @@ export function ChannelTransactionParameters_set_is_outbound_from_holder(this_pt // debug statements here } // struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelTransactionParameters_get_counterparty_parameters(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19689,6 +21943,7 @@ export function ChannelTransactionParameters_get_counterparty_parameters(this_pt return nativeResponseValue; } // void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val); +/* @internal */ export function ChannelTransactionParameters_set_counterparty_parameters(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19697,6 +21952,7 @@ export function ChannelTransactionParameters_set_counterparty_parameters(this_pt // debug statements here } // struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelTransactionParameters_get_funding_outpoint(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19705,6 +21961,7 @@ export function ChannelTransactionParameters_get_funding_outpoint(this_ptr: numb return nativeResponseValue; } // void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val); +/* @internal */ export function ChannelTransactionParameters_set_funding_outpoint(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19713,6 +21970,7 @@ export function ChannelTransactionParameters_set_funding_outpoint(this_ptr: numb // debug statements here } // enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelTransactionParameters_get_opt_anchors(this_ptr: number): COption_NoneZ { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19721,6 +21979,7 @@ export function ChannelTransactionParameters_get_opt_anchors(this_ptr: number): return nativeResponseValue; } // void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); +/* @internal */ export function ChannelTransactionParameters_set_opt_anchors(this_ptr: number, val: COption_NoneZ): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19729,6 +21988,7 @@ export function ChannelTransactionParameters_set_opt_anchors(this_ptr: number, v // debug statements here } // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg, enum LDKCOption_NoneZ opt_anchors_arg); +/* @internal */ export function ChannelTransactionParameters_new(holder_pubkeys_arg: number, holder_selected_contest_delay_arg: number, is_outbound_from_holder_arg: boolean, counterparty_parameters_arg: number, funding_outpoint_arg: number, opt_anchors_arg: COption_NoneZ): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19737,6 +21997,7 @@ export function ChannelTransactionParameters_new(holder_pubkeys_arg: number, hol return nativeResponseValue; } // uintptr_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg); +/* @internal */ export function ChannelTransactionParameters_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19745,6 +22006,7 @@ export function ChannelTransactionParameters_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig); +/* @internal */ export function ChannelTransactionParameters_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19753,6 +22015,7 @@ export function ChannelTransactionParameters_clone(orig: number): number { return nativeResponseValue; } // void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj); +/* @internal */ export function CounterpartyChannelTransactionParameters_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19761,6 +22024,7 @@ export function CounterpartyChannelTransactionParameters_free(this_obj: number): // debug statements here } // struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr); +/* @internal */ export function CounterpartyChannelTransactionParameters_get_pubkeys(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19769,6 +22033,7 @@ export function CounterpartyChannelTransactionParameters_get_pubkeys(this_ptr: n return nativeResponseValue; } // void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val); +/* @internal */ export function CounterpartyChannelTransactionParameters_set_pubkeys(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19777,6 +22042,7 @@ export function CounterpartyChannelTransactionParameters_set_pubkeys(this_ptr: n // debug statements here } // uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr); +/* @internal */ export function CounterpartyChannelTransactionParameters_get_selected_contest_delay(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19785,6 +22051,7 @@ export function CounterpartyChannelTransactionParameters_get_selected_contest_de return nativeResponseValue; } // void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function CounterpartyChannelTransactionParameters_set_selected_contest_delay(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19793,6 +22060,7 @@ export function CounterpartyChannelTransactionParameters_set_selected_contest_de // debug statements here } // MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg); +/* @internal */ export function CounterpartyChannelTransactionParameters_new(pubkeys_arg: number, selected_contest_delay_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19801,6 +22069,7 @@ export function CounterpartyChannelTransactionParameters_new(pubkeys_arg: number return nativeResponseValue; } // uintptr_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg); +/* @internal */ export function CounterpartyChannelTransactionParameters_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19809,6 +22078,7 @@ export function CounterpartyChannelTransactionParameters_clone_ptr(arg: number): return nativeResponseValue; } // struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig); +/* @internal */ export function CounterpartyChannelTransactionParameters_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19817,6 +22087,7 @@ export function CounterpartyChannelTransactionParameters_clone(orig: number): nu return nativeResponseValue; } // MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); +/* @internal */ export function ChannelTransactionParameters_is_populated(this_arg: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19825,6 +22096,7 @@ export function ChannelTransactionParameters_is_populated(this_arg: number): boo return nativeResponseValue; } // MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); +/* @internal */ export function ChannelTransactionParameters_as_holder_broadcastable(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19833,6 +22105,7 @@ export function ChannelTransactionParameters_as_holder_broadcastable(this_arg: n return nativeResponseValue; } // MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); +/* @internal */ export function ChannelTransactionParameters_as_counterparty_broadcastable(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19841,6 +22114,7 @@ export function ChannelTransactionParameters_as_counterparty_broadcastable(this_ return nativeResponseValue; } // struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj); +/* @internal */ export function CounterpartyChannelTransactionParameters_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19849,6 +22123,7 @@ export function CounterpartyChannelTransactionParameters_write(obj: number): num return nativeResponseValue; } // struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser); +/* @internal */ export function CounterpartyChannelTransactionParameters_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19857,6 +22132,7 @@ export function CounterpartyChannelTransactionParameters_read(ser: number): numb return nativeResponseValue; } // struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj); +/* @internal */ export function ChannelTransactionParameters_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19865,6 +22141,7 @@ export function ChannelTransactionParameters_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser); +/* @internal */ export function ChannelTransactionParameters_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19873,6 +22150,7 @@ export function ChannelTransactionParameters_read(ser: number): number { return nativeResponseValue; } // void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj); +/* @internal */ export function DirectedChannelTransactionParameters_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19881,6 +22159,7 @@ export function DirectedChannelTransactionParameters_free(this_obj: number): voi // debug statements here } // MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); +/* @internal */ export function DirectedChannelTransactionParameters_broadcaster_pubkeys(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19889,6 +22168,7 @@ export function DirectedChannelTransactionParameters_broadcaster_pubkeys(this_ar return nativeResponseValue; } // MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); +/* @internal */ export function DirectedChannelTransactionParameters_countersignatory_pubkeys(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19897,6 +22177,7 @@ export function DirectedChannelTransactionParameters_countersignatory_pubkeys(th return nativeResponseValue; } // MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); +/* @internal */ export function DirectedChannelTransactionParameters_contest_delay(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19905,6 +22186,7 @@ export function DirectedChannelTransactionParameters_contest_delay(this_arg: num return nativeResponseValue; } // MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); +/* @internal */ export function DirectedChannelTransactionParameters_is_outbound(this_arg: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19913,6 +22195,7 @@ export function DirectedChannelTransactionParameters_is_outbound(this_arg: numbe return nativeResponseValue; } // MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); +/* @internal */ export function DirectedChannelTransactionParameters_funding_outpoint(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19921,6 +22204,7 @@ export function DirectedChannelTransactionParameters_funding_outpoint(this_arg: return nativeResponseValue; } // MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); +/* @internal */ export function DirectedChannelTransactionParameters_opt_anchors(this_arg: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19929,6 +22213,7 @@ export function DirectedChannelTransactionParameters_opt_anchors(this_arg: numbe return nativeResponseValue; } // void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj); +/* @internal */ export function HolderCommitmentTransaction_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19937,6 +22222,7 @@ export function HolderCommitmentTransaction_free(this_obj: number): void { // debug statements here } // struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr); +/* @internal */ export function HolderCommitmentTransaction_get_counterparty_sig(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19945,6 +22231,7 @@ export function HolderCommitmentTransaction_get_counterparty_sig(this_ptr: numbe return nativeResponseValue; } // void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val); +/* @internal */ export function HolderCommitmentTransaction_set_counterparty_sig(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19953,6 +22240,7 @@ export function HolderCommitmentTransaction_set_counterparty_sig(this_ptr: numbe // debug statements here } // void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val); +/* @internal */ export function HolderCommitmentTransaction_set_counterparty_htlc_sigs(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19961,6 +22249,7 @@ export function HolderCommitmentTransaction_set_counterparty_htlc_sigs(this_ptr: // debug statements here } // uintptr_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg); +/* @internal */ export function HolderCommitmentTransaction_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19969,6 +22258,7 @@ export function HolderCommitmentTransaction_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig); +/* @internal */ export function HolderCommitmentTransaction_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19977,6 +22267,7 @@ export function HolderCommitmentTransaction_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj); +/* @internal */ export function HolderCommitmentTransaction_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19985,6 +22276,7 @@ export function HolderCommitmentTransaction_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser); +/* @internal */ export function HolderCommitmentTransaction_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -19993,6 +22285,7 @@ export function HolderCommitmentTransaction_read(ser: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKSignature counterparty_sig, struct LDKCVec_SignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key); +/* @internal */ export function HolderCommitmentTransaction_new(commitment_tx: number, counterparty_sig: number, counterparty_htlc_sigs: number, holder_funding_key: number, counterparty_funding_key: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20001,6 +22294,7 @@ export function HolderCommitmentTransaction_new(commitment_tx: number, counterpa return nativeResponseValue; } // void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj); +/* @internal */ export function BuiltCommitmentTransaction_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20009,6 +22303,7 @@ export function BuiltCommitmentTransaction_free(this_obj: number): void { // debug statements here } // struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr); +/* @internal */ export function BuiltCommitmentTransaction_get_transaction(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20017,6 +22312,7 @@ export function BuiltCommitmentTransaction_get_transaction(this_ptr: number): nu return nativeResponseValue; } // void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val); +/* @internal */ export function BuiltCommitmentTransaction_set_transaction(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20025,6 +22321,7 @@ export function BuiltCommitmentTransaction_set_transaction(this_ptr: number, val // debug statements here } // const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function BuiltCommitmentTransaction_get_txid(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20033,6 +22330,7 @@ export function BuiltCommitmentTransaction_get_txid(this_ptr: number): number { return nativeResponseValue; } // void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function BuiltCommitmentTransaction_set_txid(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20041,6 +22339,7 @@ export function BuiltCommitmentTransaction_set_txid(this_ptr: number, val: numbe // debug statements here } // MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg); +/* @internal */ export function BuiltCommitmentTransaction_new(transaction_arg: number, txid_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20049,6 +22348,7 @@ export function BuiltCommitmentTransaction_new(transaction_arg: number, txid_arg return nativeResponseValue; } // uintptr_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg); +/* @internal */ export function BuiltCommitmentTransaction_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20057,6 +22357,7 @@ export function BuiltCommitmentTransaction_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig); +/* @internal */ export function BuiltCommitmentTransaction_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20065,6 +22366,7 @@ export function BuiltCommitmentTransaction_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj); +/* @internal */ export function BuiltCommitmentTransaction_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20073,6 +22375,7 @@ export function BuiltCommitmentTransaction_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser); +/* @internal */ export function BuiltCommitmentTransaction_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20081,6 +22384,7 @@ export function BuiltCommitmentTransaction_read(ser: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKThirtyTwoBytes BuiltCommitmentTransaction_get_sighash_all(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); +/* @internal */ export function BuiltCommitmentTransaction_get_sighash_all(this_arg: number, funding_redeemscript: number, channel_value_satoshis: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20089,6 +22393,7 @@ export function BuiltCommitmentTransaction_get_sighash_all(this_arg: number, fun return nativeResponseValue; } // MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); +/* @internal */ export function BuiltCommitmentTransaction_sign(this_arg: number, funding_key: number, funding_redeemscript: number, channel_value_satoshis: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20097,6 +22402,7 @@ export function BuiltCommitmentTransaction_sign(this_arg: number, funding_key: n return nativeResponseValue; } // void ClosingTransaction_free(struct LDKClosingTransaction this_obj); +/* @internal */ export function ClosingTransaction_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20105,6 +22411,7 @@ export function ClosingTransaction_free(this_obj: number): void { // debug statements here } // uintptr_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg); +/* @internal */ export function ClosingTransaction_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20113,6 +22420,7 @@ export function ClosingTransaction_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig); +/* @internal */ export function ClosingTransaction_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20121,6 +22429,7 @@ export function ClosingTransaction_clone(orig: number): number { return nativeResponseValue; } // uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o); +/* @internal */ export function ClosingTransaction_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20129,6 +22438,7 @@ export function ClosingTransaction_hash(o: number): bigint { return nativeResponseValue; } // MUST_USE_RES struct LDKClosingTransaction ClosingTransaction_new(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint); +/* @internal */ export function ClosingTransaction_new(to_holder_value_sat: bigint, to_counterparty_value_sat: bigint, to_holder_script: number, to_counterparty_script: number, funding_outpoint: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20137,6 +22447,7 @@ export function ClosingTransaction_new(to_holder_value_sat: bigint, to_counterpa return nativeResponseValue; } // MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg); +/* @internal */ export function ClosingTransaction_trust(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20145,6 +22456,7 @@ export function ClosingTransaction_trust(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint); +/* @internal */ export function ClosingTransaction_verify(this_arg: number, funding_outpoint: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20153,6 +22465,7 @@ export function ClosingTransaction_verify(this_arg: number, funding_outpoint: nu return nativeResponseValue; } // MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg); +/* @internal */ export function ClosingTransaction_to_holder_value_sat(this_arg: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20161,6 +22474,7 @@ export function ClosingTransaction_to_holder_value_sat(this_arg: number): bigint return nativeResponseValue; } // MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg); +/* @internal */ export function ClosingTransaction_to_counterparty_value_sat(this_arg: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20169,6 +22483,7 @@ export function ClosingTransaction_to_counterparty_value_sat(this_arg: number): return nativeResponseValue; } // MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg); +/* @internal */ export function ClosingTransaction_to_holder_script(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20177,6 +22492,7 @@ export function ClosingTransaction_to_holder_script(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg); +/* @internal */ export function ClosingTransaction_to_counterparty_script(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20185,6 +22501,7 @@ export function ClosingTransaction_to_counterparty_script(this_arg: number): num return nativeResponseValue; } // void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj); +/* @internal */ export function TrustedClosingTransaction_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20193,6 +22510,7 @@ export function TrustedClosingTransaction_free(this_obj: number): void { // debug statements here } // MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg); +/* @internal */ export function TrustedClosingTransaction_built_transaction(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20201,6 +22519,7 @@ export function TrustedClosingTransaction_built_transaction(this_arg: number): n return nativeResponseValue; } // MUST_USE_RES struct LDKThirtyTwoBytes TrustedClosingTransaction_get_sighash_all(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); +/* @internal */ export function TrustedClosingTransaction_get_sighash_all(this_arg: number, funding_redeemscript: number, channel_value_satoshis: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20209,6 +22528,7 @@ export function TrustedClosingTransaction_get_sighash_all(this_arg: number, fund return nativeResponseValue; } // MUST_USE_RES struct LDKSignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); +/* @internal */ export function TrustedClosingTransaction_sign(this_arg: number, funding_key: number, funding_redeemscript: number, channel_value_satoshis: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20217,6 +22537,7 @@ export function TrustedClosingTransaction_sign(this_arg: number, funding_key: nu return nativeResponseValue; } // void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj); +/* @internal */ export function CommitmentTransaction_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20225,6 +22546,7 @@ export function CommitmentTransaction_free(this_obj: number): void { // debug statements here } // uintptr_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg); +/* @internal */ export function CommitmentTransaction_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20233,6 +22555,7 @@ export function CommitmentTransaction_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig); +/* @internal */ export function CommitmentTransaction_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20241,6 +22564,7 @@ export function CommitmentTransaction_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj); +/* @internal */ export function CommitmentTransaction_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20249,6 +22573,7 @@ export function CommitmentTransaction_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser); +/* @internal */ export function CommitmentTransaction_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20257,6 +22582,7 @@ export function CommitmentTransaction_read(ser: number): number { return nativeResponseValue; } // MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); +/* @internal */ export function CommitmentTransaction_commitment_number(this_arg: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20265,6 +22591,7 @@ export function CommitmentTransaction_commitment_number(this_arg: number): bigin return nativeResponseValue; } // MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); +/* @internal */ export function CommitmentTransaction_to_broadcaster_value_sat(this_arg: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20273,6 +22600,7 @@ export function CommitmentTransaction_to_broadcaster_value_sat(this_arg: number) return nativeResponseValue; } // MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); +/* @internal */ export function CommitmentTransaction_to_countersignatory_value_sat(this_arg: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20281,6 +22609,7 @@ export function CommitmentTransaction_to_countersignatory_value_sat(this_arg: nu return nativeResponseValue; } // MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); +/* @internal */ export function CommitmentTransaction_feerate_per_kw(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20289,6 +22618,7 @@ export function CommitmentTransaction_feerate_per_kw(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); +/* @internal */ export function CommitmentTransaction_trust(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20297,6 +22627,7 @@ export function CommitmentTransaction_trust(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_TrustedCommitmentTransactionNoneZ CommitmentTransaction_verify(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg, const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); +/* @internal */ export function CommitmentTransaction_verify(this_arg: number, channel_parameters: number, broadcaster_keys: number, countersignatory_keys: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20305,6 +22636,7 @@ export function CommitmentTransaction_verify(this_arg: number, channel_parameter return nativeResponseValue; } // void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj); +/* @internal */ export function TrustedCommitmentTransaction_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20313,6 +22645,7 @@ export function TrustedCommitmentTransaction_free(this_obj: number): void { // debug statements here } // MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); +/* @internal */ export function TrustedCommitmentTransaction_txid(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20321,6 +22654,7 @@ export function TrustedCommitmentTransaction_txid(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); +/* @internal */ export function TrustedCommitmentTransaction_built_transaction(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20329,6 +22663,7 @@ export function TrustedCommitmentTransaction_built_transaction(this_arg: number) return nativeResponseValue; } // MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); +/* @internal */ export function TrustedCommitmentTransaction_keys(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20337,6 +22672,7 @@ export function TrustedCommitmentTransaction_keys(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); +/* @internal */ export function TrustedCommitmentTransaction_opt_anchors(this_arg: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20345,6 +22681,7 @@ export function TrustedCommitmentTransaction_opt_anchors(this_arg: number): bool return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters); +/* @internal */ export function TrustedCommitmentTransaction_get_htlc_sigs(this_arg: number, htlc_base_key: number, channel_parameters: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20353,6 +22690,7 @@ export function TrustedCommitmentTransaction_get_htlc_sigs(this_arg: number, htl return nativeResponseValue; } // uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster); +/* @internal */ export function get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint: number, countersignatory_payment_basepoint: number, outbound_from_broadcaster: boolean): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20361,6 +22699,7 @@ export function get_commitment_transaction_number_obscure_factor(broadcaster_pay return nativeResponseValue; } // bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b); +/* @internal */ export function InitFeatures_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20369,6 +22708,7 @@ export function InitFeatures_eq(a: number, b: number): boolean { return nativeResponseValue; } // bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b); +/* @internal */ export function NodeFeatures_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20377,6 +22717,7 @@ export function NodeFeatures_eq(a: number, b: number): boolean { return nativeResponseValue; } // bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b); +/* @internal */ export function ChannelFeatures_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20385,6 +22726,7 @@ export function ChannelFeatures_eq(a: number, b: number): boolean { return nativeResponseValue; } // bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b); +/* @internal */ export function InvoiceFeatures_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20393,6 +22735,7 @@ export function InvoiceFeatures_eq(a: number, b: number): boolean { return nativeResponseValue; } // bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b); +/* @internal */ export function ChannelTypeFeatures_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20401,6 +22744,7 @@ export function ChannelTypeFeatures_eq(a: number, b: number): boolean { return nativeResponseValue; } // uintptr_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg); +/* @internal */ export function InitFeatures_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20409,6 +22753,7 @@ export function InitFeatures_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig); +/* @internal */ export function InitFeatures_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20417,6 +22762,7 @@ export function InitFeatures_clone(orig: number): number { return nativeResponseValue; } // uintptr_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg); +/* @internal */ export function NodeFeatures_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20425,6 +22771,7 @@ export function NodeFeatures_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig); +/* @internal */ export function NodeFeatures_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20433,6 +22780,7 @@ export function NodeFeatures_clone(orig: number): number { return nativeResponseValue; } // uintptr_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg); +/* @internal */ export function ChannelFeatures_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20441,6 +22789,7 @@ export function ChannelFeatures_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig); +/* @internal */ export function ChannelFeatures_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20449,6 +22798,7 @@ export function ChannelFeatures_clone(orig: number): number { return nativeResponseValue; } // uintptr_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg); +/* @internal */ export function InvoiceFeatures_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20457,6 +22807,7 @@ export function InvoiceFeatures_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig); +/* @internal */ export function InvoiceFeatures_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20465,6 +22816,7 @@ export function InvoiceFeatures_clone(orig: number): number { return nativeResponseValue; } // uintptr_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg); +/* @internal */ export function ChannelTypeFeatures_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20473,6 +22825,7 @@ export function ChannelTypeFeatures_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig); +/* @internal */ export function ChannelTypeFeatures_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20481,6 +22834,7 @@ export function ChannelTypeFeatures_clone(orig: number): number { return nativeResponseValue; } // void InitFeatures_free(struct LDKInitFeatures this_obj); +/* @internal */ export function InitFeatures_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20489,6 +22843,7 @@ export function InitFeatures_free(this_obj: number): void { // debug statements here } // void NodeFeatures_free(struct LDKNodeFeatures this_obj); +/* @internal */ export function NodeFeatures_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20497,6 +22852,7 @@ export function NodeFeatures_free(this_obj: number): void { // debug statements here } // void ChannelFeatures_free(struct LDKChannelFeatures this_obj); +/* @internal */ export function ChannelFeatures_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20505,6 +22861,7 @@ export function ChannelFeatures_free(this_obj: number): void { // debug statements here } // void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj); +/* @internal */ export function InvoiceFeatures_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20513,6 +22870,7 @@ export function InvoiceFeatures_free(this_obj: number): void { // debug statements here } // void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj); +/* @internal */ export function ChannelTypeFeatures_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20521,6 +22879,7 @@ export function ChannelTypeFeatures_free(this_obj: number): void { // debug statements here } // MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void); +/* @internal */ export function InitFeatures_empty(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20529,6 +22888,7 @@ export function InitFeatures_empty(): number { return nativeResponseValue; } // MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void); +/* @internal */ export function InitFeatures_known(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20537,6 +22897,7 @@ export function InitFeatures_known(): number { return nativeResponseValue; } // MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg); +/* @internal */ export function InitFeatures_requires_unknown_bits(this_arg: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20545,6 +22906,7 @@ export function InitFeatures_requires_unknown_bits(this_arg: number): boolean { return nativeResponseValue; } // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void); +/* @internal */ export function NodeFeatures_empty(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20553,6 +22915,7 @@ export function NodeFeatures_empty(): number { return nativeResponseValue; } // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void); +/* @internal */ export function NodeFeatures_known(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20561,6 +22924,7 @@ export function NodeFeatures_known(): number { return nativeResponseValue; } // MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg); +/* @internal */ export function NodeFeatures_requires_unknown_bits(this_arg: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20569,6 +22933,7 @@ export function NodeFeatures_requires_unknown_bits(this_arg: number): boolean { return nativeResponseValue; } // MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void); +/* @internal */ export function ChannelFeatures_empty(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20577,6 +22942,7 @@ export function ChannelFeatures_empty(): number { return nativeResponseValue; } // MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void); +/* @internal */ export function ChannelFeatures_known(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20585,6 +22951,7 @@ export function ChannelFeatures_known(): number { return nativeResponseValue; } // MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg); +/* @internal */ export function ChannelFeatures_requires_unknown_bits(this_arg: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20593,6 +22960,7 @@ export function ChannelFeatures_requires_unknown_bits(this_arg: number): boolean return nativeResponseValue; } // MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void); +/* @internal */ export function InvoiceFeatures_empty(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20601,6 +22969,7 @@ export function InvoiceFeatures_empty(): number { return nativeResponseValue; } // MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void); +/* @internal */ export function InvoiceFeatures_known(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20609,6 +22978,7 @@ export function InvoiceFeatures_known(): number { return nativeResponseValue; } // MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); +/* @internal */ export function InvoiceFeatures_requires_unknown_bits(this_arg: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20617,6 +22987,7 @@ export function InvoiceFeatures_requires_unknown_bits(this_arg: number): boolean return nativeResponseValue; } // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void); +/* @internal */ export function ChannelTypeFeatures_empty(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20625,6 +22996,7 @@ export function ChannelTypeFeatures_empty(): number { return nativeResponseValue; } // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void); +/* @internal */ export function ChannelTypeFeatures_known(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20633,6 +23005,7 @@ export function ChannelTypeFeatures_known(): number { return nativeResponseValue; } // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); +/* @internal */ export function ChannelTypeFeatures_requires_unknown_bits(this_arg: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20641,6 +23014,7 @@ export function ChannelTypeFeatures_requires_unknown_bits(this_arg: number): boo return nativeResponseValue; } // struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj); +/* @internal */ export function InitFeatures_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20649,6 +23023,7 @@ export function InitFeatures_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser); +/* @internal */ export function InitFeatures_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20657,6 +23032,7 @@ export function InitFeatures_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj); +/* @internal */ export function ChannelFeatures_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20665,6 +23041,7 @@ export function ChannelFeatures_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser); +/* @internal */ export function ChannelFeatures_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20673,6 +23050,7 @@ export function ChannelFeatures_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj); +/* @internal */ export function NodeFeatures_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20681,6 +23059,7 @@ export function NodeFeatures_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser); +/* @internal */ export function NodeFeatures_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20689,6 +23068,7 @@ export function NodeFeatures_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj); +/* @internal */ export function InvoiceFeatures_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20697,6 +23077,7 @@ export function InvoiceFeatures_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser); +/* @internal */ export function InvoiceFeatures_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20705,6 +23086,7 @@ export function InvoiceFeatures_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj); +/* @internal */ export function ChannelTypeFeatures_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20713,6 +23095,7 @@ export function ChannelTypeFeatures_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser); +/* @internal */ export function ChannelTypeFeatures_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20721,6 +23104,7 @@ export function ChannelTypeFeatures_read(ser: number): number { return nativeResponseValue; } // void ShutdownScript_free(struct LDKShutdownScript this_obj); +/* @internal */ export function ShutdownScript_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20729,6 +23113,7 @@ export function ShutdownScript_free(this_obj: number): void { // debug statements here } // uintptr_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg); +/* @internal */ export function ShutdownScript_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20737,6 +23122,7 @@ export function ShutdownScript_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig); +/* @internal */ export function ShutdownScript_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20745,6 +23131,7 @@ export function ShutdownScript_clone(orig: number): number { return nativeResponseValue; } // void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj); +/* @internal */ export function InvalidShutdownScript_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20753,6 +23140,7 @@ export function InvalidShutdownScript_free(this_obj: number): void { // debug statements here } // struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr); +/* @internal */ export function InvalidShutdownScript_get_script(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20761,6 +23149,7 @@ export function InvalidShutdownScript_get_script(this_ptr: number): number { return nativeResponseValue; } // void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); +/* @internal */ export function InvalidShutdownScript_set_script(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20769,6 +23158,7 @@ export function InvalidShutdownScript_set_script(this_ptr: number, val: number): // debug statements here } // MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg); +/* @internal */ export function InvalidShutdownScript_new(script_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20777,6 +23167,7 @@ export function InvalidShutdownScript_new(script_arg: number): number { return nativeResponseValue; } // uintptr_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg); +/* @internal */ export function InvalidShutdownScript_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20785,6 +23176,7 @@ export function InvalidShutdownScript_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig); +/* @internal */ export function InvalidShutdownScript_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20793,6 +23185,7 @@ export function InvalidShutdownScript_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj); +/* @internal */ export function ShutdownScript_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20801,6 +23194,7 @@ export function ShutdownScript_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser); +/* @internal */ export function ShutdownScript_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20809,6 +23203,7 @@ export function ShutdownScript_read(ser: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]); +/* @internal */ export function ShutdownScript_new_p2wpkh(pubkey_hash: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20817,6 +23212,7 @@ export function ShutdownScript_new_p2wpkh(pubkey_hash: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]); +/* @internal */ export function ShutdownScript_new_p2wsh(script_hash: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20825,6 +23221,7 @@ export function ShutdownScript_new_p2wsh(script_hash: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(uint8_t version, struct LDKu8slice program); +/* @internal */ export function ShutdownScript_new_witness_program(version: number, program: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20833,6 +23230,7 @@ export function ShutdownScript_new_witness_program(version: number, program: num return nativeResponseValue; } // MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg); +/* @internal */ export function ShutdownScript_into_inner(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20841,6 +23239,7 @@ export function ShutdownScript_into_inner(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg); +/* @internal */ export function ShutdownScript_as_legacy_pubkey(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20849,6 +23248,7 @@ export function ShutdownScript_as_legacy_pubkey(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features); +/* @internal */ export function ShutdownScript_is_compatible(this_arg: number, features: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20857,6 +23257,7 @@ export function ShutdownScript_is_compatible(this_arg: number, features: number) return nativeResponseValue; } // void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr); +/* @internal */ export function CustomMessageReader_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20865,6 +23266,7 @@ export function CustomMessageReader_free(this_ptr: number): void { // debug statements here } // uintptr_t Type_clone_ptr(LDKType *NONNULL_PTR arg); +/* @internal */ export function Type_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20873,6 +23275,7 @@ export function Type_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig); +/* @internal */ export function Type_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20881,6 +23284,7 @@ export function Type_clone(orig: number): number { return nativeResponseValue; } // void Type_free(struct LDKType this_ptr); +/* @internal */ export function Type_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20889,6 +23293,7 @@ export function Type_free(this_ptr: number): void { // debug statements here } // void NodeId_free(struct LDKNodeId this_obj); +/* @internal */ export function NodeId_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20897,6 +23302,7 @@ export function NodeId_free(this_obj: number): void { // debug statements here } // uintptr_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg); +/* @internal */ export function NodeId_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20905,6 +23311,7 @@ export function NodeId_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig); +/* @internal */ export function NodeId_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20913,6 +23320,7 @@ export function NodeId_clone(orig: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey); +/* @internal */ export function NodeId_from_pubkey(pubkey: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20921,6 +23329,7 @@ export function NodeId_from_pubkey(pubkey: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg); +/* @internal */ export function NodeId_as_slice(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20929,6 +23338,7 @@ export function NodeId_as_slice(this_arg: number): number { return nativeResponseValue; } // uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o); +/* @internal */ export function NodeId_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20937,6 +23347,7 @@ export function NodeId_hash(o: number): bigint { return nativeResponseValue; } // struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj); +/* @internal */ export function NodeId_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20945,6 +23356,7 @@ export function NodeId_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser); +/* @internal */ export function NodeId_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20953,6 +23365,7 @@ export function NodeId_read(ser: number): number { return nativeResponseValue; } // void NetworkGraph_free(struct LDKNetworkGraph this_obj); +/* @internal */ export function NetworkGraph_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20961,6 +23374,7 @@ export function NetworkGraph_free(this_obj: number): void { // debug statements here } // uintptr_t NetworkGraph_clone_ptr(LDKNetworkGraph *NONNULL_PTR arg); +/* @internal */ export function NetworkGraph_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20969,6 +23383,7 @@ export function NetworkGraph_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKNetworkGraph NetworkGraph_clone(const struct LDKNetworkGraph *NONNULL_PTR orig); +/* @internal */ export function NetworkGraph_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20977,6 +23392,7 @@ export function NetworkGraph_clone(orig: number): number { return nativeResponseValue; } // void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj); +/* @internal */ export function ReadOnlyNetworkGraph_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20985,6 +23401,7 @@ export function ReadOnlyNetworkGraph_free(this_obj: number): void { // debug statements here } // void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr); +/* @internal */ export function NetworkUpdate_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -20993,6 +23410,7 @@ export function NetworkUpdate_free(this_ptr: number): void { // debug statements here } // uintptr_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg); +/* @internal */ export function NetworkUpdate_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21001,6 +23419,7 @@ export function NetworkUpdate_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig); +/* @internal */ export function NetworkUpdate_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21009,6 +23428,7 @@ export function NetworkUpdate_clone(orig: number): number { return nativeResponseValue; } // struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg); +/* @internal */ export function NetworkUpdate_channel_update_message(msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21017,6 +23437,7 @@ export function NetworkUpdate_channel_update_message(msg: number): number { return nativeResponseValue; } // struct LDKNetworkUpdate NetworkUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent); +/* @internal */ export function NetworkUpdate_channel_closed(short_channel_id: bigint, is_permanent: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21025,6 +23446,7 @@ export function NetworkUpdate_channel_closed(short_channel_id: bigint, is_perman return nativeResponseValue; } // struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent); +/* @internal */ export function NetworkUpdate_node_failure(node_id: number, is_permanent: boolean): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21033,6 +23455,7 @@ export function NetworkUpdate_node_failure(node_id: number, is_permanent: boolea return nativeResponseValue; } // struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj); +/* @internal */ export function NetworkUpdate_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21041,6 +23464,7 @@ export function NetworkUpdate_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser); +/* @internal */ export function NetworkUpdate_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21049,6 +23473,7 @@ export function NetworkUpdate_read(ser: number): number { return nativeResponseValue; } // struct LDKEventHandler NetGraphMsgHandler_as_EventHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); +/* @internal */ export function NetGraphMsgHandler_as_EventHandler(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21057,6 +23482,7 @@ export function NetGraphMsgHandler_as_EventHandler(this_arg: number): number { return nativeResponseValue; } // void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_obj); +/* @internal */ export function NetGraphMsgHandler_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21065,6 +23491,7 @@ export function NetGraphMsgHandler_free(this_obj: number): void { // debug statements here } // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger); +/* @internal */ export function NetGraphMsgHandler_new(network_graph: number, chain_access: number, logger: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21073,6 +23500,7 @@ export function NetGraphMsgHandler_new(network_graph: number, chain_access: numb return nativeResponseValue; } // void NetGraphMsgHandler_add_chain_access(struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access); +/* @internal */ export function NetGraphMsgHandler_add_chain_access(this_arg: number, chain_access: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21081,6 +23509,7 @@ export function NetGraphMsgHandler_add_chain_access(this_arg: number, chain_acce // debug statements here } // struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); +/* @internal */ export function NetGraphMsgHandler_as_RoutingMessageHandler(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21089,6 +23518,7 @@ export function NetGraphMsgHandler_as_RoutingMessageHandler(this_arg: number): n return nativeResponseValue; } // struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); +/* @internal */ export function NetGraphMsgHandler_as_MessageSendEventsProvider(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21097,6 +23527,7 @@ export function NetGraphMsgHandler_as_MessageSendEventsProvider(this_arg: number return nativeResponseValue; } // void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_obj); +/* @internal */ export function DirectionalChannelInfo_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21105,6 +23536,7 @@ export function DirectionalChannelInfo_free(this_obj: number): void { // debug statements here } // uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function DirectionalChannelInfo_get_last_update(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21113,6 +23545,7 @@ export function DirectionalChannelInfo_get_last_update(this_ptr: number): number return nativeResponseValue; } // void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function DirectionalChannelInfo_set_last_update(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21121,6 +23554,7 @@ export function DirectionalChannelInfo_set_last_update(this_ptr: number, val: nu // debug statements here } // bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function DirectionalChannelInfo_get_enabled(this_ptr: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21129,6 +23563,7 @@ export function DirectionalChannelInfo_get_enabled(this_ptr: number): boolean { return nativeResponseValue; } // void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val); +/* @internal */ export function DirectionalChannelInfo_set_enabled(this_ptr: number, val: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21137,6 +23572,7 @@ export function DirectionalChannelInfo_set_enabled(this_ptr: number, val: boolea // debug statements here } // uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21145,6 +23581,7 @@ export function DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr: number): return nativeResponseValue; } // void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21153,6 +23590,7 @@ export function DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr: number, v // debug statements here } // uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21161,6 +23599,7 @@ export function DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr: number): return nativeResponseValue; } // void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21169,6 +23608,7 @@ export function DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr: number, v // debug statements here } // struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function DirectionalChannelInfo_get_htlc_maximum_msat(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21177,6 +23617,7 @@ export function DirectionalChannelInfo_get_htlc_maximum_msat(this_ptr: number): return nativeResponseValue; } // void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); +/* @internal */ export function DirectionalChannelInfo_set_htlc_maximum_msat(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21185,6 +23626,7 @@ export function DirectionalChannelInfo_set_htlc_maximum_msat(this_ptr: number, v // debug statements here } // struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function DirectionalChannelInfo_get_fees(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21193,6 +23635,7 @@ export function DirectionalChannelInfo_get_fees(this_ptr: number): number { return nativeResponseValue; } // void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val); +/* @internal */ export function DirectionalChannelInfo_set_fees(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21201,6 +23644,7 @@ export function DirectionalChannelInfo_set_fees(this_ptr: number, val: number): // debug statements here } // struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function DirectionalChannelInfo_get_last_update_message(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21209,6 +23653,7 @@ export function DirectionalChannelInfo_get_last_update_message(this_ptr: number) return nativeResponseValue; } // void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val); +/* @internal */ export function DirectionalChannelInfo_set_last_update_message(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21217,6 +23662,7 @@ export function DirectionalChannelInfo_set_last_update_message(this_ptr: number, // debug statements here } // MUST_USE_RES struct LDKDirectionalChannelInfo DirectionalChannelInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg); +/* @internal */ export function DirectionalChannelInfo_new(last_update_arg: number, enabled_arg: boolean, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: bigint, htlc_maximum_msat_arg: number, fees_arg: number, last_update_message_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21225,6 +23671,7 @@ export function DirectionalChannelInfo_new(last_update_arg: number, enabled_arg: return nativeResponseValue; } // uintptr_t DirectionalChannelInfo_clone_ptr(LDKDirectionalChannelInfo *NONNULL_PTR arg); +/* @internal */ export function DirectionalChannelInfo_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21233,6 +23680,7 @@ export function DirectionalChannelInfo_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKDirectionalChannelInfo DirectionalChannelInfo_clone(const struct LDKDirectionalChannelInfo *NONNULL_PTR orig); +/* @internal */ export function DirectionalChannelInfo_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21241,6 +23689,7 @@ export function DirectionalChannelInfo_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj); +/* @internal */ export function DirectionalChannelInfo_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21249,6 +23698,7 @@ export function DirectionalChannelInfo_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_DirectionalChannelInfoDecodeErrorZ DirectionalChannelInfo_read(struct LDKu8slice ser); +/* @internal */ export function DirectionalChannelInfo_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21257,6 +23707,7 @@ export function DirectionalChannelInfo_read(ser: number): number { return nativeResponseValue; } // void ChannelInfo_free(struct LDKChannelInfo this_obj); +/* @internal */ export function ChannelInfo_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21265,6 +23716,7 @@ export function ChannelInfo_free(this_obj: number): void { // debug statements here } // struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelInfo_get_features(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21273,6 +23725,7 @@ export function ChannelInfo_get_features(this_ptr: number): number { return nativeResponseValue; } // void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); +/* @internal */ export function ChannelInfo_set_features(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21281,6 +23734,7 @@ export function ChannelInfo_set_features(this_ptr: number, val: number): void { // debug statements here } // struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelInfo_get_node_one(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21289,6 +23743,7 @@ export function ChannelInfo_get_node_one(this_ptr: number): number { return nativeResponseValue; } // void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val); +/* @internal */ export function ChannelInfo_set_node_one(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21297,6 +23752,7 @@ export function ChannelInfo_set_node_one(this_ptr: number, val: number): void { // debug statements here } // struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelInfo_get_one_to_two(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21305,6 +23761,7 @@ export function ChannelInfo_get_one_to_two(this_ptr: number): number { return nativeResponseValue; } // void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val); +/* @internal */ export function ChannelInfo_set_one_to_two(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21313,6 +23770,7 @@ export function ChannelInfo_set_one_to_two(this_ptr: number, val: number): void // debug statements here } // struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelInfo_get_node_two(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21321,6 +23779,7 @@ export function ChannelInfo_get_node_two(this_ptr: number): number { return nativeResponseValue; } // void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val); +/* @internal */ export function ChannelInfo_set_node_two(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21329,6 +23788,7 @@ export function ChannelInfo_set_node_two(this_ptr: number, val: number): void { // debug statements here } // struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelInfo_get_two_to_one(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21337,6 +23797,7 @@ export function ChannelInfo_get_two_to_one(this_ptr: number): number { return nativeResponseValue; } // void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val); +/* @internal */ export function ChannelInfo_set_two_to_one(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21345,6 +23806,7 @@ export function ChannelInfo_set_two_to_one(this_ptr: number, val: number): void // debug statements here } // struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelInfo_get_capacity_sats(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21353,6 +23815,7 @@ export function ChannelInfo_get_capacity_sats(this_ptr: number): number { return nativeResponseValue; } // void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); +/* @internal */ export function ChannelInfo_set_capacity_sats(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21361,6 +23824,7 @@ export function ChannelInfo_set_capacity_sats(this_ptr: number, val: number): vo // debug statements here } // struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr); +/* @internal */ export function ChannelInfo_get_announcement_message(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21369,6 +23833,7 @@ export function ChannelInfo_get_announcement_message(this_ptr: number): number { return nativeResponseValue; } // void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val); +/* @internal */ export function ChannelInfo_set_announcement_message(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21377,6 +23842,7 @@ export function ChannelInfo_set_announcement_message(this_ptr: number, val: numb // debug statements here } // uintptr_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg); +/* @internal */ export function ChannelInfo_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21385,6 +23851,7 @@ export function ChannelInfo_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig); +/* @internal */ export function ChannelInfo_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21393,6 +23860,7 @@ export function ChannelInfo_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj); +/* @internal */ export function ChannelInfo_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21401,6 +23869,7 @@ export function ChannelInfo_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser); +/* @internal */ export function ChannelInfo_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21409,6 +23878,7 @@ export function ChannelInfo_read(ser: number): number { return nativeResponseValue; } // void RoutingFees_free(struct LDKRoutingFees this_obj); +/* @internal */ export function RoutingFees_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21417,6 +23887,7 @@ export function RoutingFees_free(this_obj: number): void { // debug statements here } // uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr); +/* @internal */ export function RoutingFees_get_base_msat(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21425,6 +23896,7 @@ export function RoutingFees_get_base_msat(this_ptr: number): number { return nativeResponseValue; } // void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function RoutingFees_set_base_msat(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21433,6 +23905,7 @@ export function RoutingFees_set_base_msat(this_ptr: number, val: number): void { // debug statements here } // uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr); +/* @internal */ export function RoutingFees_get_proportional_millionths(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21441,6 +23914,7 @@ export function RoutingFees_get_proportional_millionths(this_ptr: number): numbe return nativeResponseValue; } // void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function RoutingFees_set_proportional_millionths(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21449,6 +23923,7 @@ export function RoutingFees_set_proportional_millionths(this_ptr: number, val: n // debug statements here } // MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg); +/* @internal */ export function RoutingFees_new(base_msat_arg: number, proportional_millionths_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21457,6 +23932,7 @@ export function RoutingFees_new(base_msat_arg: number, proportional_millionths_a return nativeResponseValue; } // bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b); +/* @internal */ export function RoutingFees_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21465,6 +23941,7 @@ export function RoutingFees_eq(a: number, b: number): boolean { return nativeResponseValue; } // uintptr_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg); +/* @internal */ export function RoutingFees_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21473,6 +23950,7 @@ export function RoutingFees_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig); +/* @internal */ export function RoutingFees_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21481,6 +23959,7 @@ export function RoutingFees_clone(orig: number): number { return nativeResponseValue; } // uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o); +/* @internal */ export function RoutingFees_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21489,6 +23968,7 @@ export function RoutingFees_hash(o: number): bigint { return nativeResponseValue; } // struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj); +/* @internal */ export function RoutingFees_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21497,6 +23977,7 @@ export function RoutingFees_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser); +/* @internal */ export function RoutingFees_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21505,6 +23986,7 @@ export function RoutingFees_read(ser: number): number { return nativeResponseValue; } // void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj); +/* @internal */ export function NodeAnnouncementInfo_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21513,6 +23995,7 @@ export function NodeAnnouncementInfo_free(this_obj: number): void { // debug statements here } // struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); +/* @internal */ export function NodeAnnouncementInfo_get_features(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21521,6 +24004,7 @@ export function NodeAnnouncementInfo_get_features(this_ptr: number): number { return nativeResponseValue; } // void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); +/* @internal */ export function NodeAnnouncementInfo_set_features(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21529,6 +24013,7 @@ export function NodeAnnouncementInfo_set_features(this_ptr: number, val: number) // debug statements here } // uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); +/* @internal */ export function NodeAnnouncementInfo_get_last_update(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21537,6 +24022,7 @@ export function NodeAnnouncementInfo_get_last_update(this_ptr: number): number { return nativeResponseValue; } // void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function NodeAnnouncementInfo_set_last_update(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21545,6 +24031,7 @@ export function NodeAnnouncementInfo_set_last_update(this_ptr: number, val: numb // debug statements here } // const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3]; +/* @internal */ export function NodeAnnouncementInfo_get_rgb(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21553,6 +24040,7 @@ export function NodeAnnouncementInfo_get_rgb(this_ptr: number): number { return nativeResponseValue; } // void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val); +/* @internal */ export function NodeAnnouncementInfo_set_rgb(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21561,6 +24049,7 @@ export function NodeAnnouncementInfo_set_rgb(this_ptr: number, val: number): voi // debug statements here } // const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32]; +/* @internal */ export function NodeAnnouncementInfo_get_alias(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21569,6 +24058,7 @@ export function NodeAnnouncementInfo_get_alias(this_ptr: number): number { return nativeResponseValue; } // void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/* @internal */ export function NodeAnnouncementInfo_set_alias(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21577,6 +24067,7 @@ export function NodeAnnouncementInfo_set_alias(this_ptr: number, val: number): v // debug statements here } // void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val); +/* @internal */ export function NodeAnnouncementInfo_set_addresses(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21585,6 +24076,7 @@ export function NodeAnnouncementInfo_set_addresses(this_ptr: number, val: number // debug statements here } // struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); +/* @internal */ export function NodeAnnouncementInfo_get_announcement_message(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21593,6 +24085,7 @@ export function NodeAnnouncementInfo_get_announcement_message(this_ptr: number): return nativeResponseValue; } // void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val); +/* @internal */ export function NodeAnnouncementInfo_set_announcement_message(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21601,6 +24094,7 @@ export function NodeAnnouncementInfo_set_announcement_message(this_ptr: number, // debug statements here } // MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg); +/* @internal */ export function NodeAnnouncementInfo_new(features_arg: number, last_update_arg: number, rgb_arg: number, alias_arg: number, addresses_arg: number, announcement_message_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21609,6 +24103,7 @@ export function NodeAnnouncementInfo_new(features_arg: number, last_update_arg: return nativeResponseValue; } // uintptr_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg); +/* @internal */ export function NodeAnnouncementInfo_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21617,6 +24112,7 @@ export function NodeAnnouncementInfo_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig); +/* @internal */ export function NodeAnnouncementInfo_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21625,6 +24121,7 @@ export function NodeAnnouncementInfo_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj); +/* @internal */ export function NodeAnnouncementInfo_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21633,6 +24130,7 @@ export function NodeAnnouncementInfo_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser); +/* @internal */ export function NodeAnnouncementInfo_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21641,6 +24139,7 @@ export function NodeAnnouncementInfo_read(ser: number): number { return nativeResponseValue; } // void NodeInfo_free(struct LDKNodeInfo this_obj); +/* @internal */ export function NodeInfo_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21649,6 +24148,7 @@ export function NodeInfo_free(this_obj: number): void { // debug statements here } // void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); +/* @internal */ export function NodeInfo_set_channels(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21657,6 +24157,7 @@ export function NodeInfo_set_channels(this_ptr: number, val: number): void { // debug statements here } // struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr); +/* @internal */ export function NodeInfo_get_lowest_inbound_channel_fees(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21665,6 +24166,7 @@ export function NodeInfo_get_lowest_inbound_channel_fees(this_ptr: number): numb return nativeResponseValue; } // void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val); +/* @internal */ export function NodeInfo_set_lowest_inbound_channel_fees(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21673,6 +24175,7 @@ export function NodeInfo_set_lowest_inbound_channel_fees(this_ptr: number, val: // debug statements here } // struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr); +/* @internal */ export function NodeInfo_get_announcement_info(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21681,6 +24184,7 @@ export function NodeInfo_get_announcement_info(this_ptr: number): number { return nativeResponseValue; } // void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val); +/* @internal */ export function NodeInfo_set_announcement_info(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21689,6 +24193,7 @@ export function NodeInfo_set_announcement_info(this_ptr: number, val: number): v // debug statements here } // MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg); +/* @internal */ export function NodeInfo_new(channels_arg: number, lowest_inbound_channel_fees_arg: number, announcement_info_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21697,6 +24202,7 @@ export function NodeInfo_new(channels_arg: number, lowest_inbound_channel_fees_a return nativeResponseValue; } // uintptr_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg); +/* @internal */ export function NodeInfo_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21705,6 +24211,7 @@ export function NodeInfo_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig); +/* @internal */ export function NodeInfo_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21713,6 +24220,7 @@ export function NodeInfo_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj); +/* @internal */ export function NodeInfo_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21721,6 +24229,7 @@ export function NodeInfo_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser); +/* @internal */ export function NodeInfo_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21729,6 +24238,7 @@ export function NodeInfo_read(ser: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj); +/* @internal */ export function NetworkGraph_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21737,6 +24247,7 @@ export function NetworkGraph_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser); +/* @internal */ export function NetworkGraph_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21745,6 +24256,7 @@ export function NetworkGraph_read(ser: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash); +/* @internal */ export function NetworkGraph_new(genesis_hash: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21753,6 +24265,7 @@ export function NetworkGraph_new(genesis_hash: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg); +/* @internal */ export function NetworkGraph_read_only(this_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21761,6 +24274,7 @@ export function NetworkGraph_read_only(this_arg: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg); +/* @internal */ export function NetworkGraph_update_node_from_announcement(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21769,6 +24283,7 @@ export function NetworkGraph_update_node_from_announcement(this_arg: number, msg return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg); +/* @internal */ export function NetworkGraph_update_node_from_unsigned_announcement(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21777,6 +24292,7 @@ export function NetworkGraph_update_node_from_unsigned_announcement(this_arg: nu return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_AccessZ chain_access); +/* @internal */ export function NetworkGraph_update_channel_from_announcement(this_arg: number, msg: number, chain_access: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21785,6 +24301,7 @@ export function NetworkGraph_update_channel_from_announcement(this_arg: number, return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKCOption_AccessZ chain_access); +/* @internal */ export function NetworkGraph_update_channel_from_unsigned_announcement(this_arg: number, msg: number, chain_access: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21793,6 +24310,7 @@ export function NetworkGraph_update_channel_from_unsigned_announcement(this_arg: return nativeResponseValue; } // void NetworkGraph_close_channel_from_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent); +/* @internal */ export function NetworkGraph_close_channel_from_update(this_arg: number, short_channel_id: bigint, is_permanent: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21801,6 +24319,7 @@ export function NetworkGraph_close_channel_from_update(this_arg: number, short_c // debug statements here } // void NetworkGraph_fail_node(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent); +/* @internal */ export function NetworkGraph_fail_node(this_arg: number, _node_id: number, is_permanent: boolean): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21809,6 +24328,7 @@ export function NetworkGraph_fail_node(this_arg: number, _node_id: number, is_pe // debug statements here } // void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix); +/* @internal */ export function NetworkGraph_remove_stale_channels_with_time(this_arg: number, current_time_unix: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21817,6 +24337,7 @@ export function NetworkGraph_remove_stale_channels_with_time(this_arg: number, c // debug statements here } // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg); +/* @internal */ export function NetworkGraph_update_channel(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21825,6 +24346,7 @@ export function NetworkGraph_update_channel(this_arg: number, msg: number): numb return nativeResponseValue; } // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg); +/* @internal */ export function NetworkGraph_update_channel_unsigned(this_arg: number, msg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21833,6 +24355,7 @@ export function NetworkGraph_update_channel_unsigned(this_arg: number, msg: numb return nativeResponseValue; } // MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey); +/* @internal */ export function ReadOnlyNetworkGraph_get_addresses(this_arg: number, pubkey: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21841,6 +24364,7 @@ export function ReadOnlyNetworkGraph_get_addresses(this_arg: number, pubkey: num return nativeResponseValue; } // void RouteHop_free(struct LDKRouteHop this_obj); +/* @internal */ export function RouteHop_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21849,6 +24373,7 @@ export function RouteHop_free(this_obj: number): void { // debug statements here } // struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHop_get_pubkey(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21857,6 +24382,7 @@ export function RouteHop_get_pubkey(this_ptr: number): number { return nativeResponseValue; } // void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function RouteHop_set_pubkey(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21865,6 +24391,7 @@ export function RouteHop_set_pubkey(this_ptr: number, val: number): void { // debug statements here } // struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHop_get_node_features(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21873,6 +24400,7 @@ export function RouteHop_get_node_features(this_ptr: number): number { return nativeResponseValue; } // void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); +/* @internal */ export function RouteHop_set_node_features(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21881,6 +24409,7 @@ export function RouteHop_set_node_features(this_ptr: number, val: number): void // debug statements here } // uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHop_get_short_channel_id(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21889,6 +24418,7 @@ export function RouteHop_get_short_channel_id(this_ptr: number): bigint { return nativeResponseValue; } // void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function RouteHop_set_short_channel_id(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21897,6 +24427,7 @@ export function RouteHop_set_short_channel_id(this_ptr: number, val: bigint): vo // debug statements here } // struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHop_get_channel_features(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21905,6 +24436,7 @@ export function RouteHop_get_channel_features(this_ptr: number): number { return nativeResponseValue; } // void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); +/* @internal */ export function RouteHop_set_channel_features(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21913,6 +24445,7 @@ export function RouteHop_set_channel_features(this_ptr: number, val: number): vo // debug statements here } // uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHop_get_fee_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21921,6 +24454,7 @@ export function RouteHop_get_fee_msat(this_ptr: number): bigint { return nativeResponseValue; } // void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function RouteHop_set_fee_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21929,6 +24463,7 @@ export function RouteHop_set_fee_msat(this_ptr: number, val: bigint): void { // debug statements here } // uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHop_get_cltv_expiry_delta(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21937,6 +24472,7 @@ export function RouteHop_get_cltv_expiry_delta(this_ptr: number): number { return nativeResponseValue; } // void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function RouteHop_set_cltv_expiry_delta(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21945,6 +24481,7 @@ export function RouteHop_set_cltv_expiry_delta(this_ptr: number, val: number): v // debug statements here } // MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg); +/* @internal */ export function RouteHop_new(pubkey_arg: number, node_features_arg: number, short_channel_id_arg: bigint, channel_features_arg: number, fee_msat_arg: bigint, cltv_expiry_delta_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21953,6 +24490,7 @@ export function RouteHop_new(pubkey_arg: number, node_features_arg: number, shor return nativeResponseValue; } // uintptr_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg); +/* @internal */ export function RouteHop_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21961,6 +24499,7 @@ export function RouteHop_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig); +/* @internal */ export function RouteHop_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21969,6 +24508,7 @@ export function RouteHop_clone(orig: number): number { return nativeResponseValue; } // uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o); +/* @internal */ export function RouteHop_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21977,6 +24517,7 @@ export function RouteHop_hash(o: number): bigint { return nativeResponseValue; } // bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b); +/* @internal */ export function RouteHop_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21985,6 +24526,7 @@ export function RouteHop_eq(a: number, b: number): boolean { return nativeResponseValue; } // struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj); +/* @internal */ export function RouteHop_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -21993,6 +24535,7 @@ export function RouteHop_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser); +/* @internal */ export function RouteHop_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22001,6 +24544,7 @@ export function RouteHop_read(ser: number): number { return nativeResponseValue; } // void Route_free(struct LDKRoute this_obj); +/* @internal */ export function Route_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22009,6 +24553,7 @@ export function Route_free(this_obj: number): void { // debug statements here } // struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr); +/* @internal */ export function Route_get_paths(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22017,6 +24562,7 @@ export function Route_get_paths(this_ptr: number): number { return nativeResponseValue; } // void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val); +/* @internal */ export function Route_set_paths(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22025,6 +24571,7 @@ export function Route_set_paths(this_ptr: number, val: number): void { // debug statements here } // struct LDKPayee Route_get_payee(const struct LDKRoute *NONNULL_PTR this_ptr); +/* @internal */ export function Route_get_payee(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22033,6 +24580,7 @@ export function Route_get_payee(this_ptr: number): number { return nativeResponseValue; } // void Route_set_payee(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPayee val); +/* @internal */ export function Route_set_payee(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22041,6 +24589,7 @@ export function Route_set_payee(this_ptr: number, val: number): void { // debug statements here } // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPayee payee_arg); +/* @internal */ export function Route_new(paths_arg: number, payee_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22049,6 +24598,7 @@ export function Route_new(paths_arg: number, payee_arg: number): number { return nativeResponseValue; } // uintptr_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg); +/* @internal */ export function Route_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22057,6 +24607,7 @@ export function Route_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig); +/* @internal */ export function Route_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22065,6 +24616,7 @@ export function Route_clone(orig: number): number { return nativeResponseValue; } // uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o); +/* @internal */ export function Route_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22073,6 +24625,7 @@ export function Route_hash(o: number): bigint { return nativeResponseValue; } // bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b); +/* @internal */ export function Route_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22081,6 +24634,7 @@ export function Route_eq(a: number, b: number): boolean { return nativeResponseValue; } // MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg); +/* @internal */ export function Route_get_total_fees(this_arg: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22089,6 +24643,7 @@ export function Route_get_total_fees(this_arg: number): bigint { return nativeResponseValue; } // MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg); +/* @internal */ export function Route_get_total_amount(this_arg: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22097,6 +24652,7 @@ export function Route_get_total_amount(this_arg: number): bigint { return nativeResponseValue; } // struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj); +/* @internal */ export function Route_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22105,6 +24661,7 @@ export function Route_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser); +/* @internal */ export function Route_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22113,6 +24670,7 @@ export function Route_read(ser: number): number { return nativeResponseValue; } // void RouteParameters_free(struct LDKRouteParameters this_obj); +/* @internal */ export function RouteParameters_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22121,6 +24679,7 @@ export function RouteParameters_free(this_obj: number): void { // debug statements here } // struct LDKPayee RouteParameters_get_payee(const struct LDKRouteParameters *NONNULL_PTR this_ptr); +/* @internal */ export function RouteParameters_get_payee(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22129,6 +24688,7 @@ export function RouteParameters_get_payee(this_ptr: number): number { return nativeResponseValue; } // void RouteParameters_set_payee(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPayee val); +/* @internal */ export function RouteParameters_set_payee(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22137,6 +24697,7 @@ export function RouteParameters_set_payee(this_ptr: number, val: number): void { // debug statements here } // uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr); +/* @internal */ export function RouteParameters_get_final_value_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22145,6 +24706,7 @@ export function RouteParameters_get_final_value_msat(this_ptr: number): bigint { return nativeResponseValue; } // void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function RouteParameters_set_final_value_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22153,6 +24715,7 @@ export function RouteParameters_set_final_value_msat(this_ptr: number, val: bigi // debug statements here } // uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr); +/* @internal */ export function RouteParameters_get_final_cltv_expiry_delta(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22161,6 +24724,7 @@ export function RouteParameters_get_final_cltv_expiry_delta(this_ptr: number): n return nativeResponseValue; } // void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val); +/* @internal */ export function RouteParameters_set_final_cltv_expiry_delta(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22169,6 +24733,7 @@ export function RouteParameters_set_final_cltv_expiry_delta(this_ptr: number, va // debug statements here } // MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPayee payee_arg, uint64_t final_value_msat_arg, uint32_t final_cltv_expiry_delta_arg); +/* @internal */ export function RouteParameters_new(payee_arg: number, final_value_msat_arg: bigint, final_cltv_expiry_delta_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22177,6 +24742,7 @@ export function RouteParameters_new(payee_arg: number, final_value_msat_arg: big return nativeResponseValue; } // uintptr_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg); +/* @internal */ export function RouteParameters_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22185,6 +24751,7 @@ export function RouteParameters_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig); +/* @internal */ export function RouteParameters_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22193,6 +24760,7 @@ export function RouteParameters_clone(orig: number): number { return nativeResponseValue; } // struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj); +/* @internal */ export function RouteParameters_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22201,6 +24769,7 @@ export function RouteParameters_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser); +/* @internal */ export function RouteParameters_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22209,6 +24778,7 @@ export function RouteParameters_read(ser: number): number { return nativeResponseValue; } // void Payee_free(struct LDKPayee this_obj); +/* @internal */ export function Payee_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22217,6 +24787,7 @@ export function Payee_free(this_obj: number): void { // debug statements here } // struct LDKPublicKey Payee_get_pubkey(const struct LDKPayee *NONNULL_PTR this_ptr); +/* @internal */ export function Payee_get_pubkey(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22225,6 +24796,7 @@ export function Payee_get_pubkey(this_ptr: number): number { return nativeResponseValue; } // void Payee_set_pubkey(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function Payee_set_pubkey(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22233,6 +24805,7 @@ export function Payee_set_pubkey(this_ptr: number, val: number): void { // debug statements here } // struct LDKInvoiceFeatures Payee_get_features(const struct LDKPayee *NONNULL_PTR this_ptr); +/* @internal */ export function Payee_get_features(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22241,6 +24814,7 @@ export function Payee_get_features(this_ptr: number): number { return nativeResponseValue; } // void Payee_set_features(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val); +/* @internal */ export function Payee_set_features(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22249,6 +24823,7 @@ export function Payee_set_features(this_ptr: number, val: number): void { // debug statements here } // struct LDKCVec_RouteHintZ Payee_get_route_hints(const struct LDKPayee *NONNULL_PTR this_ptr); +/* @internal */ export function Payee_get_route_hints(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22257,6 +24832,7 @@ export function Payee_get_route_hints(this_ptr: number): number { return nativeResponseValue; } // void Payee_set_route_hints(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val); +/* @internal */ export function Payee_set_route_hints(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22265,6 +24841,7 @@ export function Payee_set_route_hints(this_ptr: number, val: number): void { // debug statements here } // struct LDKCOption_u64Z Payee_get_expiry_time(const struct LDKPayee *NONNULL_PTR this_ptr); +/* @internal */ export function Payee_get_expiry_time(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22273,6 +24850,7 @@ export function Payee_get_expiry_time(this_ptr: number): number { return nativeResponseValue; } // void Payee_set_expiry_time(struct LDKPayee *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); +/* @internal */ export function Payee_set_expiry_time(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22281,6 +24859,7 @@ export function Payee_set_expiry_time(this_ptr: number, val: number): void { // debug statements here } // MUST_USE_RES struct LDKPayee Payee_new(struct LDKPublicKey pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_arg, struct LDKCOption_u64Z expiry_time_arg); +/* @internal */ export function Payee_new(pubkey_arg: number, features_arg: number, route_hints_arg: number, expiry_time_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22289,6 +24868,7 @@ export function Payee_new(pubkey_arg: number, features_arg: number, route_hints_ return nativeResponseValue; } // uintptr_t Payee_clone_ptr(LDKPayee *NONNULL_PTR arg); +/* @internal */ export function Payee_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22297,6 +24877,7 @@ export function Payee_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig); +/* @internal */ export function Payee_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22305,6 +24886,7 @@ export function Payee_clone(orig: number): number { return nativeResponseValue; } // uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o); +/* @internal */ export function Payee_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22313,6 +24895,7 @@ export function Payee_hash(o: number): bigint { return nativeResponseValue; } // bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b); +/* @internal */ export function Payee_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22321,6 +24904,7 @@ export function Payee_eq(a: number, b: number): boolean { return nativeResponseValue; } // struct LDKCVec_u8Z Payee_write(const struct LDKPayee *NONNULL_PTR obj); +/* @internal */ export function Payee_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22329,6 +24913,7 @@ export function Payee_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_PayeeDecodeErrorZ Payee_read(struct LDKu8slice ser); +/* @internal */ export function Payee_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22337,6 +24922,7 @@ export function Payee_read(ser: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKPayee Payee_from_node_id(struct LDKPublicKey pubkey); +/* @internal */ export function Payee_from_node_id(pubkey: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22345,6 +24931,7 @@ export function Payee_from_node_id(pubkey: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKPayee Payee_for_keysend(struct LDKPublicKey pubkey); +/* @internal */ export function Payee_for_keysend(pubkey: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22353,6 +24940,7 @@ export function Payee_for_keysend(pubkey: number): number { return nativeResponseValue; } // void RouteHint_free(struct LDKRouteHint this_obj); +/* @internal */ export function RouteHint_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22361,6 +24949,7 @@ export function RouteHint_free(this_obj: number): void { // debug statements here } // struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHint_get_a(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22369,6 +24958,7 @@ export function RouteHint_get_a(this_ptr: number): number { return nativeResponseValue; } // void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val); +/* @internal */ export function RouteHint_set_a(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22377,6 +24967,7 @@ export function RouteHint_set_a(this_ptr: number, val: number): void { // debug statements here } // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg); +/* @internal */ export function RouteHint_new(a_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22385,6 +24976,7 @@ export function RouteHint_new(a_arg: number): number { return nativeResponseValue; } // uintptr_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg); +/* @internal */ export function RouteHint_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22393,6 +24985,7 @@ export function RouteHint_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); +/* @internal */ export function RouteHint_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22401,6 +24994,7 @@ export function RouteHint_clone(orig: number): number { return nativeResponseValue; } // uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o); +/* @internal */ export function RouteHint_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22409,6 +25003,7 @@ export function RouteHint_hash(o: number): bigint { return nativeResponseValue; } // bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b); +/* @internal */ export function RouteHint_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22417,6 +25012,7 @@ export function RouteHint_eq(a: number, b: number): boolean { return nativeResponseValue; } // struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj); +/* @internal */ export function RouteHint_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22425,6 +25021,7 @@ export function RouteHint_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser); +/* @internal */ export function RouteHint_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22433,6 +25030,7 @@ export function RouteHint_read(ser: number): number { return nativeResponseValue; } // void RouteHintHop_free(struct LDKRouteHintHop this_obj); +/* @internal */ export function RouteHintHop_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22441,6 +25039,7 @@ export function RouteHintHop_free(this_obj: number): void { // debug statements here } // struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHintHop_get_src_node_id(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22449,6 +25048,7 @@ export function RouteHintHop_get_src_node_id(this_ptr: number): number { return nativeResponseValue; } // void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); +/* @internal */ export function RouteHintHop_set_src_node_id(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22457,6 +25057,7 @@ export function RouteHintHop_set_src_node_id(this_ptr: number, val: number): voi // debug statements here } // uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHintHop_get_short_channel_id(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22465,6 +25066,7 @@ export function RouteHintHop_get_short_channel_id(this_ptr: number): bigint { return nativeResponseValue; } // void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function RouteHintHop_set_short_channel_id(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22473,6 +25075,7 @@ export function RouteHintHop_set_short_channel_id(this_ptr: number, val: bigint) // debug statements here } // struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHintHop_get_fees(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22481,6 +25084,7 @@ export function RouteHintHop_get_fees(this_ptr: number): number { return nativeResponseValue; } // void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val); +/* @internal */ export function RouteHintHop_set_fees(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22489,6 +25093,7 @@ export function RouteHintHop_set_fees(this_ptr: number, val: number): void { // debug statements here } // uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHintHop_get_cltv_expiry_delta(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22497,6 +25102,7 @@ export function RouteHintHop_get_cltv_expiry_delta(this_ptr: number): number { return nativeResponseValue; } // void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function RouteHintHop_set_cltv_expiry_delta(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22505,6 +25111,7 @@ export function RouteHintHop_set_cltv_expiry_delta(this_ptr: number, val: number // debug statements here } // struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHintHop_get_htlc_minimum_msat(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22513,6 +25120,7 @@ export function RouteHintHop_get_htlc_minimum_msat(this_ptr: number): number { return nativeResponseValue; } // void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); +/* @internal */ export function RouteHintHop_set_htlc_minimum_msat(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22521,6 +25129,7 @@ export function RouteHintHop_set_htlc_minimum_msat(this_ptr: number, val: number // debug statements here } // struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr); +/* @internal */ export function RouteHintHop_get_htlc_maximum_msat(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22529,6 +25138,7 @@ export function RouteHintHop_get_htlc_maximum_msat(this_ptr: number): number { return nativeResponseValue; } // void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); +/* @internal */ export function RouteHintHop_set_htlc_maximum_msat(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22537,6 +25147,7 @@ export function RouteHintHop_set_htlc_maximum_msat(this_ptr: number, val: number // debug statements here } // MUST_USE_RES struct LDKRouteHintHop RouteHintHop_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg); +/* @internal */ export function RouteHintHop_new(src_node_id_arg: number, short_channel_id_arg: bigint, fees_arg: number, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: number, htlc_maximum_msat_arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22545,6 +25156,7 @@ export function RouteHintHop_new(src_node_id_arg: number, short_channel_id_arg: return nativeResponseValue; } // uintptr_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg); +/* @internal */ export function RouteHintHop_clone_ptr(arg: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22553,6 +25165,7 @@ export function RouteHintHop_clone_ptr(arg: number): number { return nativeResponseValue; } // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig); +/* @internal */ export function RouteHintHop_clone(orig: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22561,6 +25174,7 @@ export function RouteHintHop_clone(orig: number): number { return nativeResponseValue; } // uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o); +/* @internal */ export function RouteHintHop_hash(o: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22569,6 +25183,7 @@ export function RouteHintHop_hash(o: number): bigint { return nativeResponseValue; } // bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b); +/* @internal */ export function RouteHintHop_eq(a: number, b: number): boolean { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22577,6 +25192,7 @@ export function RouteHintHop_eq(a: number, b: number): boolean { return nativeResponseValue; } // struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj); +/* @internal */ export function RouteHintHop_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22585,6 +25201,7 @@ export function RouteHintHop_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser); +/* @internal */ export function RouteHintHop_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22593,6 +25210,7 @@ export function RouteHintHop_read(ser: number): number { return nativeResponseValue; } // struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR params, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer); +/* @internal */ export function find_route(our_node_pubkey: number, params: number, network: number, first_hops: number, logger: number, scorer: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22601,6 +25219,7 @@ export function find_route(our_node_pubkey: number, params: number, network: num return nativeResponseValue; } // void Score_free(struct LDKScore this_ptr); +/* @internal */ export function Score_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22609,6 +25228,7 @@ export function Score_free(this_ptr: number): void { // debug statements here } // void LockableScore_free(struct LDKLockableScore this_ptr); +/* @internal */ export function LockableScore_free(this_ptr: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22617,6 +25237,7 @@ export function LockableScore_free(this_ptr: number): void { // debug statements here } // void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj); +/* @internal */ export function MultiThreadedLockableScore_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22625,6 +25246,7 @@ export function MultiThreadedLockableScore_free(this_obj: number): void { // debug statements here } // MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score); +/* @internal */ export function MultiThreadedLockableScore_new(score: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22633,6 +25255,7 @@ export function MultiThreadedLockableScore_new(score: number): number { return nativeResponseValue; } // void ScoringParameters_free(struct LDKScoringParameters this_obj); +/* @internal */ export function ScoringParameters_free(this_obj: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22641,6 +25264,7 @@ export function ScoringParameters_free(this_obj: number): void { // debug statements here } // uint64_t ScoringParameters_get_base_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ScoringParameters_get_base_penalty_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22649,6 +25273,7 @@ export function ScoringParameters_get_base_penalty_msat(this_ptr: number): bigin return nativeResponseValue; } // void ScoringParameters_set_base_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ScoringParameters_set_base_penalty_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22657,6 +25282,7 @@ export function ScoringParameters_set_base_penalty_msat(this_ptr: number, val: b // debug statements here } // uint64_t ScoringParameters_get_failure_penalty_msat(const struct LDKScoringParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ScoringParameters_get_failure_penalty_msat(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22665,6 +25291,7 @@ export function ScoringParameters_get_failure_penalty_msat(this_ptr: number): bi return nativeResponseValue; } // void ScoringParameters_set_failure_penalty_msat(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ScoringParameters_set_failure_penalty_msat(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22673,6 +25300,7 @@ export function ScoringParameters_set_failure_penalty_msat(this_ptr: number, val // debug statements here } // uint16_t ScoringParameters_get_overuse_penalty_start_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ScoringParameters_get_overuse_penalty_start_1024th(this_ptr: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22681,6 +25309,7 @@ export function ScoringParameters_get_overuse_penalty_start_1024th(this_ptr: num return nativeResponseValue; } // void ScoringParameters_set_overuse_penalty_start_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint16_t val); +/* @internal */ export function ScoringParameters_set_overuse_penalty_start_1024th(this_ptr: number, val: number): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22689,6 +25318,7 @@ export function ScoringParameters_set_overuse_penalty_start_1024th(this_ptr: num // debug statements here } // uint64_t ScoringParameters_get_overuse_penalty_msat_per_1024th(const struct LDKScoringParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ScoringParameters_get_overuse_penalty_msat_per_1024th(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22697,6 +25327,7 @@ export function ScoringParameters_get_overuse_penalty_msat_per_1024th(this_ptr: return nativeResponseValue; } // void ScoringParameters_set_overuse_penalty_msat_per_1024th(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ScoringParameters_set_overuse_penalty_msat_per_1024th(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22705,6 +25336,7 @@ export function ScoringParameters_set_overuse_penalty_msat_per_1024th(this_ptr: // debug statements here } // uint64_t ScoringParameters_get_failure_penalty_half_life(const struct LDKScoringParameters *NONNULL_PTR this_ptr); +/* @internal */ export function ScoringParameters_get_failure_penalty_half_life(this_ptr: number): bigint { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22713,6 +25345,7 @@ export function ScoringParameters_get_failure_penalty_half_life(this_ptr: number return nativeResponseValue; } // void ScoringParameters_set_failure_penalty_half_life(struct LDKScoringParameters *NONNULL_PTR this_ptr, uint64_t val); +/* @internal */ export function ScoringParameters_set_failure_penalty_half_life(this_ptr: number, val: bigint): void { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22721,6 +25354,7 @@ export function ScoringParameters_set_failure_penalty_half_life(this_ptr: number // debug statements here } // MUST_USE_RES struct LDKScoringParameters ScoringParameters_new(uint64_t base_penalty_msat_arg, uint64_t failure_penalty_msat_arg, uint16_t overuse_penalty_start_1024th_arg, uint64_t overuse_penalty_msat_per_1024th_arg, uint64_t failure_penalty_half_life_arg); +/* @internal */ export function ScoringParameters_new(base_penalty_msat_arg: bigint, failure_penalty_msat_arg: bigint, overuse_penalty_start_1024th_arg: number, overuse_penalty_msat_per_1024th_arg: bigint, failure_penalty_half_life_arg: bigint): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22729,6 +25363,7 @@ export function ScoringParameters_new(base_penalty_msat_arg: bigint, failure_pen return nativeResponseValue; } // struct LDKCVec_u8Z ScoringParameters_write(const struct LDKScoringParameters *NONNULL_PTR obj); +/* @internal */ export function ScoringParameters_write(obj: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22737,6 +25372,7 @@ export function ScoringParameters_write(obj: number): number { return nativeResponseValue; } // struct LDKCResult_ScoringParametersDecodeErrorZ ScoringParameters_read(struct LDKu8slice ser); +/* @internal */ export function ScoringParameters_read(ser: number): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); @@ -22745,6 +25381,7 @@ export function ScoringParameters_read(ser: number): number { return nativeResponseValue; } // MUST_USE_RES struct LDKScoringParameters ScoringParameters_default(void); +/* @internal */ export function ScoringParameters_default(): number { if(!isWasmInitialized) { throw new Error("initializeWasm() must be awaited first!"); diff --git a/ts/index.mts b/ts/index.mts index 83569e01..8aff2a3d 100644 --- a/ts/index.mts +++ b/ts/index.mts @@ -1,3 +1,7 @@ +import { initializeWasm as bindingsInit } from './bindings.mjs'; +export function initializeWasm(path: string) { + bindingsInit(path); +} export * from './structs/TxOut.mjs'; export * from './enums/AccessError.mjs'; export * from './enums/COption_NoneZ.mjs'; diff --git a/ts/structs/APIError.mts b/ts/structs/APIError.mts index d86e9c55..3e7d0c08 100644 --- a/ts/structs/APIError.mts +++ b/ts/structs/APIError.mts @@ -280,6 +280,10 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Indicates an error on the client's part (usually some variant of attempting to use too-low or + * too-high values) + */ export class APIError extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.APIError_free); } /* @internal */ @@ -302,6 +306,9 @@ export class APIError extends CommonBase { return ret; } + /** + * Creates a copy of the APIError + */ public clone(): APIError { const ret: number = bindings.APIError_clone(this.ptr); const ret_hu_conv: APIError = APIError.constr_from_ptr(ret); @@ -309,6 +316,9 @@ export class APIError extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new APIMisuseError-variant APIError + */ public static constructor_apimisuse_error(err: string): APIError { const ret: number = bindings.APIError_apimisuse_error(bindings.encodeString(err)); const ret_hu_conv: APIError = APIError.constr_from_ptr(ret); @@ -316,6 +326,9 @@ export class APIError extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new FeeRateTooHigh-variant APIError + */ public static constructor_fee_rate_too_high(err: string, feerate: number): APIError { const ret: number = bindings.APIError_fee_rate_too_high(bindings.encodeString(err), feerate); const ret_hu_conv: APIError = APIError.constr_from_ptr(ret); @@ -323,6 +336,9 @@ export class APIError extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new RouteError-variant APIError + */ public static constructor_route_error(err: string): APIError { const ret: number = bindings.APIError_route_error(bindings.encodeString(err)); const ret_hu_conv: APIError = APIError.constr_from_ptr(ret); @@ -330,6 +346,9 @@ export class APIError extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new ChannelUnavailable-variant APIError + */ public static constructor_channel_unavailable(err: string): APIError { const ret: number = bindings.APIError_channel_unavailable(bindings.encodeString(err)); const ret_hu_conv: APIError = APIError.constr_from_ptr(ret); @@ -337,6 +356,9 @@ export class APIError extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new MonitorUpdateFailed-variant APIError + */ public static constructor_monitor_update_failed(): APIError { const ret: number = bindings.APIError_monitor_update_failed(); const ret_hu_conv: APIError = APIError.constr_from_ptr(ret); @@ -344,6 +366,9 @@ export class APIError extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new IncompatibleShutdownScript-variant APIError + */ public static constructor_incompatible_shutdown_script(script: ShutdownScript): APIError { const ret: number = bindings.APIError_incompatible_shutdown_script(script == null ? 0 : CommonBase.get_ptr_of(script) & ~1); const ret_hu_conv: APIError = APIError.constr_from_ptr(ret); @@ -352,7 +377,11 @@ export class APIError extends CommonBase { } } +/** A APIError of type APIMisuseError */ export class APIError_APIMisuseError extends APIError { + /** + * A human-readable error message + */ public err: string; /* @internal */ public constructor(ptr: number) { @@ -362,8 +391,15 @@ export class APIError_APIMisuseError extends APIError { this.err = err_conv; } } +/** A APIError of type FeeRateTooHigh */ export class APIError_FeeRateTooHigh extends APIError { + /** + * A human-readable error message + */ public err: string; + /** + * The feerate which was too high. + */ public feerate: number; /* @internal */ public constructor(ptr: number) { @@ -374,7 +410,11 @@ export class APIError_FeeRateTooHigh extends APIError { this.feerate = bindings.LDKAPIError_FeeRateTooHigh_get_feerate(ptr); } } +/** A APIError of type RouteError */ export class APIError_RouteError extends APIError { + /** + * A human-readable error message + */ public err: string; /* @internal */ public constructor(ptr: number) { @@ -384,7 +424,11 @@ export class APIError_RouteError extends APIError { this.err = err_conv; } } +/** A APIError of type ChannelUnavailable */ export class APIError_ChannelUnavailable extends APIError { + /** + * A human-readable error message + */ public err: string; /* @internal */ public constructor(ptr: number) { @@ -394,13 +438,18 @@ export class APIError_ChannelUnavailable extends APIError { this.err = err_conv; } } +/** A APIError of type MonitorUpdateFailed */ export class APIError_MonitorUpdateFailed extends APIError { /* @internal */ public constructor(ptr: number) { super(null, ptr); } } +/** A APIError of type IncompatibleShutdownScript */ export class APIError_IncompatibleShutdownScript extends APIError { + /** + * The incompatible shutdown script. + */ public script: ShutdownScript; /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/AcceptChannel.mts b/ts/structs/AcceptChannel.mts index 1d6e3c60..eacde00e 100644 --- a/ts/structs/AcceptChannel.mts +++ b/ts/structs/AcceptChannel.mts @@ -281,141 +281,228 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An accept_channel message to be sent or received from a peer + */ export class AcceptChannel extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.AcceptChannel_free); } + /** + * A temporary channel ID, until the funding outpoint is announced + */ public get_temporary_channel_id(): Uint8Array { const ret: number = bindings.AcceptChannel_get_temporary_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * A temporary channel ID, until the funding outpoint is announced + */ public set_temporary_channel_id(val: Uint8Array): void { bindings.AcceptChannel_set_temporary_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The threshold below which outputs on transactions broadcast by sender will be omitted + */ public get_dust_limit_satoshis(): bigint { const ret: bigint = bindings.AcceptChannel_get_dust_limit_satoshis(this.ptr); return ret; } + /** + * The threshold below which outputs on transactions broadcast by sender will be omitted + */ public set_dust_limit_satoshis(val: bigint): void { bindings.AcceptChannel_set_dust_limit_satoshis(this.ptr, val); } + /** + * The maximum inbound HTLC value in flight towards sender, in milli-satoshi + */ public get_max_htlc_value_in_flight_msat(): bigint { const ret: bigint = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this.ptr); return ret; } + /** + * The maximum inbound HTLC value in flight towards sender, in milli-satoshi + */ public set_max_htlc_value_in_flight_msat(val: bigint): void { bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this.ptr, val); } + /** + * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel + */ public get_channel_reserve_satoshis(): bigint { const ret: bigint = bindings.AcceptChannel_get_channel_reserve_satoshis(this.ptr); return ret; } + /** + * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel + */ public set_channel_reserve_satoshis(val: bigint): void { bindings.AcceptChannel_set_channel_reserve_satoshis(this.ptr, val); } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public get_htlc_minimum_msat(): bigint { const ret: bigint = bindings.AcceptChannel_get_htlc_minimum_msat(this.ptr); return ret; } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public set_htlc_minimum_msat(val: bigint): void { bindings.AcceptChannel_set_htlc_minimum_msat(this.ptr, val); } + /** + * Minimum depth of the funding transaction before the channel is considered open + */ public get_minimum_depth(): number { const ret: number = bindings.AcceptChannel_get_minimum_depth(this.ptr); return ret; } + /** + * Minimum depth of the funding transaction before the channel is considered open + */ public set_minimum_depth(val: number): void { bindings.AcceptChannel_set_minimum_depth(this.ptr, val); } + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction + */ public get_to_self_delay(): number { const ret: number = bindings.AcceptChannel_get_to_self_delay(this.ptr); return ret; } + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction + */ public set_to_self_delay(val: number): void { bindings.AcceptChannel_set_to_self_delay(this.ptr, val); } + /** + * The maximum number of inbound HTLCs towards sender + */ public get_max_accepted_htlcs(): number { const ret: number = bindings.AcceptChannel_get_max_accepted_htlcs(this.ptr); return ret; } + /** + * The maximum number of inbound HTLCs towards sender + */ public set_max_accepted_htlcs(val: number): void { bindings.AcceptChannel_set_max_accepted_htlcs(this.ptr, val); } + /** + * The sender's key controlling the funding transaction + */ public get_funding_pubkey(): Uint8Array { const ret: number = bindings.AcceptChannel_get_funding_pubkey(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The sender's key controlling the funding transaction + */ public set_funding_pubkey(val: Uint8Array): void { bindings.AcceptChannel_set_funding_pubkey(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ public get_revocation_basepoint(): Uint8Array { const ret: number = bindings.AcceptChannel_get_revocation_basepoint(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ public set_revocation_basepoint(val: Uint8Array): void { bindings.AcceptChannel_set_revocation_basepoint(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * A payment key to sender for transactions broadcast by counterparty + */ public get_payment_point(): Uint8Array { const ret: number = bindings.AcceptChannel_get_payment_point(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * A payment key to sender for transactions broadcast by counterparty + */ public set_payment_point(val: Uint8Array): void { bindings.AcceptChannel_set_payment_point(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Used to derive a payment key to sender for transactions broadcast by sender + */ public get_delayed_payment_basepoint(): Uint8Array { const ret: number = bindings.AcceptChannel_get_delayed_payment_basepoint(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Used to derive a payment key to sender for transactions broadcast by sender + */ public set_delayed_payment_basepoint(val: Uint8Array): void { bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty + */ public get_htlc_basepoint(): Uint8Array { const ret: number = bindings.AcceptChannel_get_htlc_basepoint(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty + */ public set_htlc_basepoint(val: Uint8Array): void { bindings.AcceptChannel_set_htlc_basepoint(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The first to-be-broadcast-by-sender transaction's per commitment point + */ public get_first_per_commitment_point(): Uint8Array { const ret: number = bindings.AcceptChannel_get_first_per_commitment_point(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The first to-be-broadcast-by-sender transaction's per commitment point + */ public set_first_per_commitment_point(val: Uint8Array): void { bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } @@ -425,6 +512,9 @@ export class AcceptChannel extends CommonBase { return ret; } + /** + * Creates a copy of the AcceptChannel + */ public clone(): AcceptChannel { const ret: number = bindings.AcceptChannel_clone(this.ptr); const ret_hu_conv: AcceptChannel = new AcceptChannel(null, ret); @@ -432,12 +522,18 @@ export class AcceptChannel extends CommonBase { return ret_hu_conv; } + /** + * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read + */ public write(): Uint8Array { const ret: number = bindings.AcceptChannel_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a AcceptChannel from a byte array, created by AcceptChannel_write + */ public static constructor_read(ser: Uint8Array): Result_AcceptChannelDecodeErrorZ { const ret: number = bindings.AcceptChannel_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_AcceptChannelDecodeErrorZ = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Access.mts b/ts/structs/Access.mts index 10b02db2..4bcb9297 100644 --- a/ts/structs/Access.mts +++ b/ts/structs/Access.mts @@ -283,7 +283,14 @@ import * as bindings from '../bindings.mjs' +/** An implementation of Access */ export interface AccessInterface { + /**Returns the transaction output of a funding transaction encoded by [`short_channel_id`]. + * Returns an error if `genesis_hash` is for a different chain or if such a transaction output + * is unknown. + * + * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id + */ get_utxo(genesis_hash: Uint8Array, short_channel_id: bigint): Result_TxOutAccessErrorZ; } @@ -291,6 +298,10 @@ class LDKAccessHolder { held: Access; } +/** + * The `Access` trait defines behavior for accessing chain data and state, such as blocks and + * UTXOs. + */ export class Access extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKAccess; @@ -301,7 +312,8 @@ export class Access extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: AccessInterface): Access { + /** Creates a new instance of Access from a given implementation */ + public static new_impl(arg: AccessInterface): Access { const impl_holder: LDKAccessHolder = new LDKAccessHolder(); let structImplementation = { get_utxo (genesis_hash: number, short_channel_id: bigint): number { @@ -317,6 +329,14 @@ export class Access extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Returns the transaction output of a funding transaction encoded by [`short_channel_id`]. + * Returns an error if `genesis_hash` is for a different chain or if such a transaction output + * is unknown. + * + * [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id + */ public get_utxo(genesis_hash: Uint8Array, short_channel_id: bigint): Result_TxOutAccessErrorZ { const ret: number = bindings.Access_get_utxo(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(genesis_hash, 32)), short_channel_id); const ret_hu_conv: Result_TxOutAccessErrorZ = Result_TxOutAccessErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/AnnouncementSignatures.mts b/ts/structs/AnnouncementSignatures.mts index 97b97f89..1ba7e62f 100644 --- a/ts/structs/AnnouncementSignatures.mts +++ b/ts/structs/AnnouncementSignatures.mts @@ -281,51 +281,81 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An announcement_signatures message to be sent or received from a peer + */ export class AnnouncementSignatures extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.AnnouncementSignatures_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.AnnouncementSignatures_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.AnnouncementSignatures_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The short channel ID + */ public get_short_channel_id(): bigint { const ret: bigint = bindings.AnnouncementSignatures_get_short_channel_id(this.ptr); return ret; } + /** + * The short channel ID + */ public set_short_channel_id(val: bigint): void { bindings.AnnouncementSignatures_set_short_channel_id(this.ptr, val); } + /** + * A signature by the node key + */ public get_node_signature(): Uint8Array { const ret: number = bindings.AnnouncementSignatures_get_node_signature(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * A signature by the node key + */ public set_node_signature(val: Uint8Array): void { bindings.AnnouncementSignatures_set_node_signature(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * A signature by the funding key + */ public get_bitcoin_signature(): Uint8Array { const ret: number = bindings.AnnouncementSignatures_get_bitcoin_signature(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * A signature by the funding key + */ public set_bitcoin_signature(val: Uint8Array): void { bindings.AnnouncementSignatures_set_bitcoin_signature(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * Constructs a new AnnouncementSignatures given each field + */ public static constructor_new(channel_id_arg: Uint8Array, short_channel_id_arg: bigint, node_signature_arg: Uint8Array, bitcoin_signature_arg: Uint8Array): AnnouncementSignatures { const ret: number = bindings.AnnouncementSignatures_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), short_channel_id_arg, bindings.encodeUint8Array(bindings.check_arr_len(node_signature_arg, 64)), bindings.encodeUint8Array(bindings.check_arr_len(bitcoin_signature_arg, 64))); const ret_hu_conv: AnnouncementSignatures = new AnnouncementSignatures(null, ret); @@ -338,6 +368,9 @@ export class AnnouncementSignatures extends CommonBase { return ret; } + /** + * Creates a copy of the AnnouncementSignatures + */ public clone(): AnnouncementSignatures { const ret: number = bindings.AnnouncementSignatures_clone(this.ptr); const ret_hu_conv: AnnouncementSignatures = new AnnouncementSignatures(null, ret); @@ -345,12 +378,18 @@ export class AnnouncementSignatures extends CommonBase { return ret_hu_conv; } + /** + * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read + */ public write(): Uint8Array { const ret: number = bindings.AnnouncementSignatures_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write + */ public static constructor_read(ser: Uint8Array): Result_AnnouncementSignaturesDecodeErrorZ { const ret: number = bindings.AnnouncementSignatures_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_AnnouncementSignaturesDecodeErrorZ = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Balance.mts b/ts/structs/Balance.mts index c37c55f6..32e7f02b 100644 --- a/ts/structs/Balance.mts +++ b/ts/structs/Balance.mts @@ -280,6 +280,12 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Details about the balance(s) available for spending once the channel appears on chain. + * + * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not + * be provided. + */ export class Balance extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.Balance_free); } /* @internal */ @@ -300,6 +306,9 @@ export class Balance extends CommonBase { return ret; } + /** + * Creates a copy of the Balance + */ public clone(): Balance { const ret: number = bindings.Balance_clone(this.ptr); const ret_hu_conv: Balance = Balance.constr_from_ptr(ret); @@ -307,6 +316,9 @@ export class Balance extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new ClaimableOnChannelClose-variant Balance + */ public static constructor_claimable_on_channel_close(claimable_amount_satoshis: bigint): Balance { const ret: number = bindings.Balance_claimable_on_channel_close(claimable_amount_satoshis); const ret_hu_conv: Balance = Balance.constr_from_ptr(ret); @@ -314,6 +326,9 @@ export class Balance extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance + */ public static constructor_claimable_awaiting_confirmations(claimable_amount_satoshis: bigint, confirmation_height: number): Balance { const ret: number = bindings.Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height); const ret_hu_conv: Balance = Balance.constr_from_ptr(ret); @@ -321,6 +336,9 @@ export class Balance extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new ContentiousClaimable-variant Balance + */ public static constructor_contentious_claimable(claimable_amount_satoshis: bigint, timeout_height: number): Balance { const ret: number = bindings.Balance_contentious_claimable(claimable_amount_satoshis, timeout_height); const ret_hu_conv: Balance = Balance.constr_from_ptr(ret); @@ -328,6 +346,9 @@ export class Balance extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new MaybeClaimableHTLCAwaitingTimeout-variant Balance + */ public static constructor_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis: bigint, claimable_height: number): Balance { const ret: number = bindings.Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height); const ret_hu_conv: Balance = Balance.constr_from_ptr(ret); @@ -335,13 +356,22 @@ export class Balance extends CommonBase { return ret_hu_conv; } + /** + * Checks if two Balances contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ public eq(b: Balance): boolean { const ret: boolean = bindings.Balance_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); return ret; } } +/** A Balance of type ClaimableOnChannelClose */ export class Balance_ClaimableOnChannelClose extends Balance { + /** + * The amount available to claim, in satoshis, excluding the on-chain fees which will be + * required to do so. + */ public claimable_amount_satoshis: bigint; /* @internal */ public constructor(ptr: number) { @@ -349,8 +379,17 @@ export class Balance_ClaimableOnChannelClose extends Balance { this.claimable_amount_satoshis = bindings.LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis(ptr); } } +/** A Balance of type ClaimableAwaitingConfirmations */ export class Balance_ClaimableAwaitingConfirmations extends Balance { + /** + * The amount available to claim, in satoshis, possibly excluding the on-chain fees which + * were spent in broadcasting the transaction. + */ public claimable_amount_satoshis: bigint; + /** + * The height at which an [`Event::SpendableOutputs`] event will be generated for this + * amount. + */ public confirmation_height: number; /* @internal */ public constructor(ptr: number) { @@ -359,8 +398,17 @@ export class Balance_ClaimableAwaitingConfirmations extends Balance { this.confirmation_height = bindings.LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(ptr); } } +/** A Balance of type ContentiousClaimable */ export class Balance_ContentiousClaimable extends Balance { + /** + * The amount available to claim, in satoshis, excluding the on-chain fees which will be + * required to do so. + */ public claimable_amount_satoshis: bigint; + /** + * The height at which the counterparty may be able to claim the balance if we have not + * done so. + */ public timeout_height: number; /* @internal */ public constructor(ptr: number) { @@ -369,8 +417,17 @@ export class Balance_ContentiousClaimable extends Balance { this.timeout_height = bindings.LDKBalance_ContentiousClaimable_get_timeout_height(ptr); } } +/** A Balance of type MaybeClaimableHTLCAwaitingTimeout */ export class Balance_MaybeClaimableHTLCAwaitingTimeout extends Balance { + /** + * The amount available to claim, in satoshis, excluding the on-chain fees which will be + * required to do so. + */ public claimable_amount_satoshis: bigint; + /** + * The height at which we will be able to claim the balance if our counterparty has not + * done so. + */ public claimable_height: number; /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/BaseSign.mts b/ts/structs/BaseSign.mts index 079ac25a..e8a8228d 100644 --- a/ts/structs/BaseSign.mts +++ b/ts/structs/BaseSign.mts @@ -283,19 +283,142 @@ import * as bindings from '../bindings.mjs' +/** An implementation of BaseSign */ export interface BaseSignInterface { + /**Gets the per-commitment point for a specific commitment number + * + * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + */ get_per_commitment_point(idx: bigint): Uint8Array; + /**Gets the commitment secret for a specific commitment number as part of the revocation process + * + * An external signer implementation should error here if the commitment was already signed + * and should refuse to sign it in the future. + * + * May be called more than once for the same index. + * + * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + */ release_commitment_secret(idx: bigint): Uint8Array; + /**Validate the counterparty's signatures on the holder commitment transaction and HTLCs. + * + * This is required in order for the signer to make sure that releasing a commitment + * secret won't leave us without a broadcastable holder transaction. + * Policy checks should be implemented in this function, including checking the amount + * sent to us and checking the HTLCs. + */ validate_holder_commitment(holder_tx: HolderCommitmentTransaction): Result_NoneNoneZ; + /**Gets an arbitrary identifier describing the set of keys which are provided back to you in + * some SpendableOutputDescriptor types. This should be sufficient to identify this + * Sign object uniquely and lookup or re-derive its keys. + */ channel_keys_id(): Uint8Array; + /**Create a signature for a counterparty's commitment transaction and associated HTLC transactions. + * + * Note that if signing fails or is rejected, the channel will be force-closed. + * + * Policy checks should be implemented in this function, including checking the amount + * sent to us and checking the HTLCs. + */ sign_counterparty_commitment(commitment_tx: CommitmentTransaction): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ; + /**Validate the counterparty's revocation. + * + * This is required in order for the signer to make sure that the state has moved + * forward and it is safe to sign the next counterparty commitment. + */ validate_counterparty_revocation(idx: bigint, secret: Uint8Array): Result_NoneNoneZ; + /**Create a signatures for a holder's commitment transaction and its claiming HTLC transactions. + * This will only ever be called with a non-revoked commitment_tx. This will be called with the + * latest commitment_tx when we initiate a force-close. + * This will be called with the previous latest, just to get claiming HTLC signatures, if we are + * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to + * the latest. + * This may be called multiple times for the same transaction. + * + * An external signer implementation should check that the commitment has not been revoked. + * + * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case. + */ sign_holder_commitment_and_htlcs(commitment_tx: HolderCommitmentTransaction): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ; + /**Create a signature for the given input in a transaction spending an HTLC transaction output + * or a commitment transaction `to_local` output when our counterparty broadcasts an old state. + * + * A justice transaction may claim multiple outputs at the same time if timelocks are + * similar, but only a signature for the input at index `input` should be signed for here. + * It may be called multiple times for same output(s) if a fee-bump is needed with regards + * to an upcoming timelock expiration. + * + * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * + * per_commitment_key is revocation secret which was provided by our counterparty when they + * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does + * not allow the spending of any funds by itself (you need our holder revocation_secret to do + * so). + */ sign_justice_revoked_output(justice_tx: Uint8Array, input: number, amount: bigint, per_commitment_key: Uint8Array): Result_SignatureNoneZ; + /**Create a signature for the given input in a transaction spending a commitment transaction + * HTLC output when our counterparty broadcasts an old state. + * + * A justice transaction may claim multiple outputs at the same time if timelocks are + * similar, but only a signature for the input at index `input` should be signed for here. + * It may be called multiple times for same output(s) if a fee-bump is needed with regards + * to an upcoming timelock expiration. + * + * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * + * per_commitment_key is revocation secret which was provided by our counterparty when they + * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does + * not allow the spending of any funds by itself (you need our holder revocation_secret to do + * so). + * + * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script + * (which is committed to in the BIP 143 signatures). + */ sign_justice_revoked_htlc(justice_tx: Uint8Array, input: number, amount: bigint, per_commitment_key: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ; + /**Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment + * transaction, either offered or received. + * + * Such a transaction may claim multiples offered outputs at same time if we know the + * preimage for each when we create it, but only the input at index `input` should be + * signed for here. It may be called multiple times for same output(s) if a fee-bump is + * needed with regards to an upcoming timelock expiration. + * + * Witness_script is either a offered or received script as defined in BOLT3 for HTLC + * outputs. + * + * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * + * Per_commitment_point is the dynamic point corresponding to the channel state + * detected onchain. It has been generated by our counterparty and is used to derive + * channel state keys, which are then included in the witness script and committed to in the + * BIP 143 signature. + */ sign_counterparty_htlc_transaction(htlc_tx: Uint8Array, input: number, amount: bigint, per_commitment_point: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ; + /**Create a signature for a (proposed) closing transaction. + * + * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have + * chosen to forgo their output as dust. + */ sign_closing_transaction(closing_tx: ClosingTransaction): Result_SignatureNoneZ; + /**Signs a channel announcement message with our funding key, proving it comes from one + * of the channel participants. + * + * Note that if this fails or is rejected, the channel will not be publicly announced and + * our counterparty may (though likely will not) close the channel on us for violating the + * protocol. + */ sign_channel_announcement(msg: UnsignedChannelAnnouncement): Result_SignatureNoneZ; + /**Set the counterparty static channel data, including basepoints, + * counterparty_selected/holder_selected_contest_delay and funding outpoint. + * This is done as soon as the funding outpoint is known. Since these are static channel data, + * they MUST NOT be allowed to change to different values once set. + * + * channel_parameters.is_populated() MUST be true. + * + * We bind holder_selected_contest_delay late here for API convenience. + * + * Will be called before any signatures are applied. + */ ready_channel(channel_parameters: ChannelTransactionParameters): void; } @@ -303,6 +426,25 @@ class LDKBaseSignHolder { held: BaseSign; } +/** + * A trait to sign lightning channel transactions as described in BOLT 3. + * + * Signing services could be implemented on a hardware wallet. In this case, + * the current Sign would be a front-end on top of a communication + * channel connected to your secure device and lightning key material wouldn't + * reside on a hot server. Nevertheless, a this deployment would still need + * to trust the ChannelManager to avoid loss of funds as this latest component + * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys. + * + * A more secure iteration would be to use hashlock (or payment points) to pair + * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager + * at the price of more state and computation on the hardware wallet side. In the future, + * we are looking forward to design such interface. + * + * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted + * to act, as liveness and breach reply correctness are always going to be hard requirements + * of LN security model, orthogonal of key management issues. + */ export class BaseSign extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKBaseSign; @@ -313,7 +455,8 @@ export class BaseSign extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: BaseSignInterface, pubkeys: ChannelPublicKeys): BaseSign { + /** Creates a new instance of BaseSign from a given implementation */ + public static new_impl(arg: BaseSignInterface, pubkeys: ChannelPublicKeys): BaseSign { const impl_holder: LDKBaseSignHolder = new LDKBaseSignHolder(); let structImplementation = { get_per_commitment_point (idx: bigint): number { @@ -401,18 +544,42 @@ export class BaseSign extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Gets the per-commitment point for a specific commitment number + * + * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + */ public get_per_commitment_point(idx: bigint): Uint8Array { const ret: number = bindings.BaseSign_get_per_commitment_point(this.ptr, idx); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Gets the commitment secret for a specific commitment number as part of the revocation process + * + * An external signer implementation should error here if the commitment was already signed + * and should refuse to sign it in the future. + * + * May be called more than once for the same index. + * + * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + */ public release_commitment_secret(idx: bigint): Uint8Array { const ret: number = bindings.BaseSign_release_commitment_secret(this.ptr, idx); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Validate the counterparty's signatures on the holder commitment transaction and HTLCs. + * + * This is required in order for the signer to make sure that releasing a commitment + * secret won't leave us without a broadcastable holder transaction. + * Policy checks should be implemented in this function, including checking the amount + * sent to us and checking the HTLCs. + */ public validate_holder_commitment(holder_tx: HolderCommitmentTransaction): Result_NoneNoneZ { const ret: number = bindings.BaseSign_validate_holder_commitment(this.ptr, holder_tx == null ? 0 : CommonBase.get_ptr_of(holder_tx) & ~1); const ret_hu_conv: Result_NoneNoneZ = Result_NoneNoneZ.constr_from_ptr(ret); @@ -420,12 +587,25 @@ export class BaseSign extends CommonBase { return ret_hu_conv; } + /** + * Gets an arbitrary identifier describing the set of keys which are provided back to you in + * some SpendableOutputDescriptor types. This should be sufficient to identify this + * Sign object uniquely and lookup or re-derive its keys. + */ public channel_keys_id(): Uint8Array { const ret: number = bindings.BaseSign_channel_keys_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Create a signature for a counterparty's commitment transaction and associated HTLC transactions. + * + * Note that if signing fails or is rejected, the channel will be force-closed. + * + * Policy checks should be implemented in this function, including checking the amount + * sent to us and checking the HTLCs. + */ public sign_counterparty_commitment(commitment_tx: CommitmentTransaction): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ { const ret: number = bindings.BaseSign_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : CommonBase.get_ptr_of(commitment_tx) & ~1); const ret_hu_conv: Result_C2Tuple_SignatureCVec_SignatureZZNoneZ = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); @@ -433,12 +613,31 @@ export class BaseSign extends CommonBase { return ret_hu_conv; } + /** + * Validate the counterparty's revocation. + * + * This is required in order for the signer to make sure that the state has moved + * forward and it is safe to sign the next counterparty commitment. + */ public validate_counterparty_revocation(idx: bigint, secret: Uint8Array): Result_NoneNoneZ { const ret: number = bindings.BaseSign_validate_counterparty_revocation(this.ptr, idx, bindings.encodeUint8Array(bindings.check_arr_len(secret, 32))); const ret_hu_conv: Result_NoneNoneZ = Result_NoneNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions. + * This will only ever be called with a non-revoked commitment_tx. This will be called with the + * latest commitment_tx when we initiate a force-close. + * This will be called with the previous latest, just to get claiming HTLC signatures, if we are + * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to + * the latest. + * This may be called multiple times for the same transaction. + * + * An external signer implementation should check that the commitment has not been revoked. + * + * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case. + */ public sign_holder_commitment_and_htlcs(commitment_tx: HolderCommitmentTransaction): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ { const ret: number = bindings.BaseSign_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : CommonBase.get_ptr_of(commitment_tx) & ~1); const ret_hu_conv: Result_C2Tuple_SignatureCVec_SignatureZZNoneZ = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); @@ -446,12 +645,47 @@ export class BaseSign extends CommonBase { return ret_hu_conv; } + /** + * Create a signature for the given input in a transaction spending an HTLC transaction output + * or a commitment transaction `to_local` output when our counterparty broadcasts an old state. + * + * A justice transaction may claim multiple outputs at the same time if timelocks are + * similar, but only a signature for the input at index `input` should be signed for here. + * It may be called multiple times for same output(s) if a fee-bump is needed with regards + * to an upcoming timelock expiration. + * + * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * + * per_commitment_key is revocation secret which was provided by our counterparty when they + * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does + * not allow the spending of any funds by itself (you need our holder revocation_secret to do + * so). + */ public sign_justice_revoked_output(justice_tx: Uint8Array, input: number, amount: bigint, per_commitment_key: Uint8Array): Result_SignatureNoneZ { const ret: number = bindings.BaseSign_sign_justice_revoked_output(this.ptr, bindings.encodeUint8Array(justice_tx), input, amount, bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_key, 32))); const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Create a signature for the given input in a transaction spending a commitment transaction + * HTLC output when our counterparty broadcasts an old state. + * + * A justice transaction may claim multiple outputs at the same time if timelocks are + * similar, but only a signature for the input at index `input` should be signed for here. + * It may be called multiple times for same output(s) if a fee-bump is needed with regards + * to an upcoming timelock expiration. + * + * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * + * per_commitment_key is revocation secret which was provided by our counterparty when they + * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does + * not allow the spending of any funds by itself (you need our holder revocation_secret to do + * so). + * + * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script + * (which is committed to in the BIP 143 signatures). + */ public sign_justice_revoked_htlc(justice_tx: Uint8Array, input: number, amount: bigint, per_commitment_key: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ { const ret: number = bindings.BaseSign_sign_justice_revoked_htlc(this.ptr, bindings.encodeUint8Array(justice_tx), input, amount, bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_key, 32)), htlc == null ? 0 : CommonBase.get_ptr_of(htlc) & ~1); const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret); @@ -459,6 +693,25 @@ export class BaseSign extends CommonBase { return ret_hu_conv; } + /** + * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment + * transaction, either offered or received. + * + * Such a transaction may claim multiples offered outputs at same time if we know the + * preimage for each when we create it, but only the input at index `input` should be + * signed for here. It may be called multiple times for same output(s) if a fee-bump is + * needed with regards to an upcoming timelock expiration. + * + * Witness_script is either a offered or received script as defined in BOLT3 for HTLC + * outputs. + * + * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * + * Per_commitment_point is the dynamic point corresponding to the channel state + * detected onchain. It has been generated by our counterparty and is used to derive + * channel state keys, which are then included in the witness script and committed to in the + * BIP 143 signature. + */ public sign_counterparty_htlc_transaction(htlc_tx: Uint8Array, input: number, amount: bigint, per_commitment_point: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ { const ret: number = bindings.BaseSign_sign_counterparty_htlc_transaction(this.ptr, bindings.encodeUint8Array(htlc_tx), input, amount, bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point, 33)), htlc == null ? 0 : CommonBase.get_ptr_of(htlc) & ~1); const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret); @@ -466,6 +719,12 @@ export class BaseSign extends CommonBase { return ret_hu_conv; } + /** + * Create a signature for a (proposed) closing transaction. + * + * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have + * chosen to forgo their output as dust. + */ public sign_closing_transaction(closing_tx: ClosingTransaction): Result_SignatureNoneZ { const ret: number = bindings.BaseSign_sign_closing_transaction(this.ptr, closing_tx == null ? 0 : CommonBase.get_ptr_of(closing_tx) & ~1); const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret); @@ -473,6 +732,14 @@ export class BaseSign extends CommonBase { return ret_hu_conv; } + /** + * Signs a channel announcement message with our funding key, proving it comes from one + * of the channel participants. + * + * Note that if this fails or is rejected, the channel will not be publicly announced and + * our counterparty may (though likely will not) close the channel on us for violating the + * protocol. + */ public sign_channel_announcement(msg: UnsignedChannelAnnouncement): Result_SignatureNoneZ { const ret: number = bindings.BaseSign_sign_channel_announcement(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret); @@ -480,11 +747,27 @@ export class BaseSign extends CommonBase { return ret_hu_conv; } + /** + * Set the counterparty static channel data, including basepoints, + * counterparty_selected/holder_selected_contest_delay and funding outpoint. + * This is done as soon as the funding outpoint is known. Since these are static channel data, + * they MUST NOT be allowed to change to different values once set. + * + * channel_parameters.is_populated() MUST be true. + * + * We bind holder_selected_contest_delay late here for API convenience. + * + * Will be called before any signatures are applied. + */ public ready_channel(channel_parameters: ChannelTransactionParameters): void { bindings.BaseSign_ready_channel(this.ptr, channel_parameters == null ? 0 : CommonBase.get_ptr_of(channel_parameters) & ~1); CommonBase.add_ref_from(this, channel_parameters); } + /** + * Frees any resources associated with this object given its this_arg pointer. + * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. + */ public get_pubkeys(): ChannelPublicKeys { const ret: number = bindings.BaseSign_get_pubkeys(this.ptr); const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); diff --git a/ts/structs/BestBlock.mts b/ts/structs/BestBlock.mts index 1a5fc9f8..d9dd2a1b 100644 --- a/ts/structs/BestBlock.mts +++ b/ts/structs/BestBlock.mts @@ -281,6 +281,9 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * The best known block as identified by its hash and height. + */ export class BestBlock extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { @@ -292,6 +295,9 @@ export class BestBlock extends CommonBase { return ret; } + /** + * Creates a copy of the BestBlock + */ public clone(): BestBlock { const ret: number = bindings.BestBlock_clone(this.ptr); const ret_hu_conv: BestBlock = new BestBlock(null, ret); @@ -299,6 +305,10 @@ export class BestBlock extends CommonBase { return ret_hu_conv; } + /** + * Constructs a `BestBlock` that represents the genesis block at height 0 of the given + * network. + */ public static constructor_from_genesis(network: Network): BestBlock { const ret: number = bindings.BestBlock_from_genesis(network); const ret_hu_conv: BestBlock = new BestBlock(null, ret); @@ -306,6 +316,9 @@ export class BestBlock extends CommonBase { return ret_hu_conv; } + /** + * Returns a `BestBlock` as identified by the given block hash and height. + */ public static constructor_new(block_hash: Uint8Array, height: number): BestBlock { const ret: number = bindings.BestBlock_new(bindings.encodeUint8Array(bindings.check_arr_len(block_hash, 32)), height); const ret_hu_conv: BestBlock = new BestBlock(null, ret); @@ -313,12 +326,18 @@ export class BestBlock extends CommonBase { return ret_hu_conv; } + /** + * Returns the best block hash. + */ public block_hash(): Uint8Array { const ret: number = bindings.BestBlock_block_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Returns the best block height. + */ public height(): number { const ret: number = bindings.BestBlock_height(this.ptr); return ret; diff --git a/ts/structs/BroadcasterInterface.mts b/ts/structs/BroadcasterInterface.mts index 5ea7ed4f..ae0eb85d 100644 --- a/ts/structs/BroadcasterInterface.mts +++ b/ts/structs/BroadcasterInterface.mts @@ -283,7 +283,10 @@ import * as bindings from '../bindings.mjs' +/** An implementation of BroadcasterInterface */ export interface BroadcasterInterfaceInterface { + /**Sends a transaction out to (hopefully) be mined. + */ broadcast_transaction(tx: Uint8Array): void; } @@ -291,6 +294,9 @@ class LDKBroadcasterInterfaceHolder { held: BroadcasterInterface; } +/** + * An interface to send a transaction to the Bitcoin network. + */ export class BroadcasterInterface extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKBroadcasterInterface; @@ -301,7 +307,8 @@ export class BroadcasterInterface extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: BroadcasterInterfaceInterface): BroadcasterInterface { + /** Creates a new instance of BroadcasterInterface from a given implementation */ + public static new_impl(arg: BroadcasterInterfaceInterface): BroadcasterInterface { const impl_holder: LDKBroadcasterInterfaceHolder = new LDKBroadcasterInterfaceHolder(); let structImplementation = { broadcast_transaction (tx: number): void { @@ -315,6 +322,10 @@ export class BroadcasterInterface extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Sends a transaction out to (hopefully) be mined. + */ public broadcast_transaction(tx: Uint8Array): void { bindings.BroadcasterInterface_broadcast_transaction(this.ptr, bindings.encodeUint8Array(tx)); } diff --git a/ts/structs/BuiltCommitmentTransaction.mts b/ts/structs/BuiltCommitmentTransaction.mts index c0ee78ca..a6045bb6 100644 --- a/ts/structs/BuiltCommitmentTransaction.mts +++ b/ts/structs/BuiltCommitmentTransaction.mts @@ -281,32 +281,56 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A pre-built Bitcoin commitment transaction and its txid. + */ export class BuiltCommitmentTransaction extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.BuiltCommitmentTransaction_free); } + /** + * The commitment transaction + */ public get_transaction(): Uint8Array { const ret: number = bindings.BuiltCommitmentTransaction_get_transaction(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The commitment transaction + */ public set_transaction(val: Uint8Array): void { bindings.BuiltCommitmentTransaction_set_transaction(this.ptr, bindings.encodeUint8Array(val)); } + /** + * The txid for the commitment transaction. + * + * This is provided as a performance optimization, instead of calling transaction.txid() + * multiple times. + */ public get_txid(): Uint8Array { const ret: number = bindings.BuiltCommitmentTransaction_get_txid(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The txid for the commitment transaction. + * + * This is provided as a performance optimization, instead of calling transaction.txid() + * multiple times. + */ public set_txid(val: Uint8Array): void { bindings.BuiltCommitmentTransaction_set_txid(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Constructs a new BuiltCommitmentTransaction given each field + */ public static constructor_new(transaction_arg: Uint8Array, txid_arg: Uint8Array): BuiltCommitmentTransaction { const ret: number = bindings.BuiltCommitmentTransaction_new(bindings.encodeUint8Array(transaction_arg), bindings.encodeUint8Array(bindings.check_arr_len(txid_arg, 32))); const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret); @@ -319,6 +343,9 @@ export class BuiltCommitmentTransaction extends CommonBase { return ret; } + /** + * Creates a copy of the BuiltCommitmentTransaction + */ public clone(): BuiltCommitmentTransaction { const ret: number = bindings.BuiltCommitmentTransaction_clone(this.ptr); const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret); @@ -326,24 +353,39 @@ export class BuiltCommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read + */ public write(): Uint8Array { const ret: number = bindings.BuiltCommitmentTransaction_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write + */ public static constructor_read(ser: Uint8Array): Result_BuiltCommitmentTransactionDecodeErrorZ { const ret: number = bindings.BuiltCommitmentTransaction_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_BuiltCommitmentTransactionDecodeErrorZ = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Get the SIGHASH_ALL sighash value of the transaction. + * + * This can be used to verify a signature. + */ public get_sighash_all(funding_redeemscript: Uint8Array, channel_value_satoshis: bigint): Uint8Array { const ret: number = bindings.BuiltCommitmentTransaction_get_sighash_all(this.ptr, bindings.encodeUint8Array(funding_redeemscript), channel_value_satoshis); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Sign a transaction, either because we are counter-signing the counterparty's transaction or + * because we are about to broadcast a holder transaction. + */ public sign(funding_key: Uint8Array, funding_redeemscript: Uint8Array, channel_value_satoshis: bigint): Uint8Array { const ret: number = bindings.BuiltCommitmentTransaction_sign(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(funding_key, 32)), bindings.encodeUint8Array(funding_redeemscript), channel_value_satoshis); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); diff --git a/ts/structs/ChainMonitor.mts b/ts/structs/ChainMonitor.mts index 169b552a..f2c811ac 100644 --- a/ts/structs/ChainMonitor.mts +++ b/ts/structs/ChainMonitor.mts @@ -281,12 +281,32 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An implementation of [`chain::Watch`] for monitoring channels. + * + * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by + * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally + * or used independently to monitor channels remotely. See the [module-level documentation] for + * details. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + * [module-level documentation]: crate::chain::chainmonitor + */ export class ChainMonitor extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChainMonitor_free); } + /** + * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels. + * + * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor + * will call back to it indicating transactions and outputs of interest. This allows clients to + * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may + * always need to fetch full blocks absent another means for determining which blocks contain + * transactions relevant to the watched channels. + */ public static constructor_new(chain_source: Option_FilterZ, broadcaster: BroadcasterInterface, logger: Logger, feeest: FeeEstimator, persister: Persist): ChainMonitor { const ret: number = bindings.ChainMonitor_new(CommonBase.get_ptr_of(chain_source), broadcaster == null ? 0 : CommonBase.get_ptr_of(broadcaster), logger == null ? 0 : CommonBase.get_ptr_of(logger), feeest == null ? 0 : CommonBase.get_ptr_of(feeest), persister == null ? 0 : CommonBase.get_ptr_of(persister)); const ret_hu_conv: ChainMonitor = new ChainMonitor(null, ret); @@ -299,6 +319,17 @@ export class ChainMonitor extends CommonBase { return ret_hu_conv; } + /** + * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or + * claims which are awaiting confirmation. + * + * Includes the balances from each [`ChannelMonitor`] *except* those included in + * `ignored_channels`, allowing you to filter out balances from channels which are still open + * (and whose balance should likely be pulled from the [`ChannelDetails`]). + * + * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for + * inclusion in the return value. + */ public get_claimable_balances(ignored_channels: ChannelDetails[]): Balance[] { const ret: number = bindings.ChainMonitor_get_claimable_balances(this.ptr, bindings.encodeUint32Array(ignored_channels != null ? ignored_channels.map(ignored_channels_conv_16 => ignored_channels_conv_16 == null ? 0 : CommonBase.get_ptr_of(ignored_channels_conv_16) & ~1) : null)); const ret_conv_9_len: number = bindings.getArrayLength(ret); @@ -309,15 +340,29 @@ export class ChainMonitor extends CommonBase { CommonBase.add_ref_from(ret_conv_9_hu_conv, this); ret_conv_9_arr[j] = ret_conv_9_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_9_arr; } + /** + * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no + * such [`ChannelMonitor`] is currently being monitored for. + * + * Note that the result holds a mutex over our monitor set, and should not be held + * indefinitely. + */ public get_monitor(funding_txo: OutPoint): Result_LockedChannelMonitorNoneZ { const ret: number = bindings.ChainMonitor_get_monitor(this.ptr, funding_txo == null ? 0 : CommonBase.get_ptr_of(funding_txo) & ~1); const ret_hu_conv: Result_LockedChannelMonitorNoneZ = Result_LockedChannelMonitorNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Lists the funding outpoint of each [`ChannelMonitor`] being monitored. + * + * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always + * monitoring for on-chain state resolutions. + */ public list_monitors(): OutPoint[] { const ret: number = bindings.ChainMonitor_list_monitors(this.ptr); const ret_conv_10_len: number = bindings.getArrayLength(ret); @@ -328,15 +373,35 @@ export class ChainMonitor extends CommonBase { CommonBase.add_ref_from(ret_conv_10_hu_conv, this); ret_conv_10_arr[k] = ret_conv_10_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_10_arr; } + /** + * Indicates the persistence of a [`ChannelMonitor`] has completed after + * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation. + * + * Thus, the anticipated use is, at a high level: + * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the + * update to disk and begins updating any remote (e.g. watchtower/backup) copies, + * returning [`ChannelMonitorUpdateErr::TemporaryFailure`], + * 2) once all remote copies are updated, you call this function with the + * `completed_update_id` that completed, and once all pending updates have completed the + * channel will be re-enabled. + * + * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently + * registered [`ChannelMonitor`]s. + */ public channel_monitor_updated(funding_txo: OutPoint, completed_update_id: MonitorUpdateId): Result_NoneAPIErrorZ { const ret: number = bindings.ChainMonitor_channel_monitor_updated(this.ptr, funding_txo == null ? 0 : CommonBase.get_ptr_of(funding_txo) & ~1, completed_update_id == null ? 0 : CommonBase.get_ptr_of(completed_update_id) & ~1); const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Constructs a new Listen which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is + */ public as_Listen(): Listen { const ret: number = bindings.ChainMonitor_as_Listen(this.ptr); const ret_hu_conv: Listen = new Listen(null, ret); @@ -344,6 +409,10 @@ export class ChainMonitor extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new Confirm which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is + */ public as_Confirm(): Confirm { const ret: number = bindings.ChainMonitor_as_Confirm(this.ptr); const ret_hu_conv: Confirm = new Confirm(null, ret); @@ -351,6 +420,10 @@ export class ChainMonitor extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new Watch which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is + */ public as_Watch(): Watch { const ret: number = bindings.ChainMonitor_as_Watch(this.ptr); const ret_hu_conv: Watch = new Watch(null, ret); @@ -358,6 +431,10 @@ export class ChainMonitor extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new EventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is + */ public as_EventsProvider(): EventsProvider { const ret: number = bindings.ChainMonitor_as_EventsProvider(this.ptr); const ret_hu_conv: EventsProvider = new EventsProvider(null, ret); diff --git a/ts/structs/ChainParameters.mts b/ts/structs/ChainParameters.mts index 5051f295..89e859e0 100644 --- a/ts/structs/ChainParameters.mts +++ b/ts/structs/ChainParameters.mts @@ -281,21 +281,39 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Chain-related parameters used to construct a new `ChannelManager`. + * + * Typically, the block-specific parameters are derived from the best block hash for the network, + * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters + * are not needed when deserializing a previously constructed `ChannelManager`. + */ export class ChainParameters extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChainParameters_free); } + /** + * The network for determining the `chain_hash` in Lightning messages. + */ public get_network(): Network { const ret: Network = bindings.ChainParameters_get_network(this.ptr); return ret; } + /** + * The network for determining the `chain_hash` in Lightning messages. + */ public set_network(val: Network): void { bindings.ChainParameters_set_network(this.ptr, val); } + /** + * The hash and height of the latest block successfully connected. + * + * Used to track on-chain channel funding outputs and send payments with reliable timelocks. + */ public get_best_block(): BestBlock { const ret: number = bindings.ChainParameters_get_best_block(this.ptr); const ret_hu_conv: BestBlock = new BestBlock(null, ret); @@ -303,10 +321,18 @@ export class ChainParameters extends CommonBase { return ret_hu_conv; } + /** + * The hash and height of the latest block successfully connected. + * + * Used to track on-chain channel funding outputs and send payments with reliable timelocks. + */ public set_best_block(val: BestBlock): void { bindings.ChainParameters_set_best_block(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new ChainParameters given each field + */ public static constructor_new(network_arg: Network, best_block_arg: BestBlock): ChainParameters { const ret: number = bindings.ChainParameters_new(network_arg, best_block_arg == null ? 0 : CommonBase.get_ptr_of(best_block_arg) & ~1); const ret_hu_conv: ChainParameters = new ChainParameters(null, ret); @@ -319,6 +345,9 @@ export class ChainParameters extends CommonBase { return ret; } + /** + * Creates a copy of the ChainParameters + */ public clone(): ChainParameters { const ret: number = bindings.ChainParameters_clone(this.ptr); const ret_hu_conv: ChainParameters = new ChainParameters(null, ret); diff --git a/ts/structs/ChannelAnnouncement.mts b/ts/structs/ChannelAnnouncement.mts index d591b3b9..2645600f 100644 --- a/ts/structs/ChannelAnnouncement.mts +++ b/ts/structs/ChannelAnnouncement.mts @@ -281,52 +281,82 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A channel_announcement message to be sent or received from a peer + */ export class ChannelAnnouncement extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelAnnouncement_free); } + /** + * Authentication of the announcement by the first public node + */ public get_node_signature_1(): Uint8Array { const ret: number = bindings.ChannelAnnouncement_get_node_signature_1(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Authentication of the announcement by the first public node + */ public set_node_signature_1(val: Uint8Array): void { bindings.ChannelAnnouncement_set_node_signature_1(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * Authentication of the announcement by the second public node + */ public get_node_signature_2(): Uint8Array { const ret: number = bindings.ChannelAnnouncement_get_node_signature_2(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Authentication of the announcement by the second public node + */ public set_node_signature_2(val: Uint8Array): void { bindings.ChannelAnnouncement_set_node_signature_2(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * Proof of funding UTXO ownership by the first public node + */ public get_bitcoin_signature_1(): Uint8Array { const ret: number = bindings.ChannelAnnouncement_get_bitcoin_signature_1(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Proof of funding UTXO ownership by the first public node + */ public set_bitcoin_signature_1(val: Uint8Array): void { bindings.ChannelAnnouncement_set_bitcoin_signature_1(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * Proof of funding UTXO ownership by the second public node + */ public get_bitcoin_signature_2(): Uint8Array { const ret: number = bindings.ChannelAnnouncement_get_bitcoin_signature_2(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Proof of funding UTXO ownership by the second public node + */ public set_bitcoin_signature_2(val: Uint8Array): void { bindings.ChannelAnnouncement_set_bitcoin_signature_2(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * The actual announcement + */ public get_contents(): UnsignedChannelAnnouncement { const ret: number = bindings.ChannelAnnouncement_get_contents(this.ptr); const ret_hu_conv: UnsignedChannelAnnouncement = new UnsignedChannelAnnouncement(null, ret); @@ -334,10 +364,16 @@ export class ChannelAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * The actual announcement + */ public set_contents(val: UnsignedChannelAnnouncement): void { bindings.ChannelAnnouncement_set_contents(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new ChannelAnnouncement given each field + */ public static constructor_new(node_signature_1_arg: Uint8Array, node_signature_2_arg: Uint8Array, bitcoin_signature_1_arg: Uint8Array, bitcoin_signature_2_arg: Uint8Array, contents_arg: UnsignedChannelAnnouncement): ChannelAnnouncement { const ret: number = bindings.ChannelAnnouncement_new(bindings.encodeUint8Array(bindings.check_arr_len(node_signature_1_arg, 64)), bindings.encodeUint8Array(bindings.check_arr_len(node_signature_2_arg, 64)), bindings.encodeUint8Array(bindings.check_arr_len(bitcoin_signature_1_arg, 64)), bindings.encodeUint8Array(bindings.check_arr_len(bitcoin_signature_2_arg, 64)), contents_arg == null ? 0 : CommonBase.get_ptr_of(contents_arg) & ~1); const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); @@ -350,6 +386,9 @@ export class ChannelAnnouncement extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelAnnouncement + */ public clone(): ChannelAnnouncement { const ret: number = bindings.ChannelAnnouncement_clone(this.ptr); const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); @@ -357,12 +396,18 @@ export class ChannelAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelAnnouncement_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write + */ public static constructor_read(ser: Uint8Array): Result_ChannelAnnouncementDecodeErrorZ { const ret: number = bindings.ChannelAnnouncement_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ChannelAnnouncementDecodeErrorZ = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ChannelConfig.mts b/ts/structs/ChannelConfig.mts index bc471da4..09af0bab 100644 --- a/ts/structs/ChannelConfig.mts +++ b/ts/structs/ChannelConfig.mts @@ -281,75 +281,302 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Options which apply on a per-channel basis and may change at runtime or based on negotiation + * with our counterparty. + */ export class ChannelConfig extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelConfig_free); } + /** + * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound + * over the channel. + * This may be allowed to change at runtime in a later update, however doing so must result in + * update messages sent to notify all nodes of our updated relay fee. + * + * Default value: 0. + */ public get_forwarding_fee_proportional_millionths(): number { const ret: number = bindings.ChannelConfig_get_forwarding_fee_proportional_millionths(this.ptr); return ret; } + /** + * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound + * over the channel. + * This may be allowed to change at runtime in a later update, however doing so must result in + * update messages sent to notify all nodes of our updated relay fee. + * + * Default value: 0. + */ public set_forwarding_fee_proportional_millionths(val: number): void { bindings.ChannelConfig_set_forwarding_fee_proportional_millionths(this.ptr, val); } + /** + * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in + * excess of [`forwarding_fee_proportional_millionths`]. + * This may be allowed to change at runtime in a later update, however doing so must result in + * update messages sent to notify all nodes of our updated relay fee. + * + * The default value of a single satoshi roughly matches the market rate on many routing nodes + * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through + * this node. + * + * Default value: 1000. + * + * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths + */ public get_forwarding_fee_base_msat(): number { const ret: number = bindings.ChannelConfig_get_forwarding_fee_base_msat(this.ptr); return ret; } + /** + * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in + * excess of [`forwarding_fee_proportional_millionths`]. + * This may be allowed to change at runtime in a later update, however doing so must result in + * update messages sent to notify all nodes of our updated relay fee. + * + * The default value of a single satoshi roughly matches the market rate on many routing nodes + * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through + * this node. + * + * Default value: 1000. + * + * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths + */ public set_forwarding_fee_base_msat(val: number): void { bindings.ChannelConfig_set_forwarding_fee_base_msat(this.ptr, val); } + /** + * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over + * the channel this config applies to. + * + * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight + * HTLC balance when a channel appears on-chain whereas + * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining + * (non-HTLC-encumbered) balance. + * + * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed, + * we (or one of our watchtowers) MUST be online to check for broadcast of the current + * commitment transaction at least once per this many blocks (minus some margin to allow us + * enough time to broadcast and confirm a transaction, possibly with time in between to RBF + * the spending transaction). + * + * Default value: 72 (12 hours at an average of 6 blocks/hour). + * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as + * [`MIN_CLTV_EXPIRY_DELTA`] instead. + * + * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA + */ public get_cltv_expiry_delta(): number { const ret: number = bindings.ChannelConfig_get_cltv_expiry_delta(this.ptr); return ret; } + /** + * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over + * the channel this config applies to. + * + * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight + * HTLC balance when a channel appears on-chain whereas + * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining + * (non-HTLC-encumbered) balance. + * + * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed, + * we (or one of our watchtowers) MUST be online to check for broadcast of the current + * commitment transaction at least once per this many blocks (minus some margin to allow us + * enough time to broadcast and confirm a transaction, possibly with time in between to RBF + * the spending transaction). + * + * Default value: 72 (12 hours at an average of 6 blocks/hour). + * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as + * [`MIN_CLTV_EXPIRY_DELTA`] instead. + * + * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA + */ public set_cltv_expiry_delta(val: number): void { bindings.ChannelConfig_set_cltv_expiry_delta(this.ptr, val); } + /** + * Set to announce the channel publicly and notify all nodes that they can route via this + * channel. + * + * This should only be set to true for nodes which expect to be online reliably. + * + * As the node which funds a channel picks this value this will only apply for new outbound + * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set. + * + * This cannot be changed after the initial channel handshake. + * + * Default value: false. + */ public get_announced_channel(): boolean { const ret: boolean = bindings.ChannelConfig_get_announced_channel(this.ptr); return ret; } + /** + * Set to announce the channel publicly and notify all nodes that they can route via this + * channel. + * + * This should only be set to true for nodes which expect to be online reliably. + * + * As the node which funds a channel picks this value this will only apply for new outbound + * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set. + * + * This cannot be changed after the initial channel handshake. + * + * Default value: false. + */ public set_announced_channel(val: boolean): void { bindings.ChannelConfig_set_announced_channel(this.ptr, val); } + /** + * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty + * supports it, they will then enforce the mutual-close output to us matches what we provided + * at intialization, preventing us from closing to an alternate pubkey. + * + * This is set to true by default to provide a slight increase in security, though ultimately + * any attacker who is able to take control of a channel can just as easily send the funds via + * lightning payments, so we never require that our counterparties support this option. + * + * This cannot be changed after a channel has been initialized. + * + * Default value: true. + */ public get_commit_upfront_shutdown_pubkey(): boolean { const ret: boolean = bindings.ChannelConfig_get_commit_upfront_shutdown_pubkey(this.ptr); return ret; } + /** + * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty + * supports it, they will then enforce the mutual-close output to us matches what we provided + * at intialization, preventing us from closing to an alternate pubkey. + * + * This is set to true by default to provide a slight increase in security, though ultimately + * any attacker who is able to take control of a channel can just as easily send the funds via + * lightning payments, so we never require that our counterparties support this option. + * + * This cannot be changed after a channel has been initialized. + * + * Default value: true. + */ public set_commit_upfront_shutdown_pubkey(val: boolean): void { bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this.ptr, val); } + /** + * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too + * small to claim on-chain. + * + * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will + * not be claimable on-chain, instead being turned into additional miner fees if either + * party force-closes the channel. Because the threshold is per-HTLC, our total exposure + * to such payments may be sustantial if there are many dust HTLCs present when the + * channel is force-closed. + * + * This limit is applied for sent, forwarded, and received HTLCs and limits the total + * exposure across all three types per-channel. Setting this too low may prevent the + * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very + * important to prevent stealing of dust HTLCs by miners. + * + * Default value: 5_000_000 msat. + */ public get_max_dust_htlc_exposure_msat(): bigint { const ret: bigint = bindings.ChannelConfig_get_max_dust_htlc_exposure_msat(this.ptr); return ret; } + /** + * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too + * small to claim on-chain. + * + * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will + * not be claimable on-chain, instead being turned into additional miner fees if either + * party force-closes the channel. Because the threshold is per-HTLC, our total exposure + * to such payments may be sustantial if there are many dust HTLCs present when the + * channel is force-closed. + * + * This limit is applied for sent, forwarded, and received HTLCs and limits the total + * exposure across all three types per-channel. Setting this too low may prevent the + * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very + * important to prevent stealing of dust HTLCs by miners. + * + * Default value: 5_000_000 msat. + */ public set_max_dust_htlc_exposure_msat(val: bigint): void { bindings.ChannelConfig_set_max_dust_htlc_exposure_msat(this.ptr, val); } + /** + * The additional fee we're willing to pay to avoid waiting for the counterparty's + * `to_self_delay` to reclaim funds. + * + * When we close a channel cooperatively with our counterparty, we negotiate a fee for the + * closing transaction which both sides find acceptable, ultimately paid by the channel + * funder/initiator. + * + * When we are the funder, because we have to pay the channel closing fee, we bound the + * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by + * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our + * [`Normal`] feerate during normal operation, this value represents the additional fee we're + * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our + * funds. + * + * When we are not the funder, we require the closing transaction fee pay at least our + * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like. + * Thus, this value is ignored when we are not the funder. + * + * Default value: 1000 satoshis. + * + * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal + * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background + */ public get_force_close_avoidance_max_fee_satoshis(): bigint { const ret: bigint = bindings.ChannelConfig_get_force_close_avoidance_max_fee_satoshis(this.ptr); return ret; } + /** + * The additional fee we're willing to pay to avoid waiting for the counterparty's + * `to_self_delay` to reclaim funds. + * + * When we close a channel cooperatively with our counterparty, we negotiate a fee for the + * closing transaction which both sides find acceptable, ultimately paid by the channel + * funder/initiator. + * + * When we are the funder, because we have to pay the channel closing fee, we bound the + * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by + * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our + * [`Normal`] feerate during normal operation, this value represents the additional fee we're + * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our + * funds. + * + * When we are not the funder, we require the closing transaction fee pay at least our + * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like. + * Thus, this value is ignored when we are not the funder. + * + * Default value: 1000 satoshis. + * + * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal + * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background + */ public set_force_close_avoidance_max_fee_satoshis(val: bigint): void { bindings.ChannelConfig_set_force_close_avoidance_max_fee_satoshis(this.ptr, val); } + /** + * Constructs a new ChannelConfig given each field + */ public static constructor_new(forwarding_fee_proportional_millionths_arg: number, forwarding_fee_base_msat_arg: number, cltv_expiry_delta_arg: number, announced_channel_arg: boolean, commit_upfront_shutdown_pubkey_arg: boolean, max_dust_htlc_exposure_msat_arg: bigint, force_close_avoidance_max_fee_satoshis_arg: bigint): ChannelConfig { const ret: number = bindings.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg); const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); @@ -362,6 +589,9 @@ export class ChannelConfig extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelConfig + */ public clone(): ChannelConfig { const ret: number = bindings.ChannelConfig_clone(this.ptr); const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); @@ -369,6 +599,9 @@ export class ChannelConfig extends CommonBase { return ret_hu_conv; } + /** + * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used. + */ public static constructor_default(): ChannelConfig { const ret: number = bindings.ChannelConfig_default(); const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); @@ -376,12 +609,18 @@ export class ChannelConfig extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelConfig_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ChannelConfig from a byte array, created by ChannelConfig_write + */ public static constructor_read(ser: Uint8Array): Result_ChannelConfigDecodeErrorZ { const ret: number = bindings.ChannelConfig_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ChannelConfigDecodeErrorZ = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ChannelCounterparty.mts b/ts/structs/ChannelCounterparty.mts index 604ff8ed..d115c61e 100644 --- a/ts/structs/ChannelCounterparty.mts +++ b/ts/structs/ChannelCounterparty.mts @@ -281,22 +281,37 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`] + * to better separate parameters. + */ export class ChannelCounterparty extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelCounterparty_free); } + /** + * The node_id of our counterparty + */ public get_node_id(): Uint8Array { const ret: number = bindings.ChannelCounterparty_get_node_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The node_id of our counterparty + */ public set_node_id(val: Uint8Array): void { bindings.ChannelCounterparty_set_node_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The Features the channel counterparty provided upon last connection. + * Useful for routing as it is the most up-to-date copy of the counterparty's features and + * many routing-relevant features are present in the init context. + */ public get_features(): InitFeatures { const ret: number = bindings.ChannelCounterparty_get_features(this.ptr); const ret_hu_conv: InitFeatures = new InitFeatures(null, ret); @@ -304,19 +319,48 @@ export class ChannelCounterparty extends CommonBase { return ret_hu_conv; } + /** + * The Features the channel counterparty provided upon last connection. + * Useful for routing as it is the most up-to-date copy of the counterparty's features and + * many routing-relevant features are present in the init context. + */ public set_features(val: InitFeatures): void { bindings.ChannelCounterparty_set_features(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The value, in satoshis, that must always be held in the channel for our counterparty. This + * value ensures that if our counterparty broadcasts a revoked state, we can punish them by + * claiming at least this value on chain. + * + * This value is not included in [`inbound_capacity_msat`] as it can never be spent. + * + * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat + */ public get_unspendable_punishment_reserve(): bigint { const ret: bigint = bindings.ChannelCounterparty_get_unspendable_punishment_reserve(this.ptr); return ret; } + /** + * The value, in satoshis, that must always be held in the channel for our counterparty. This + * value ensures that if our counterparty broadcasts a revoked state, we can punish them by + * claiming at least this value on chain. + * + * This value is not included in [`inbound_capacity_msat`] as it can never be spent. + * + * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat + */ public set_unspendable_punishment_reserve(val: bigint): void { bindings.ChannelCounterparty_set_unspendable_punishment_reserve(this.ptr, val); } + /** + * Information on the fees and requirements that the counterparty requires when forwarding + * payments to us through this channel. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_forwarding_info(): CounterpartyForwardingInfo { const ret: number = bindings.ChannelCounterparty_get_forwarding_info(this.ptr); const ret_hu_conv: CounterpartyForwardingInfo = new CounterpartyForwardingInfo(null, ret); @@ -324,10 +368,19 @@ export class ChannelCounterparty extends CommonBase { return ret_hu_conv; } + /** + * Information on the fees and requirements that the counterparty requires when forwarding + * payments to us through this channel. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_forwarding_info(val: CounterpartyForwardingInfo): void { bindings.ChannelCounterparty_set_forwarding_info(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new ChannelCounterparty given each field + */ public static constructor_new(node_id_arg: Uint8Array, features_arg: InitFeatures, unspendable_punishment_reserve_arg: bigint, forwarding_info_arg: CounterpartyForwardingInfo): ChannelCounterparty { const ret: number = bindings.ChannelCounterparty_new(bindings.encodeUint8Array(bindings.check_arr_len(node_id_arg, 33)), features_arg == null ? 0 : CommonBase.get_ptr_of(features_arg) & ~1, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : CommonBase.get_ptr_of(forwarding_info_arg) & ~1); const ret_hu_conv: ChannelCounterparty = new ChannelCounterparty(null, ret); @@ -340,6 +393,9 @@ export class ChannelCounterparty extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelCounterparty + */ public clone(): ChannelCounterparty { const ret: number = bindings.ChannelCounterparty_clone(this.ptr); const ret_hu_conv: ChannelCounterparty = new ChannelCounterparty(null, ret); diff --git a/ts/structs/ChannelDetails.mts b/ts/structs/ChannelDetails.mts index 2b1255a8..56ddd58e 100644 --- a/ts/structs/ChannelDetails.mts +++ b/ts/structs/ChannelDetails.mts @@ -281,22 +281,40 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels + */ export class ChannelDetails extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelDetails_free); } + /** + * The channel's ID (prior to funding transaction generation, this is a random 32 bytes, + * thereafter this is the txid of the funding transaction xor the funding transaction output). + * Note that this means this value is *not* persistent - it can change once during the + * lifetime of the channel. + */ public get_channel_id(): Uint8Array { const ret: number = bindings.ChannelDetails_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel's ID (prior to funding transaction generation, this is a random 32 bytes, + * thereafter this is the txid of the funding transaction xor the funding transaction output). + * Note that this means this value is *not* persistent - it can change once during the + * lifetime of the channel. + */ public set_channel_id(val: Uint8Array): void { bindings.ChannelDetails_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Parameters which apply to our counterparty. See individual fields for more information. + */ public get_counterparty(): ChannelCounterparty { const ret: number = bindings.ChannelDetails_get_counterparty(this.ptr); const ret_hu_conv: ChannelCounterparty = new ChannelCounterparty(null, ret); @@ -304,10 +322,22 @@ export class ChannelDetails extends CommonBase { return ret_hu_conv; } + /** + * Parameters which apply to our counterparty. See individual fields for more information. + */ public set_counterparty(val: ChannelCounterparty): void { bindings.ChannelDetails_set_counterparty(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The Channel's funding transaction output, if we've negotiated the funding transaction with + * our counterparty already. + * + * Note that, if this has been set, `channel_id` will be equivalent to + * `funding_txo.unwrap().to_channel_id()`. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_funding_txo(): OutPoint { const ret: number = bindings.ChannelDetails_get_funding_txo(this.ptr); const ret_hu_conv: OutPoint = new OutPoint(null, ret); @@ -315,10 +345,23 @@ export class ChannelDetails extends CommonBase { return ret_hu_conv; } + /** + * The Channel's funding transaction output, if we've negotiated the funding transaction with + * our counterparty already. + * + * Note that, if this has been set, `channel_id` will be equivalent to + * `funding_txo.unwrap().to_channel_id()`. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_funding_txo(val: OutPoint): void { bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The position of the funding transaction in the chain. None if the funding transaction has + * not yet been confirmed and the channel fully opened. + */ public get_short_channel_id(): Option_u64Z { const ret: number = bindings.ChannelDetails_get_short_channel_id(this.ptr); const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret); @@ -326,19 +369,40 @@ export class ChannelDetails extends CommonBase { return ret_hu_conv; } + /** + * The position of the funding transaction in the chain. None if the funding transaction has + * not yet been confirmed and the channel fully opened. + */ public set_short_channel_id(val: Option_u64Z): void { bindings.ChannelDetails_set_short_channel_id(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * The value, in satoshis, of this channel as appears in the funding output + */ public get_channel_value_satoshis(): bigint { const ret: bigint = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr); return ret; } + /** + * The value, in satoshis, of this channel as appears in the funding output + */ public set_channel_value_satoshis(val: bigint): void { bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val); } + /** + * The value, in satoshis, that must always be held in the channel for us. This value ensures + * that if we broadcast a revoked state, our counterparty can punish us by claiming at least + * this value on chain. + * + * This value is not included in [`outbound_capacity_msat`] as it can never be spent. + * + * This value will be `None` for outbound channels until the counterparty accepts the channel. + * + * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat + */ public get_unspendable_punishment_reserve(): Option_u64Z { const ret: number = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr); const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret); @@ -346,46 +410,146 @@ export class ChannelDetails extends CommonBase { return ret_hu_conv; } + /** + * The value, in satoshis, that must always be held in the channel for us. This value ensures + * that if we broadcast a revoked state, our counterparty can punish us by claiming at least + * this value on chain. + * + * This value is not included in [`outbound_capacity_msat`] as it can never be spent. + * + * This value will be `None` for outbound channels until the counterparty accepts the channel. + * + * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat + */ public set_unspendable_punishment_reserve(val: Option_u64Z): void { bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound. + */ public get_user_channel_id(): bigint { const ret: bigint = bindings.ChannelDetails_get_user_channel_id(this.ptr); return ret; } + /** + * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound. + */ public set_user_channel_id(val: bigint): void { bindings.ChannelDetails_set_user_channel_id(this.ptr, val); } + /** + * Our total balance. This is the amount we would get if we close the channel. + * This value is not exact. Due to various in-flight changes and feerate changes, exactly this + * amount is not likely to be recoverable on close. + * + * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose + * balance is not available for inclusion in new outbound HTLCs). This further does not include + * any pending outgoing HTLCs which are awaiting some other resolution to be sent. + * This does not consider any on-chain fees. + * + * See also [`ChannelDetails::outbound_capacity_msat`] + */ public get_balance_msat(): bigint { const ret: bigint = bindings.ChannelDetails_get_balance_msat(this.ptr); return ret; } + /** + * Our total balance. This is the amount we would get if we close the channel. + * This value is not exact. Due to various in-flight changes and feerate changes, exactly this + * amount is not likely to be recoverable on close. + * + * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose + * balance is not available for inclusion in new outbound HTLCs). This further does not include + * any pending outgoing HTLCs which are awaiting some other resolution to be sent. + * This does not consider any on-chain fees. + * + * See also [`ChannelDetails::outbound_capacity_msat`] + */ public set_balance_msat(val: bigint): void { bindings.ChannelDetails_set_balance_msat(this.ptr, val); } + /** + * The available outbound capacity for sending HTLCs to the remote peer. This does not include + * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not + * available for inclusion in new outbound HTLCs). This further does not include any pending + * outgoing HTLCs which are awaiting some other resolution to be sent. + * + * See also [`ChannelDetails::balance_msat`] + * + * This value is not exact. Due to various in-flight changes, feerate changes, and our + * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we + * should be able to spend nearly this amount. + */ public get_outbound_capacity_msat(): bigint { const ret: bigint = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr); return ret; } + /** + * The available outbound capacity for sending HTLCs to the remote peer. This does not include + * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not + * available for inclusion in new outbound HTLCs). This further does not include any pending + * outgoing HTLCs which are awaiting some other resolution to be sent. + * + * See also [`ChannelDetails::balance_msat`] + * + * This value is not exact. Due to various in-flight changes, feerate changes, and our + * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we + * should be able to spend nearly this amount. + */ public set_outbound_capacity_msat(val: bigint): void { bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val); } + /** + * The available inbound capacity for the remote peer to send HTLCs to us. This does not + * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not + * available for inclusion in new inbound HTLCs). + * Note that there are some corner cases not fully handled here, so the actual available + * inbound capacity may be slightly higher than this. + * + * This value is not exact. Due to various in-flight changes, feerate changes, and our + * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable. + * However, our counterparty should be able to spend nearly this amount. + */ public get_inbound_capacity_msat(): bigint { const ret: bigint = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr); return ret; } + /** + * The available inbound capacity for the remote peer to send HTLCs to us. This does not + * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not + * available for inclusion in new inbound HTLCs). + * Note that there are some corner cases not fully handled here, so the actual available + * inbound capacity may be slightly higher than this. + * + * This value is not exact. Due to various in-flight changes, feerate changes, and our + * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable. + * However, our counterparty should be able to spend nearly this amount. + */ public set_inbound_capacity_msat(val: bigint): void { bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val); } + /** + * The number of required confirmations on the funding transaction before the funding will be + * considered \"locked\". This number is selected by the channel fundee (i.e. us if + * [`is_outbound`] is *not* set), and can be selected for inbound channels with + * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with + * [`ChannelHandshakeLimits::max_minimum_depth`]. + * + * This value will be `None` for outbound channels until the counterparty accepts the channel. + * + * [`is_outbound`]: ChannelDetails::is_outbound + * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth + * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth + */ public get_confirmations_required(): Option_u32Z { const ret: number = bindings.ChannelDetails_get_confirmations_required(this.ptr); const ret_hu_conv: Option_u32Z = Option_u32Z.constr_from_ptr(ret); @@ -393,10 +557,32 @@ export class ChannelDetails extends CommonBase { return ret_hu_conv; } + /** + * The number of required confirmations on the funding transaction before the funding will be + * considered \"locked\". This number is selected by the channel fundee (i.e. us if + * [`is_outbound`] is *not* set), and can be selected for inbound channels with + * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with + * [`ChannelHandshakeLimits::max_minimum_depth`]. + * + * This value will be `None` for outbound channels until the counterparty accepts the channel. + * + * [`is_outbound`]: ChannelDetails::is_outbound + * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth + * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth + */ public set_confirmations_required(val: Option_u32Z): void { bindings.ChannelDetails_set_confirmations_required(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * The number of blocks (after our commitment transaction confirms) that we will need to wait + * until we can claim our funds after we force-close the channel. During this time our + * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty + * force-closes the channel and broadcasts a commitment transaction we do not have to wait any + * time to claim our non-HTLC-encumbered funds. + * + * This value will be `None` for outbound channels until the counterparty accepts the channel. + */ public get_force_close_spend_delay(): Option_u16Z { const ret: number = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr); const ret_hu_conv: Option_u16Z = Option_u16Z.constr_from_ptr(ret); @@ -404,46 +590,100 @@ export class ChannelDetails extends CommonBase { return ret_hu_conv; } + /** + * The number of blocks (after our commitment transaction confirms) that we will need to wait + * until we can claim our funds after we force-close the channel. During this time our + * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty + * force-closes the channel and broadcasts a commitment transaction we do not have to wait any + * time to claim our non-HTLC-encumbered funds. + * + * This value will be `None` for outbound channels until the counterparty accepts the channel. + */ public set_force_close_spend_delay(val: Option_u16Z): void { bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * True if the channel was initiated (and thus funded) by us. + */ public get_is_outbound(): boolean { const ret: boolean = bindings.ChannelDetails_get_is_outbound(this.ptr); return ret; } + /** + * True if the channel was initiated (and thus funded) by us. + */ public set_is_outbound(val: boolean): void { bindings.ChannelDetails_set_is_outbound(this.ptr, val); } + /** + * True if the channel is confirmed, funding_locked messages have been exchanged, and the + * channel is not currently being shut down. `funding_locked` message exchange implies the + * required confirmation count has been reached (and we were connected to the peer at some + * point after the funding transaction received enough confirmations). The required + * confirmation count is provided in [`confirmations_required`]. + * + * [`confirmations_required`]: ChannelDetails::confirmations_required + */ public get_is_funding_locked(): boolean { const ret: boolean = bindings.ChannelDetails_get_is_funding_locked(this.ptr); return ret; } + /** + * True if the channel is confirmed, funding_locked messages have been exchanged, and the + * channel is not currently being shut down. `funding_locked` message exchange implies the + * required confirmation count has been reached (and we were connected to the peer at some + * point after the funding transaction received enough confirmations). The required + * confirmation count is provided in [`confirmations_required`]. + * + * [`confirmations_required`]: ChannelDetails::confirmations_required + */ public set_is_funding_locked(val: boolean): void { bindings.ChannelDetails_set_is_funding_locked(this.ptr, val); } + /** + * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) + * the peer is connected, and (c) the channel is not currently negotiating a shutdown. + * + * This is a strict superset of `is_funding_locked`. + */ public get_is_usable(): boolean { const ret: boolean = bindings.ChannelDetails_get_is_usable(this.ptr); return ret; } + /** + * True if the channel is (a) confirmed and funding_locked messages have been exchanged, (b) + * the peer is connected, and (c) the channel is not currently negotiating a shutdown. + * + * This is a strict superset of `is_funding_locked`. + */ public set_is_usable(val: boolean): void { bindings.ChannelDetails_set_is_usable(this.ptr, val); } + /** + * True if this channel is (or will be) publicly-announced. + */ public get_is_public(): boolean { const ret: boolean = bindings.ChannelDetails_get_is_public(this.ptr); return ret; } + /** + * True if this channel is (or will be) publicly-announced. + */ public set_is_public(val: boolean): void { bindings.ChannelDetails_set_is_public(this.ptr, val); } + /** + * Constructs a new ChannelDetails given each field + */ public static constructor_new(channel_id_arg: Uint8Array, counterparty_arg: ChannelCounterparty, funding_txo_arg: OutPoint, short_channel_id_arg: Option_u64Z, channel_value_satoshis_arg: bigint, unspendable_punishment_reserve_arg: Option_u64Z, user_channel_id_arg: bigint, balance_msat_arg: bigint, outbound_capacity_msat_arg: bigint, inbound_capacity_msat_arg: bigint, confirmations_required_arg: Option_u32Z, force_close_spend_delay_arg: Option_u16Z, is_outbound_arg: boolean, is_funding_locked_arg: boolean, is_usable_arg: boolean, is_public_arg: boolean): ChannelDetails { const ret: number = bindings.ChannelDetails_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), counterparty_arg == null ? 0 : CommonBase.get_ptr_of(counterparty_arg) & ~1, funding_txo_arg == null ? 0 : CommonBase.get_ptr_of(funding_txo_arg) & ~1, CommonBase.get_ptr_of(short_channel_id_arg), channel_value_satoshis_arg, CommonBase.get_ptr_of(unspendable_punishment_reserve_arg), user_channel_id_arg, balance_msat_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, CommonBase.get_ptr_of(confirmations_required_arg), CommonBase.get_ptr_of(force_close_spend_delay_arg), is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg); const ret_hu_conv: ChannelDetails = new ChannelDetails(null, ret); @@ -456,6 +696,9 @@ export class ChannelDetails extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelDetails + */ public clone(): ChannelDetails { const ret: number = bindings.ChannelDetails_clone(this.ptr); const ret_hu_conv: ChannelDetails = new ChannelDetails(null, ret); diff --git a/ts/structs/ChannelFeatures.mts b/ts/structs/ChannelFeatures.mts index 32db32d9..94a42dcb 100644 --- a/ts/structs/ChannelFeatures.mts +++ b/ts/structs/ChannelFeatures.mts @@ -281,12 +281,20 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Features used within a `channel_announcement` message. + */ export class ChannelFeatures extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelFeatures_free); } + /** + * Checks if two ChannelFeaturess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: ChannelFeatures): boolean { const ret: boolean = bindings.ChannelFeatures_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); @@ -298,6 +306,9 @@ export class ChannelFeatures extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelFeatures + */ public clone(): ChannelFeatures { const ret: number = bindings.ChannelFeatures_clone(this.ptr); const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret); @@ -305,6 +316,9 @@ export class ChannelFeatures extends CommonBase { return ret_hu_conv; } + /** + * Create a blank Features with no features set + */ public static constructor_empty(): ChannelFeatures { const ret: number = bindings.ChannelFeatures_empty(); const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret); @@ -312,6 +326,9 @@ export class ChannelFeatures extends CommonBase { return ret_hu_conv; } + /** + * Creates a Features with the bits set which are known by the implementation + */ public static constructor_known(): ChannelFeatures { const ret: number = bindings.ChannelFeatures_known(); const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret); @@ -319,17 +336,27 @@ export class ChannelFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns true if this `Features` object contains unknown feature flags which are set as + * \"required\". + */ public requires_unknown_bits(): boolean { const ret: boolean = bindings.ChannelFeatures_requires_unknown_bits(this.ptr); return ret; } + /** + * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelFeatures_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write + */ public static constructor_read(ser: Uint8Array): Result_ChannelFeaturesDecodeErrorZ { const ret: number = bindings.ChannelFeatures_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ChannelFeaturesDecodeErrorZ = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ChannelHandshakeConfig.mts b/ts/structs/ChannelHandshakeConfig.mts index d2f7c914..22b11aad 100644 --- a/ts/structs/ChannelHandshakeConfig.mts +++ b/ts/structs/ChannelHandshakeConfig.mts @@ -281,39 +281,113 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Configuration we set when applicable. + * + * Default::default() provides sane defaults. + */ export class ChannelHandshakeConfig extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelHandshakeConfig_free); } + /** + * Confirmations we will wait for before considering the channel locked in. + * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the + * equivalent limit applied to outbound channels). + * + * Default value: 6. + */ public get_minimum_depth(): number { const ret: number = bindings.ChannelHandshakeConfig_get_minimum_depth(this.ptr); return ret; } + /** + * Confirmations we will wait for before considering the channel locked in. + * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the + * equivalent limit applied to outbound channels). + * + * Default value: 6. + */ public set_minimum_depth(val: number): void { bindings.ChannelHandshakeConfig_set_minimum_depth(this.ptr, val); } + /** + * Set to the number of blocks we require our counterparty to wait to claim their money (ie + * the number of blocks we have to punish our counterparty if they broadcast a revoked + * transaction). + * + * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST + * be online to check for revoked transactions on-chain at least once every our_to_self_delay + * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction, + * possibly with time in between to RBF the spending transaction). + * + * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in + * case of an honest unilateral channel close, which implicitly decrease the economic value of + * our channel. + * + * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you + * can tweak config to ask for more security, not less. + */ public get_our_to_self_delay(): number { const ret: number = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr); return ret; } + /** + * Set to the number of blocks we require our counterparty to wait to claim their money (ie + * the number of blocks we have to punish our counterparty if they broadcast a revoked + * transaction). + * + * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST + * be online to check for revoked transactions on-chain at least once every our_to_self_delay + * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction, + * possibly with time in between to RBF the spending transaction). + * + * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in + * case of an honest unilateral channel close, which implicitly decrease the economic value of + * our channel. + * + * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you + * can tweak config to ask for more security, not less. + */ public set_our_to_self_delay(val: number): void { bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val); } + /** + * Set to the smallest value HTLC we will accept to process. + * + * This value is sent to our counterparty on channel-open and we close the channel any time + * our counterparty misbehaves by sending us an HTLC with a value smaller than this. + * + * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required + * by the protocol. + */ public get_our_htlc_minimum_msat(): bigint { const ret: bigint = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this.ptr); return ret; } + /** + * Set to the smallest value HTLC we will accept to process. + * + * This value is sent to our counterparty on channel-open and we close the channel any time + * our counterparty misbehaves by sending us an HTLC with a value smaller than this. + * + * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required + * by the protocol. + */ public set_our_htlc_minimum_msat(val: bigint): void { bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this.ptr, val); } + /** + * Constructs a new ChannelHandshakeConfig given each field + */ public static constructor_new(minimum_depth_arg: number, our_to_self_delay_arg: number, our_htlc_minimum_msat_arg: bigint): ChannelHandshakeConfig { const ret: number = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); @@ -326,6 +400,9 @@ export class ChannelHandshakeConfig extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelHandshakeConfig + */ public clone(): ChannelHandshakeConfig { const ret: number = bindings.ChannelHandshakeConfig_clone(this.ptr); const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); @@ -333,6 +410,9 @@ export class ChannelHandshakeConfig extends CommonBase { return ret_hu_conv; } + /** + * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used. + */ public static constructor_default(): ChannelHandshakeConfig { const ret: number = bindings.ChannelHandshakeConfig_default(); const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); diff --git a/ts/structs/ChannelHandshakeLimits.mts b/ts/structs/ChannelHandshakeLimits.mts index 37184a2c..fe24a78d 100644 --- a/ts/structs/ChannelHandshakeLimits.mts +++ b/ts/structs/ChannelHandshakeLimits.mts @@ -281,84 +281,216 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Optional channel limits which are applied during channel creation. + * + * These limits are only applied to our counterparty's limits, not our own. + * + * Use 0/::max_value() as appropriate to skip checking. + * + * Provides sane defaults for most configurations. + * + * Most additional limits are disabled except those with which specify a default in individual + * field documentation. Note that this may result in barely-usable channels, but since they + * are applied mostly only to incoming channels that's not much of a problem. + */ export class ChannelHandshakeLimits extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelHandshakeLimits_free); } + /** + * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so + * only applies to inbound channels. + * + * Default value: 0. + */ public get_min_funding_satoshis(): bigint { const ret: bigint = bindings.ChannelHandshakeLimits_get_min_funding_satoshis(this.ptr); return ret; } + /** + * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so + * only applies to inbound channels. + * + * Default value: 0. + */ public set_min_funding_satoshis(val: bigint): void { bindings.ChannelHandshakeLimits_set_min_funding_satoshis(this.ptr, val); } + /** + * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows + * you to limit the maximum minimum-size they can require. + * + * Default value: u64::max_value. + */ public get_max_htlc_minimum_msat(): bigint { const ret: bigint = bindings.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this.ptr); return ret; } + /** + * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows + * you to limit the maximum minimum-size they can require. + * + * Default value: u64::max_value. + */ public set_max_htlc_minimum_msat(val: bigint): void { bindings.ChannelHandshakeLimits_set_max_htlc_minimum_msat(this.ptr, val); } + /** + * The remote node sets a limit on the maximum value of pending HTLCs to them at any given + * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value. + * + * Default value: 0. + */ public get_min_max_htlc_value_in_flight_msat(): bigint { const ret: bigint = bindings.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this.ptr); return ret; } + /** + * The remote node sets a limit on the maximum value of pending HTLCs to them at any given + * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value. + * + * Default value: 0. + */ public set_min_max_htlc_value_in_flight_msat(val: bigint): void { bindings.ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this.ptr, val); } + /** + * The remote node will require we keep a certain amount in direct payment to ourselves at all + * time, ensuring that we are able to be punished if we broadcast an old state. This allows to + * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs). + * + * Default value: u64::max_value. + */ public get_max_channel_reserve_satoshis(): bigint { const ret: bigint = bindings.ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this.ptr); return ret; } + /** + * The remote node will require we keep a certain amount in direct payment to ourselves at all + * time, ensuring that we are able to be punished if we broadcast an old state. This allows to + * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs). + * + * Default value: u64::max_value. + */ public set_max_channel_reserve_satoshis(val: bigint): void { bindings.ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this.ptr, val); } + /** + * The remote node sets a limit on the maximum number of pending HTLCs to them at any given + * time. This allows you to set a minimum such value. + * + * Default value: 0. + */ public get_min_max_accepted_htlcs(): number { const ret: number = bindings.ChannelHandshakeLimits_get_min_max_accepted_htlcs(this.ptr); return ret; } + /** + * The remote node sets a limit on the maximum number of pending HTLCs to them at any given + * time. This allows you to set a minimum such value. + * + * Default value: 0. + */ public set_min_max_accepted_htlcs(val: number): void { bindings.ChannelHandshakeLimits_set_min_max_accepted_htlcs(this.ptr, val); } + /** + * Before a channel is usable the funding transaction will need to be confirmed by at least a + * certain number of blocks, specified by the node which is not the funder (as the funder can + * assume they aren't going to double-spend themselves). + * This config allows you to set a limit on the maximum amount of time to wait. + * + * Default value: 144, or roughly one day and only applies to outbound channels. + */ public get_max_minimum_depth(): number { const ret: number = bindings.ChannelHandshakeLimits_get_max_minimum_depth(this.ptr); return ret; } + /** + * Before a channel is usable the funding transaction will need to be confirmed by at least a + * certain number of blocks, specified by the node which is not the funder (as the funder can + * assume they aren't going to double-spend themselves). + * This config allows you to set a limit on the maximum amount of time to wait. + * + * Default value: 144, or roughly one day and only applies to outbound channels. + */ public set_max_minimum_depth(val: number): void { bindings.ChannelHandshakeLimits_set_max_minimum_depth(this.ptr, val); } + /** + * Set to force an incoming channel to match our announced channel preference in + * [`ChannelConfig::announced_channel`]. + * + * For a node which is not online reliably, this should be set to true and + * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public) + * channels will ever be opened. + * + * Default value: true. + */ public get_force_announced_channel_preference(): boolean { const ret: boolean = bindings.ChannelHandshakeLimits_get_force_announced_channel_preference(this.ptr); return ret; } + /** + * Set to force an incoming channel to match our announced channel preference in + * [`ChannelConfig::announced_channel`]. + * + * For a node which is not online reliably, this should be set to true and + * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public) + * channels will ever be opened. + * + * Default value: true. + */ public set_force_announced_channel_preference(val: boolean): void { bindings.ChannelHandshakeLimits_set_force_announced_channel_preference(this.ptr, val); } + /** + * Set to the amount of time we're willing to wait to claim money back to us. + * + * Not checking this value would be a security issue, as our peer would be able to set it to + * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time. + * + * Default value: 2016, which we also enforce as a maximum value so you can tweak config to + * reduce the loss of having useless locked funds (if your peer accepts) + */ public get_their_to_self_delay(): number { const ret: number = bindings.ChannelHandshakeLimits_get_their_to_self_delay(this.ptr); return ret; } + /** + * Set to the amount of time we're willing to wait to claim money back to us. + * + * Not checking this value would be a security issue, as our peer would be able to set it to + * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time. + * + * Default value: 2016, which we also enforce as a maximum value so you can tweak config to + * reduce the loss of having useless locked funds (if your peer accepts) + */ public set_their_to_self_delay(val: number): void { bindings.ChannelHandshakeLimits_set_their_to_self_delay(this.ptr, val); } + /** + * Constructs a new ChannelHandshakeLimits given each field + */ public static constructor_new(min_funding_satoshis_arg: bigint, max_htlc_minimum_msat_arg: bigint, min_max_htlc_value_in_flight_msat_arg: bigint, max_channel_reserve_satoshis_arg: bigint, min_max_accepted_htlcs_arg: number, max_minimum_depth_arg: number, force_announced_channel_preference_arg: boolean, their_to_self_delay_arg: number): ChannelHandshakeLimits { const ret: number = bindings.ChannelHandshakeLimits_new(min_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, force_announced_channel_preference_arg, their_to_self_delay_arg); const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret); @@ -371,6 +503,9 @@ export class ChannelHandshakeLimits extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelHandshakeLimits + */ public clone(): ChannelHandshakeLimits { const ret: number = bindings.ChannelHandshakeLimits_clone(this.ptr); const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret); @@ -378,6 +513,9 @@ export class ChannelHandshakeLimits extends CommonBase { return ret_hu_conv; } + /** + * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used. + */ public static constructor_default(): ChannelHandshakeLimits { const ret: number = bindings.ChannelHandshakeLimits_default(); const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret); diff --git a/ts/structs/ChannelInfo.mts b/ts/structs/ChannelInfo.mts index 27d1fa2c..d130ab6d 100644 --- a/ts/structs/ChannelInfo.mts +++ b/ts/structs/ChannelInfo.mts @@ -281,12 +281,19 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Details about a channel (both directions). + * Received within a channel announcement. + */ export class ChannelInfo extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelInfo_free); } + /** + * Protocol features of a channel communicated during its announcement + */ public get_features(): ChannelFeatures { const ret: number = bindings.ChannelInfo_get_features(this.ptr); const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret); @@ -294,10 +301,16 @@ export class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Protocol features of a channel communicated during its announcement + */ public set_features(val: ChannelFeatures): void { bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Source node of the first direction of a channel + */ public get_node_one(): NodeId { const ret: number = bindings.ChannelInfo_get_node_one(this.ptr); const ret_hu_conv: NodeId = new NodeId(null, ret); @@ -305,10 +318,18 @@ export class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Source node of the first direction of a channel + */ public set_node_one(val: NodeId): void { bindings.ChannelInfo_set_node_one(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Details about the first direction of a channel + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_one_to_two(): DirectionalChannelInfo { const ret: number = bindings.ChannelInfo_get_one_to_two(this.ptr); const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret); @@ -316,10 +337,18 @@ export class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Details about the first direction of a channel + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_one_to_two(val: DirectionalChannelInfo): void { bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Source node of the second direction of a channel + */ public get_node_two(): NodeId { const ret: number = bindings.ChannelInfo_get_node_two(this.ptr); const ret_hu_conv: NodeId = new NodeId(null, ret); @@ -327,10 +356,18 @@ export class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Source node of the second direction of a channel + */ public set_node_two(val: NodeId): void { bindings.ChannelInfo_set_node_two(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Details about the second direction of a channel + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_two_to_one(): DirectionalChannelInfo { const ret: number = bindings.ChannelInfo_get_two_to_one(this.ptr); const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret); @@ -338,10 +375,18 @@ export class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Details about the second direction of a channel + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_two_to_one(val: DirectionalChannelInfo): void { bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The channel capacity as seen on-chain, if chain lookup is available. + */ public get_capacity_sats(): Option_u64Z { const ret: number = bindings.ChannelInfo_get_capacity_sats(this.ptr); const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret); @@ -349,10 +394,21 @@ export class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * The channel capacity as seen on-chain, if chain lookup is available. + */ public set_capacity_sats(val: Option_u64Z): void { bindings.ChannelInfo_set_capacity_sats(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * An initial announcement of the channel + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_announcement_message(): ChannelAnnouncement { const ret: number = bindings.ChannelInfo_get_announcement_message(this.ptr); const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); @@ -360,6 +416,14 @@ export class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * An initial announcement of the channel + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_announcement_message(val: ChannelAnnouncement): void { bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } @@ -369,6 +433,9 @@ export class ChannelInfo extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelInfo + */ public clone(): ChannelInfo { const ret: number = bindings.ChannelInfo_clone(this.ptr); const ret_hu_conv: ChannelInfo = new ChannelInfo(null, ret); @@ -376,12 +443,18 @@ export class ChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelInfo_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ChannelInfo from a byte array, created by ChannelInfo_write + */ public static constructor_read(ser: Uint8Array): Result_ChannelInfoDecodeErrorZ { const ret: number = bindings.ChannelInfo_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ChannelInfoDecodeErrorZ = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ChannelManager.mts b/ts/structs/ChannelManager.mts index cd4207ba..5c4da066 100644 --- a/ts/structs/ChannelManager.mts +++ b/ts/structs/ChannelManager.mts @@ -281,12 +281,64 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Manager which keeps track of a number of channels and sends messages to the appropriate + * channel, also tracking HTLC preimages and forwarding onion packets appropriately. + * + * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through + * to individual Channels. + * + * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for + * all peers during write/read (though does not modify this instance, only the instance being + * serialized). This will result in any channels which have not yet exchanged funding_created (ie + * called funding_transaction_generated for outbound channels). + * + * Note that you can be a bit lazier about writing out ChannelManager than you can be with + * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before + * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates + * happens out-of-band (and will prevent any other ChannelManager operations from occurring during + * the serialization process). If the deserialized version is out-of-date compared to the + * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the + * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees). + * + * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which + * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along + * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call + * block_connected() to step towards your best block) upon deserialization before using the + * object! + * + * Note that ChannelManager is responsible for tracking liveness of its channels and generating + * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid + * spam due to quick disconnection/reconnection, updates are not sent until the channel has been + * offline for a full minute. In order to track this, you must call + * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect. + * + * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager + * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but + * essentially you should default to using a SimpleRefChannelManager, and use a + * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when + * you're using lightning-net-tokio. + */ export class ChannelManager extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelManager_free); } + /** + * Constructs a new ChannelManager to hold several channels and route between them. + * + * This is the main \"logic hub\" for all channel-related actions, and implements + * ChannelMessageHandler. + * + * Non-proportional fees are fixed according to our risk using the provided fee estimator. + * + * panics if channel_value_satoshis is >= `MAX_FUNDING_SATOSHIS`! + * + * Users need to notify the new ChannelManager when a new block is connected or + * disconnected using its `block_connected` and `block_disconnected` methods, starting + * from after `params.latest_hash`. + */ public static constructor_new(fee_est: FeeEstimator, chain_monitor: Watch, tx_broadcaster: BroadcasterInterface, logger: Logger, keys_manager: KeysInterface, config: UserConfig, params: ChainParameters): ChannelManager { const ret: number = bindings.ChannelManager_new(fee_est == null ? 0 : CommonBase.get_ptr_of(fee_est), chain_monitor == null ? 0 : CommonBase.get_ptr_of(chain_monitor), tx_broadcaster == null ? 0 : CommonBase.get_ptr_of(tx_broadcaster), logger == null ? 0 : CommonBase.get_ptr_of(logger), keys_manager == null ? 0 : CommonBase.get_ptr_of(keys_manager), config == null ? 0 : CommonBase.get_ptr_of(config) & ~1, params == null ? 0 : CommonBase.get_ptr_of(params) & ~1); const ret_hu_conv: ChannelManager = new ChannelManager(null, ret); @@ -299,6 +351,9 @@ export class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Gets the current configuration applied to all new channels, as + */ public get_current_default_configuration(): UserConfig { const ret: number = bindings.ChannelManager_get_current_default_configuration(this.ptr); const ret_hu_conv: UserConfig = new UserConfig(null, ret); @@ -306,12 +361,46 @@ export class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Creates a new outbound channel to the given remote node and with the given value. + * + * `user_channel_id` will be provided back as in + * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events + * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0 + * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here. + * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise + * ignored. + * + * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is + * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`. + * + * Note that we do not check if you are currently connected to the given peer. If no + * connection is available, the outbound `open_channel` message may fail to send, resulting in + * the channel eventually being silently forgotten (dropped on reload). + * + * Returns the new Channel's temporary `channel_id`. This ID will appear as + * [`Event::FundingGenerationReady::temporary_channel_id`] and in + * [`ChannelDetails::channel_id`] until after + * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for + * one derived from the funding transaction's TXID. If the counterparty rejects the channel + * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`]. + * + * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id + * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id + * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id + * + * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public create_channel(their_network_key: Uint8Array, channel_value_satoshis: bigint, push_msat: bigint, user_channel_id: bigint, override_config: UserConfig): Result__u832APIErrorZ { const ret: number = bindings.ChannelManager_create_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_network_key, 33)), channel_value_satoshis, push_msat, user_channel_id, override_config == null ? 0 : CommonBase.get_ptr_of(override_config) & ~1); const ret_hu_conv: Result__u832APIErrorZ = Result__u832APIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Gets the list of open channels, in random order. See ChannelDetail field documentation for + * more information. + */ public list_channels(): ChannelDetails[] { const ret: number = bindings.ChannelManager_list_channels(this.ptr); const ret_conv_16_len: number = bindings.getArrayLength(ret); @@ -322,9 +411,18 @@ export class ChannelManager extends CommonBase { CommonBase.add_ref_from(ret_conv_16_hu_conv, this); ret_conv_16_arr[q] = ret_conv_16_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_16_arr; } + /** + * Gets the list of usable channels, in random order. Useful as an argument to + * get_route to ensure non-announced channels are used. + * + * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the + * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria + * are. + */ public list_usable_channels(): ChannelDetails[] { const ret: number = bindings.ChannelManager_list_usable_channels(this.ptr); const ret_conv_16_len: number = bindings.getArrayLength(ret); @@ -335,31 +433,123 @@ export class ChannelManager extends CommonBase { CommonBase.add_ref_from(ret_conv_16_hu_conv, this); ret_conv_16_arr[q] = ret_conv_16_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_16_arr; } + /** + * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs + * will be accepted on the given channel, and after additional timeout/the closing of all + * pending HTLCs, the channel will be closed on chain. + * + * If we are the channel initiator, we will pay between our [`Background`] and + * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee + * estimate. + * If our counterparty is the channel initiator, we will require a channel closing + * transaction feerate of at least our [`Background`] feerate or the feerate which + * would appear on a force-closure transaction, whichever is lower. We will allow our + * counterparty to pay as much fee as they'd like, however. + * + * May generate a SendShutdown message event on success, which should be relayed. + * + * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis + * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background + * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal + */ public close_channel(channel_id: Uint8Array): Result_NoneAPIErrorZ { const ret: number = bindings.ChannelManager_close_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32))); const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs + * will be accepted on the given channel, and after additional timeout/the closing of all + * pending HTLCs, the channel will be closed on chain. + * + * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated + * the channel being closed or not: + * If we are the channel initiator, we will pay at least this feerate on the closing + * transaction. The upper-bound is set by + * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee + * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater). + * If our counterparty is the channel initiator, we will refuse to accept a channel closure + * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which + * will appear on a force-closure transaction, whichever is lower). + * + * May generate a SendShutdown message event on success, which should be relayed. + * + * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis + * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background + * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal + */ public close_channel_with_target_feerate(channel_id: Uint8Array, target_feerate_sats_per_1000_weight: number): Result_NoneAPIErrorZ { const ret: number = bindings.ChannelManager_close_channel_with_target_feerate(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), target_feerate_sats_per_1000_weight); const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Force closes a channel, immediately broadcasting the latest local commitment transaction to + * the chain and rejecting new HTLCs on the given channel. Fails if channel_id is unknown to the manager. + */ public force_close_channel(channel_id: Uint8Array): Result_NoneAPIErrorZ { const ret: number = bindings.ChannelManager_force_close_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32))); const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Force close all channels, immediately broadcasting the latest local commitment transaction + * for each to the chain and rejecting new HTLCs on each. + */ public force_close_all_channels(): void { bindings.ChannelManager_force_close_all_channels(this.ptr); } + /** + * Sends a payment along a given route. + * + * Value parameters are provided via the last hop in route, see documentation for RouteHop + * fields for more info. + * + * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative + * payment), we don't do anything to stop you! We always try to ensure that if the provided + * next hop knows the preimage to payment_hash they can claim an additional amount as + * specified in the last hop in the route! Thus, you should probably do your own + * payment_preimage tracking (which you should already be doing as they represent \"proof of + * payment\") and prevent double-sends yourself. + * + * May generate SendHTLCs message(s) event on success, which should be relayed. + * + * Each path may have a different return value, and PaymentSendValue may return a Vec with + * each entry matching the corresponding-index entry in the route paths, see + * PaymentSendFailure for more info. + * + * In general, a path may raise: + * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee, + * node public key) is specified. + * APIError::ChannelUnavailable if the next-hop channel is not available for updates + * (including due to previous monitor update failure or new permanent monitor update + * failure). + * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the + * relevant updates. + * + * Note that depending on the type of the PaymentSendFailure the HTLC may have been + * irrevocably committed to on our end. In such a case, do NOT retry the payment with a + * different route unless you intend to pay twice! + * + * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate + * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For + * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route + * must not contain multiple paths as multi-path payments require a recipient-provided + * payment_secret. + * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature + * bit set (either as required or as available). If multiple paths are present in the Route, + * we assume the invoice had the basic_mpp feature set. + * + * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public send_payment(route: Route, payment_hash: Uint8Array, payment_secret: Uint8Array): Result_PaymentIdPaymentSendFailureZ { const ret: number = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : CommonBase.get_ptr_of(route) & ~1, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_secret, 32))); const ret_hu_conv: Result_PaymentIdPaymentSendFailureZ = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); @@ -367,6 +557,18 @@ export class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Retries a payment along the given [`Route`]. + * + * Errors returned are a superset of those returned from [`send_payment`], so see + * [`send_payment`] documentation for more details on errors. This method will also error if the + * retry amount puts the payment more than 10% over the payment's total amount, if the payment + * for the given `payment_id` cannot be found (likely due to timeout or success), or if + * further retries have been disabled with [`abandon_payment`]. + * + * [`send_payment`]: [`ChannelManager::send_payment`] + * [`abandon_payment`]: [`ChannelManager::abandon_payment`] + */ public retry_payment(route: Route, payment_id: Uint8Array): Result_NonePaymentSendFailureZ { const ret: number = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : CommonBase.get_ptr_of(route) & ~1, bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32))); const ret_hu_conv: Result_NonePaymentSendFailureZ = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); @@ -374,10 +576,44 @@ export class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Signals that no further retries for the given payment will occur. + * + * After this method returns, any future calls to [`retry_payment`] for the given `payment_id` + * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated, + * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining + * pending HTLCs for this payment. + * + * Note that calling this method does *not* prevent a payment from succeeding. You must still + * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to + * determine the ultimate status of a payment. + * + * [`retry_payment`]: Self::retry_payment + * [`Event::PaymentFailed`]: events::Event::PaymentFailed + * [`Event::PaymentSent`]: events::Event::PaymentSent + */ public abandon_payment(payment_id: Uint8Array): void { bindings.ChannelManager_abandon_payment(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32))); } + /** + * Send a spontaneous payment, which is a payment that does not require the recipient to have + * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify + * the preimage, it must be a cryptographically secure random value that no intermediate node + * would be able to guess -- otherwise, an intermediate node may claim the payment and it will + * never reach the recipient. + * + * See [`send_payment`] documentation for more details on the return value of this function. + * + * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See + * [`send_payment`] for more information about the risks of duplicate preimage usage. + * + * Note that `route` must have exactly one path. + * + * [`send_payment`]: Self::send_payment + * + * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public send_spontaneous_payment(route: Route, payment_preimage: Uint8Array): Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ { const ret: number = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : CommonBase.get_ptr_of(route) & ~1, bindings.encodeUint8Array(bindings.check_arr_len(payment_preimage, 32))); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret); @@ -385,70 +621,262 @@ export class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Call this upon creation of a funding transaction for the given channel. + * + * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs + * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`]. + * + * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided + * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`]. + * + * May panic if the output found in the funding transaction is duplicative with some other + * channel (note that this should be trivially prevented by using unique funding transaction + * keys per-channel). + * + * Do NOT broadcast the funding transaction yourself. When we have safely received our + * counterparty's signature the funding transaction will automatically be broadcast via the + * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed. + * + * Note that this includes RBF or similar transaction replacement strategies - lightning does + * not currently support replacing a funding transaction on an existing channel. Instead, + * create a new channel with a conflicting funding transaction. + * + * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady + * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed + */ public funding_transaction_generated(temporary_channel_id: Uint8Array, funding_transaction: Uint8Array): Result_NoneAPIErrorZ { const ret: number = bindings.ChannelManager_funding_transaction_generated(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(temporary_channel_id, 32)), bindings.encodeUint8Array(funding_transaction)); const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Regenerates channel_announcements and generates a signed node_announcement from the given + * arguments, providing them in corresponding events via + * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed + * on-chain. This effectively re-broadcasts all channel announcements and sends our node + * announcement to ensure that the lightning P2P network is aware of the channels we have and + * our network addresses. + * + * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this + * node to humans. They carry no in-protocol meaning. + * + * `addresses` represent the set (possibly empty) of socket addresses on which this node + * accepts incoming connections. These will be included in the node_announcement, publicly + * tying these addresses together and to this node. If you wish to preserve user privacy, + * addresses should likely contain only Tor Onion addresses. + * + * Panics if `addresses` is absurdly large (more than 500). + * + * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events + */ public broadcast_node_announcement(rgb: Uint8Array, alias: Uint8Array, addresses: NetAddress[]): void { bindings.ChannelManager_broadcast_node_announcement(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(rgb, 3)), bindings.encodeUint8Array(bindings.check_arr_len(alias, 32)), bindings.encodeUint32Array(addresses != null ? addresses.map(addresses_conv_12 => CommonBase.get_ptr_of(addresses_conv_12)) : null)); } + /** + * Processes HTLCs which are pending waiting on random forward delay. + * + * Should only really ever be called in response to a PendingHTLCsForwardable event. + * Will likely generate further events. + */ public process_pending_htlc_forwards(): void { bindings.ChannelManager_process_pending_htlc_forwards(this.ptr); } + /** + * Performs actions which should happen on startup and roughly once per minute thereafter. + * + * This currently includes: + * Increasing or decreasing the on-chain feerate estimates for our outbound channels, + * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more + * than a minute, informing the network that they should no longer attempt to route over + * the channel. + * + * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate + * estimate fetches. + */ public timer_tick_occurred(): void { bindings.ChannelManager_timer_tick_occurred(this.ptr); } + /** + * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect + * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources + * along the path (including in our own channel on which we received it). + * Returns false if no payment was found to fail backwards, true if the process of failing the + * HTLC backwards has been started. + */ public fail_htlc_backwards(payment_hash: Uint8Array): boolean { const ret: boolean = bindings.ChannelManager_fail_htlc_backwards(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32))); return ret; } + /** + * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any + * [`MessageSendEvent`]s needed to claim the payment. + * + * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or + * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived` + * event matches your expectation. If you fail to do so and call this method, you may provide + * the sender \"proof-of-payment\" when they did not fulfill the full expected payment. + * + * Returns whether any HTLCs were claimed, and thus if any new [`MessageSendEvent`]s are now + * pending for processing via [`get_and_clear_pending_msg_events`]. + * + * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived + * [`create_inbound_payment`]: Self::create_inbound_payment + * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash + * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events + */ public claim_funds(payment_preimage: Uint8Array): boolean { const ret: boolean = bindings.ChannelManager_claim_funds(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_preimage, 32))); return ret; } + /** + * Gets the node_id held by this ChannelManager + */ public get_our_node_id(): Uint8Array { const ret: number = bindings.ChannelManager_get_our_node_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Gets a payment secret and payment hash for use in an invoice given to a third party wishing + * to pay us. + * + * This differs from [`create_inbound_payment_for_hash`] only in that it generates the + * [`PaymentHash`] and [`PaymentPreimage`] for you. + * + * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which + * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be + * passed directly to [`claim_funds`]. + * + * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements. + * + * Note that a malicious eavesdropper can intuit whether an inbound payment was created by + * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime. + * + * # Note + * + * If you register an inbound payment with this method, then serialize the `ChannelManager`, then + * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received. + * + * Errors if `min_value_msat` is greater than total bitcoin supply. + * + * [`claim_funds`]: Self::claim_funds + * [`PaymentReceived`]: events::Event::PaymentReceived + * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage + * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash + */ public create_inbound_payment(min_value_msat: Option_u64Z, invoice_expiry_delta_secs: number): Result_C2Tuple_PaymentHashPaymentSecretZNoneZ { const ret: number = bindings.ChannelManager_create_inbound_payment(this.ptr, CommonBase.get_ptr_of(min_value_msat), invoice_expiry_delta_secs); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentSecretZNoneZ = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share + * serialized state with LDK node(s) running 0.0.103 and earlier. + * + * # Note + * This method is deprecated and will be removed soon. + * + * [`create_inbound_payment`]: Self::create_inbound_payment + */ public create_inbound_payment_legacy(min_value_msat: Option_u64Z, invoice_expiry_delta_secs: number): Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ { const ret: number = bindings.ChannelManager_create_inbound_payment_legacy(this.ptr, CommonBase.get_ptr_of(min_value_msat), invoice_expiry_delta_secs); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is + * stored external to LDK. + * + * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a + * payment secret fetched via this method or [`create_inbound_payment`], and which is at least + * the `min_value_msat` provided here, if one is provided. + * + * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though + * note that LDK will not stop you from registering duplicate payment hashes for inbound + * payments. + * + * `min_value_msat` should be set if the invoice being generated contains a value. Any payment + * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat` + * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the + * sender \"proof-of-payment\" unless they have paid the required amount. + * + * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for + * in excess of the current time. This should roughly match the expiry time set in the invoice. + * After this many seconds, we will remove the inbound payment, resulting in any attempts to + * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for + * invoices when no timeout is set. + * + * Note that we use block header time to time-out pending inbound payments (with some margin + * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will + * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry. + * If you need exact expiry semantics, you should enforce them upon receipt of + * [`PaymentReceived`]. + * + * May panic if `invoice_expiry_delta_secs` is greater than one year. + * + * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry` + * set to at least [`MIN_FINAL_CLTV_EXPIRY`]. + * + * Note that a malicious eavesdropper can intuit whether an inbound payment was created by + * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime. + * + * # Note + * + * If you register an inbound payment with this method, then serialize the `ChannelManager`, then + * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received. + * + * Errors if `min_value_msat` is greater than total bitcoin supply. + * + * [`create_inbound_payment`]: Self::create_inbound_payment + * [`PaymentReceived`]: events::Event::PaymentReceived + */ public create_inbound_payment_for_hash(payment_hash: Uint8Array, min_value_msat: Option_u64Z, invoice_expiry_delta_secs: number): Result_PaymentSecretNoneZ { const ret: number = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), CommonBase.get_ptr_of(min_value_msat), invoice_expiry_delta_secs); const ret_hu_conv: Result_PaymentSecretNoneZ = Result_PaymentSecretNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share + * serialized state with LDK node(s) running 0.0.103 and earlier. + * + * # Note + * This method is deprecated and will be removed soon. + * + * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash + */ public create_inbound_payment_for_hash_legacy(payment_hash: Uint8Array, min_value_msat: Option_u64Z, invoice_expiry_delta_secs: number): Result_PaymentSecretAPIErrorZ { const ret: number = bindings.ChannelManager_create_inbound_payment_for_hash_legacy(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), CommonBase.get_ptr_of(min_value_msat), invoice_expiry_delta_secs); const ret_hu_conv: Result_PaymentSecretAPIErrorZ = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Gets an LDK-generated payment preimage from a payment hash and payment secret that were + * previously returned from [`create_inbound_payment`]. + * + * [`create_inbound_payment`]: Self::create_inbound_payment + */ public get_payment_preimage(payment_hash: Uint8Array, payment_secret: Uint8Array): Result_PaymentPreimageAPIErrorZ { const ret: number = bindings.ChannelManager_get_payment_preimage(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_secret, 32))); const ret_hu_conv: Result_PaymentPreimageAPIErrorZ = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is + */ public as_MessageSendEventsProvider(): MessageSendEventsProvider { const ret: number = bindings.ChannelManager_as_MessageSendEventsProvider(this.ptr); const ret_hu_conv: MessageSendEventsProvider = new MessageSendEventsProvider(null, ret); @@ -456,6 +884,10 @@ export class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new EventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is + */ public as_EventsProvider(): EventsProvider { const ret: number = bindings.ChannelManager_as_EventsProvider(this.ptr); const ret_hu_conv: EventsProvider = new EventsProvider(null, ret); @@ -463,6 +895,10 @@ export class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new Listen which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is + */ public as_Listen(): Listen { const ret: number = bindings.ChannelManager_as_Listen(this.ptr); const ret_hu_conv: Listen = new Listen(null, ret); @@ -470,6 +906,10 @@ export class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new Confirm which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is + */ public as_Confirm(): Confirm { const ret: number = bindings.ChannelManager_as_Confirm(this.ptr); const ret_hu_conv: Confirm = new Confirm(null, ret); @@ -477,10 +917,19 @@ export class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Blocks until ChannelManager needs to be persisted. Only one listener on + * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken + * up. + */ public await_persistable_update(): void { bindings.ChannelManager_await_persistable_update(this.ptr); } + /** + * Gets the latest best block which was connected either via the [`chain::Listen`] or + * [`chain::Confirm`] interfaces. + */ public current_best_block(): BestBlock { const ret: number = bindings.ChannelManager_current_best_block(this.ptr); const ret_hu_conv: BestBlock = new BestBlock(null, ret); @@ -488,6 +937,10 @@ export class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is + */ public as_ChannelMessageHandler(): ChannelMessageHandler { const ret: number = bindings.ChannelManager_as_ChannelMessageHandler(this.ptr); const ret_hu_conv: ChannelMessageHandler = new ChannelMessageHandler(null, ret); @@ -495,6 +948,9 @@ export class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelManager_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); diff --git a/ts/structs/ChannelManagerReadArgs.mts b/ts/structs/ChannelManagerReadArgs.mts index f1728af4..61e830b1 100644 --- a/ts/structs/ChannelManagerReadArgs.mts +++ b/ts/structs/ChannelManagerReadArgs.mts @@ -281,12 +281,51 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Arguments for the creation of a ChannelManager that are not deserialized. + * + * At a high-level, the process for deserializing a ChannelManager and resuming normal operation + * is: + * 1) Deserialize all stored [`ChannelMonitor`]s. + * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling: + * `<(BlockHash, ChannelManager)>::read(reader, args)` + * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored + * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted. + * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the + * same way you would handle a [`chain::Filter`] call using + * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`]. + * 4) Reconnect blocks on your [`ChannelMonitor`]s. + * 5) Disconnect/connect blocks on the [`ChannelManager`]. + * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk. + * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you + * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in + * the next step. + * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a + * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`]. + * + * Note that the ordering of #4-7 is not of importance, however all four must occur before you + * call any other methods on the newly-deserialized [`ChannelManager`]. + * + * Note that because some channels may be closed during deserialization, it is critical that you + * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to + * you. If you deserialize an old ChannelManager (during which force-closure transactions may be + * broadcast), and then later deserialize a newer version of the same ChannelManager (which will + * not force-close the same channels but consider them live), you may end up revoking a state for + * which you've already broadcasted the transaction. + * + * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor + */ export class ChannelManagerReadArgs extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelManagerReadArgs_free); } + /** + * The keys provider which will give us relevant keys. Some keys will be loaded during + * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel + * signing data. + */ public get_keys_manager(): KeysInterface { const ret: number = bindings.ChannelManagerReadArgs_get_keys_manager(this.ptr); const ret_hu_conv: KeysInterface = new KeysInterface(null, ret); @@ -294,11 +333,21 @@ export class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * The keys provider which will give us relevant keys. Some keys will be loaded during + * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel + * signing data. + */ public set_keys_manager(val: KeysInterface): void { bindings.ChannelManagerReadArgs_set_keys_manager(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val)); CommonBase.add_ref_from(this, val); } + /** + * The fee_estimator for use in the ChannelManager in the future. + * + * No calls to the FeeEstimator will be made during deserialization. + */ public get_fee_estimator(): FeeEstimator { const ret: number = bindings.ChannelManagerReadArgs_get_fee_estimator(this.ptr); const ret_hu_conv: FeeEstimator = new FeeEstimator(null, ret); @@ -306,11 +355,23 @@ export class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * The fee_estimator for use in the ChannelManager in the future. + * + * No calls to the FeeEstimator will be made during deserialization. + */ public set_fee_estimator(val: FeeEstimator): void { bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val)); CommonBase.add_ref_from(this, val); } + /** + * The chain::Watch for use in the ChannelManager in the future. + * + * No calls to the chain::Watch will be made during deserialization. It is assumed that + * you have deserialized ChannelMonitors separately and will add them to your + * chain::Watch after deserializing this ChannelManager. + */ public get_chain_monitor(): Watch { const ret: number = bindings.ChannelManagerReadArgs_get_chain_monitor(this.ptr); const ret_hu_conv: Watch = new Watch(null, ret); @@ -318,11 +379,23 @@ export class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * The chain::Watch for use in the ChannelManager in the future. + * + * No calls to the chain::Watch will be made during deserialization. It is assumed that + * you have deserialized ChannelMonitors separately and will add them to your + * chain::Watch after deserializing this ChannelManager. + */ public set_chain_monitor(val: Watch): void { bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val)); CommonBase.add_ref_from(this, val); } + /** + * The BroadcasterInterface which will be used in the ChannelManager in the future and may be + * used to broadcast the latest local commitment transactions of channels which must be + * force-closed during deserialization. + */ public get_tx_broadcaster(): BroadcasterInterface { const ret: number = bindings.ChannelManagerReadArgs_get_tx_broadcaster(this.ptr); const ret_hu_conv: BroadcasterInterface = new BroadcasterInterface(null, ret); @@ -330,11 +403,20 @@ export class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * The BroadcasterInterface which will be used in the ChannelManager in the future and may be + * used to broadcast the latest local commitment transactions of channels which must be + * force-closed during deserialization. + */ public set_tx_broadcaster(val: BroadcasterInterface): void { bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val)); CommonBase.add_ref_from(this, val); } + /** + * The Logger for use in the ChannelManager and which may be used to log information during + * deserialization. + */ public get_logger(): Logger { const ret: number = bindings.ChannelManagerReadArgs_get_logger(this.ptr); const ret_hu_conv: Logger = new Logger(null, ret); @@ -342,11 +424,19 @@ export class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * The Logger for use in the ChannelManager and which may be used to log information during + * deserialization. + */ public set_logger(val: Logger): void { bindings.ChannelManagerReadArgs_set_logger(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val)); CommonBase.add_ref_from(this, val); } + /** + * Default settings used for new channels. Any existing channels will continue to use the + * runtime settings which were stored when the ChannelManager was serialized. + */ public get_default_config(): UserConfig { const ret: number = bindings.ChannelManagerReadArgs_get_default_config(this.ptr); const ret_hu_conv: UserConfig = new UserConfig(null, ret); @@ -354,10 +444,19 @@ export class ChannelManagerReadArgs extends CommonBase { return ret_hu_conv; } + /** + * Default settings used for new channels. Any existing channels will continue to use the + * runtime settings which were stored when the ChannelManager was serialized. + */ public set_default_config(val: UserConfig): void { bindings.ChannelManagerReadArgs_set_default_config(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Simple utility function to create a ChannelManagerReadArgs which creates the monitor + * HashMap for you. This is primarily useful for C bindings where it is not practical to + * populate a HashMap directly from C. + */ public static constructor_new(keys_manager: KeysInterface, fee_estimator: FeeEstimator, chain_monitor: Watch, tx_broadcaster: BroadcasterInterface, logger: Logger, default_config: UserConfig, channel_monitors: ChannelMonitor[]): ChannelManagerReadArgs { const ret: number = bindings.ChannelManagerReadArgs_new(keys_manager == null ? 0 : CommonBase.get_ptr_of(keys_manager), fee_estimator == null ? 0 : CommonBase.get_ptr_of(fee_estimator), chain_monitor == null ? 0 : CommonBase.get_ptr_of(chain_monitor), tx_broadcaster == null ? 0 : CommonBase.get_ptr_of(tx_broadcaster), logger == null ? 0 : CommonBase.get_ptr_of(logger), default_config == null ? 0 : CommonBase.get_ptr_of(default_config) & ~1, bindings.encodeUint32Array(channel_monitors != null ? channel_monitors.map(channel_monitors_conv_16 => channel_monitors_conv_16 == null ? 0 : CommonBase.get_ptr_of(channel_monitors_conv_16) & ~1) : null)); const ret_hu_conv: ChannelManagerReadArgs = new ChannelManagerReadArgs(null, ret); diff --git a/ts/structs/ChannelMessageHandler.mts b/ts/structs/ChannelMessageHandler.mts index 0868f7fa..4e406f57 100644 --- a/ts/structs/ChannelMessageHandler.mts +++ b/ts/structs/ChannelMessageHandler.mts @@ -283,26 +283,70 @@ import * as bindings from '../bindings.mjs' +/** An implementation of ChannelMessageHandler */ export interface ChannelMessageHandlerInterface { + /**Handle an incoming open_channel message from the given peer. + */ handle_open_channel(their_node_id: Uint8Array, their_features: InitFeatures, msg: OpenChannel): void; + /**Handle an incoming accept_channel message from the given peer. + */ handle_accept_channel(their_node_id: Uint8Array, their_features: InitFeatures, msg: AcceptChannel): void; + /**Handle an incoming funding_created message from the given peer. + */ handle_funding_created(their_node_id: Uint8Array, msg: FundingCreated): void; + /**Handle an incoming funding_signed message from the given peer. + */ handle_funding_signed(their_node_id: Uint8Array, msg: FundingSigned): void; + /**Handle an incoming funding_locked message from the given peer. + */ handle_funding_locked(their_node_id: Uint8Array, msg: FundingLocked): void; + /**Handle an incoming shutdown message from the given peer. + */ handle_shutdown(their_node_id: Uint8Array, their_features: InitFeatures, msg: Shutdown): void; + /**Handle an incoming closing_signed message from the given peer. + */ handle_closing_signed(their_node_id: Uint8Array, msg: ClosingSigned): void; + /**Handle an incoming update_add_htlc message from the given peer. + */ handle_update_add_htlc(their_node_id: Uint8Array, msg: UpdateAddHTLC): void; + /**Handle an incoming update_fulfill_htlc message from the given peer. + */ handle_update_fulfill_htlc(their_node_id: Uint8Array, msg: UpdateFulfillHTLC): void; + /**Handle an incoming update_fail_htlc message from the given peer. + */ handle_update_fail_htlc(their_node_id: Uint8Array, msg: UpdateFailHTLC): void; + /**Handle an incoming update_fail_malformed_htlc message from the given peer. + */ handle_update_fail_malformed_htlc(their_node_id: Uint8Array, msg: UpdateFailMalformedHTLC): void; + /**Handle an incoming commitment_signed message from the given peer. + */ handle_commitment_signed(their_node_id: Uint8Array, msg: CommitmentSigned): void; + /**Handle an incoming revoke_and_ack message from the given peer. + */ handle_revoke_and_ack(their_node_id: Uint8Array, msg: RevokeAndACK): void; + /**Handle an incoming update_fee message from the given peer. + */ handle_update_fee(their_node_id: Uint8Array, msg: UpdateFee): void; + /**Handle an incoming announcement_signatures message from the given peer. + */ handle_announcement_signatures(their_node_id: Uint8Array, msg: AnnouncementSignatures): void; + /**Indicates a connection to the peer failed/an existing connection was lost. If no connection + * is believed to be possible in the future (eg they're sending us messages we don't + * understand or indicate they require unknown feature bits), no_connection_possible is set + * and any outstanding channels should be failed. + */ peer_disconnected(their_node_id: Uint8Array, no_connection_possible: boolean): void; + /**Handle a peer reconnecting, possibly generating channel_reestablish message(s). + */ peer_connected(their_node_id: Uint8Array, msg: Init): void; + /**Handle an incoming channel_reestablish message from the given peer. + */ handle_channel_reestablish(their_node_id: Uint8Array, msg: ChannelReestablish): void; + /**Handle an incoming channel update from the given peer. + */ handle_channel_update(their_node_id: Uint8Array, msg: ChannelUpdate): void; + /**Handle an incoming error message from the given peer. + */ handle_error(their_node_id: Uint8Array, msg: ErrorMessage): void; } @@ -310,6 +354,12 @@ class LDKChannelMessageHandlerHolder { held: ChannelMessageHandler; } +/** + * A trait to describe an object which can receive channel messages. + * + * Messages MAY be called in parallel when they originate from different their_node_ids, however + * they MUST NOT be called in parallel when the two calls have the same their_node_id. + */ export class ChannelMessageHandler extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKChannelMessageHandler; @@ -320,7 +370,8 @@ export class ChannelMessageHandler extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: ChannelMessageHandlerInterface, messageSendEventsProvider_impl: MessageSendEventsProviderInterface): ChannelMessageHandler { + /** Creates a new instance of ChannelMessageHandler from a given implementation */ + public static new_impl(arg: ChannelMessageHandlerInterface, messageSendEventsProvider_impl: MessageSendEventsProviderInterface): ChannelMessageHandler { const impl_holder: LDKChannelMessageHandlerHolder = new LDKChannelMessageHandlerHolder(); let structImplementation = { handle_open_channel (their_node_id: number, their_features: number, msg: number): void { @@ -436,101 +487,165 @@ export class ChannelMessageHandler extends CommonBase { impl_holder.held.ptrs_to.push(messageSendEventsProvider); return impl_holder.held; } + + /** + * Handle an incoming open_channel message from the given peer. + */ public handle_open_channel(their_node_id: Uint8Array, their_features: InitFeatures, msg: OpenChannel): void { bindings.ChannelMessageHandler_handle_open_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), their_features == null ? 0 : CommonBase.get_ptr_of(their_features) & ~1, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming accept_channel message from the given peer. + */ public handle_accept_channel(their_node_id: Uint8Array, their_features: InitFeatures, msg: AcceptChannel): void { bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), their_features == null ? 0 : CommonBase.get_ptr_of(their_features) & ~1, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming funding_created message from the given peer. + */ public handle_funding_created(their_node_id: Uint8Array, msg: FundingCreated): void { bindings.ChannelMessageHandler_handle_funding_created(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming funding_signed message from the given peer. + */ public handle_funding_signed(their_node_id: Uint8Array, msg: FundingSigned): void { bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming funding_locked message from the given peer. + */ public handle_funding_locked(their_node_id: Uint8Array, msg: FundingLocked): void { bindings.ChannelMessageHandler_handle_funding_locked(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming shutdown message from the given peer. + */ public handle_shutdown(their_node_id: Uint8Array, their_features: InitFeatures, msg: Shutdown): void { bindings.ChannelMessageHandler_handle_shutdown(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), their_features == null ? 0 : CommonBase.get_ptr_of(their_features) & ~1, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, their_features); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming closing_signed message from the given peer. + */ public handle_closing_signed(their_node_id: Uint8Array, msg: ClosingSigned): void { bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming update_add_htlc message from the given peer. + */ public handle_update_add_htlc(their_node_id: Uint8Array, msg: UpdateAddHTLC): void { bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming update_fulfill_htlc message from the given peer. + */ public handle_update_fulfill_htlc(their_node_id: Uint8Array, msg: UpdateFulfillHTLC): void { bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming update_fail_htlc message from the given peer. + */ public handle_update_fail_htlc(their_node_id: Uint8Array, msg: UpdateFailHTLC): void { bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming update_fail_malformed_htlc message from the given peer. + */ public handle_update_fail_malformed_htlc(their_node_id: Uint8Array, msg: UpdateFailMalformedHTLC): void { bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming commitment_signed message from the given peer. + */ public handle_commitment_signed(their_node_id: Uint8Array, msg: CommitmentSigned): void { bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming revoke_and_ack message from the given peer. + */ public handle_revoke_and_ack(their_node_id: Uint8Array, msg: RevokeAndACK): void { bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming update_fee message from the given peer. + */ public handle_update_fee(their_node_id: Uint8Array, msg: UpdateFee): void { bindings.ChannelMessageHandler_handle_update_fee(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming announcement_signatures message from the given peer. + */ public handle_announcement_signatures(their_node_id: Uint8Array, msg: AnnouncementSignatures): void { bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Indicates a connection to the peer failed/an existing connection was lost. If no connection + * is believed to be possible in the future (eg they're sending us messages we don't + * understand or indicate they require unknown feature bits), no_connection_possible is set + * and any outstanding channels should be failed. + */ public peer_disconnected(their_node_id: Uint8Array, no_connection_possible: boolean): void { bindings.ChannelMessageHandler_peer_disconnected(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), no_connection_possible); } + /** + * Handle a peer reconnecting, possibly generating channel_reestablish message(s). + */ public peer_connected(their_node_id: Uint8Array, msg: Init): void { bindings.ChannelMessageHandler_peer_connected(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming channel_reestablish message from the given peer. + */ public handle_channel_reestablish(their_node_id: Uint8Array, msg: ChannelReestablish): void { bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming channel update from the given peer. + */ public handle_channel_update(their_node_id: Uint8Array, msg: ChannelUpdate): void { bindings.ChannelMessageHandler_handle_channel_update(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); } + /** + * Handle an incoming error message from the given peer. + */ public handle_error(their_node_id: Uint8Array, msg: ErrorMessage): void { bindings.ChannelMessageHandler_handle_error(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); CommonBase.add_ref_from(this, msg); diff --git a/ts/structs/ChannelMonitor.mts b/ts/structs/ChannelMonitor.mts index 72c610de..444120b6 100644 --- a/ts/structs/ChannelMonitor.mts +++ b/ts/structs/ChannelMonitor.mts @@ -281,6 +281,24 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates + * on-chain transactions to ensure no loss of funds occurs. + * + * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date + * information and are actively monitoring the chain. + * + * Pending Events or updated HTLCs which have not yet been read out by + * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and + * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events + * gotten are fully handled before re-serializing the new state. + * + * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which + * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along + * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the + * returned block hash and the the current chain and then reconnecting blocks to get to the + * best chain) upon deserializing the object! + */ export class ChannelMonitor extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { @@ -292,6 +310,9 @@ export class ChannelMonitor extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelMonitor + */ public clone(): ChannelMonitor { const ret: number = bindings.ChannelMonitor_clone(this.ptr); const ret_hu_conv: ChannelMonitor = new ChannelMonitor(null, ret); @@ -299,12 +320,21 @@ export class ChannelMonitor extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelMonitor_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Updates a ChannelMonitor on the basis of some new information provided by the Channel + * itself. + * + * panics if the given update is not the next update by update_id. + */ public update_monitor(updates: ChannelMonitorUpdate, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): Result_NoneNoneZ { const ret: number = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : CommonBase.get_ptr_of(updates) & ~1, broadcaster == null ? 0 : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0 : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0 : CommonBase.get_ptr_of(logger)); const ret_hu_conv: Result_NoneNoneZ = Result_NoneNoneZ.constr_from_ptr(ret); @@ -315,11 +345,18 @@ export class ChannelMonitor extends CommonBase { return ret_hu_conv; } + /** + * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this + * ChannelMonitor. + */ public get_latest_update_id(): bigint { const ret: bigint = bindings.ChannelMonitor_get_latest_update_id(this.ptr); return ret; } + /** + * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for. + */ public get_funding_txo(): TwoTuple_OutPointScriptZ { const ret: number = bindings.ChannelMonitor_get_funding_txo(this.ptr); const ret_hu_conv: TwoTuple_OutPointScriptZ = new TwoTuple_OutPointScriptZ(null, ret); @@ -327,6 +364,10 @@ export class ChannelMonitor extends CommonBase { return ret_hu_conv; } + /** + * Gets a list of txids, with their output scripts (in the order they appear in the + * transaction), which we must learn about spends of via block_connected(). + */ public get_outputs_to_watch(): TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ[] { const ret: number = bindings.ChannelMonitor_get_outputs_to_watch(this.ptr); const ret_conv_40_len: number = bindings.getArrayLength(ret); @@ -337,14 +378,24 @@ export class ChannelMonitor extends CommonBase { CommonBase.add_ref_from(ret_conv_40_hu_conv, this); ret_conv_40_arr[o] = ret_conv_40_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_40_arr; } + /** + * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly + * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs + * have been registered. + */ public load_outputs_to_watch(filter: Filter): void { bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter == null ? 0 : CommonBase.get_ptr_of(filter)); CommonBase.add_ref_from(this, filter); } + /** + * Get the list of HTLCs who's status has been updated on chain. This should be called by + * ChannelManager via [`chain::Watch::release_pending_monitor_events`]. + */ public get_and_clear_pending_monitor_events(): MonitorEvent[] { const ret: number = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr); const ret_conv_14_len: number = bindings.getArrayLength(ret); @@ -355,9 +406,18 @@ export class ChannelMonitor extends CommonBase { CommonBase.add_ref_from(ret_conv_14_hu_conv, this); ret_conv_14_arr[o] = ret_conv_14_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_14_arr; } + /** + * Gets the list of pending events which were generated by previous actions, clearing the list + * in the process. + * + * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to + * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do + * no internal locking in ChannelMonitors. + */ public get_and_clear_pending_events(): Event[] { const ret: number = bindings.ChannelMonitor_get_and_clear_pending_events(this.ptr); const ret_conv_7_len: number = bindings.getArrayLength(ret); @@ -368,9 +428,21 @@ export class ChannelMonitor extends CommonBase { CommonBase.add_ref_from(ret_conv_7_hu_conv, this); ret_conv_7_arr[h] = ret_conv_7_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_7_arr; } + /** + * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of + * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of + * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows + * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these + * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to + * broadcast them if counterparty don't close channel with his higher commitment transaction after a + * substantial amount of time (a month or even a year) to get back funds. Best may be to contact + * out-of-band the other node operator to coordinate with him if option is available to you. + * In any-case, choice is up to the user. + */ public get_latest_holder_commitment_txn(logger: Logger): Uint8Array[] { const ret: number = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0 : CommonBase.get_ptr_of(logger)); const ret_conv_12_len: number = bindings.getArrayLength(ret); @@ -380,10 +452,24 @@ export class ChannelMonitor extends CommonBase { const ret_conv_12_conv: Uint8Array = bindings.decodeUint8Array(ret_conv_12); ret_conv_12_arr[m] = ret_conv_12_conv; } + bindings.freeWasmMemory(ret) CommonBase.add_ref_from(this, logger); return ret_conv_12_arr; } + /** + * Processes transactions in a newly connected block, which may result in any of the following: + * - update the monitor's state against resolved HTLCs + * - punish the counterparty in the case of seeing a revoked commitment transaction + * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration + * - detect settled outputs for later spending + * - schedule and bump any in-flight claims + * + * Returns any new outputs to watch from `txdata`; after called, these are also included in + * [`get_outputs_to_watch`]. + * + * [`get_outputs_to_watch`]: #method.get_outputs_to_watch + */ public block_connected(header: Uint8Array, txdata: TwoTuple_usizeTransactionZ[], height: number, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] { const ret: number = bindings.ChannelMonitor_block_connected(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), bindings.encodeUint32Array(txdata != null ? txdata.map(txdata_conv_28 => txdata_conv_28 != null ? CommonBase.get_ptr_of(txdata_conv_28) : 0) : null), height, broadcaster == null ? 0 : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0 : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0 : CommonBase.get_ptr_of(logger)); const ret_conv_39_len: number = bindings.getArrayLength(ret); @@ -394,12 +480,17 @@ export class ChannelMonitor extends CommonBase { CommonBase.add_ref_from(ret_conv_39_hu_conv, this); ret_conv_39_arr[n] = ret_conv_39_hu_conv; } + bindings.freeWasmMemory(ret) CommonBase.add_ref_from(this, broadcaster); CommonBase.add_ref_from(this, fee_estimator); CommonBase.add_ref_from(this, logger); return ret_conv_39_arr; } + /** + * Determines if the disconnected block contained any transactions of interest and updates + * appropriately. + */ public block_disconnected(header: Uint8Array, height: number, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): void { bindings.ChannelMonitor_block_disconnected(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), height, broadcaster == null ? 0 : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0 : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0 : CommonBase.get_ptr_of(logger)); CommonBase.add_ref_from(this, broadcaster); @@ -407,6 +498,15 @@ export class ChannelMonitor extends CommonBase { CommonBase.add_ref_from(this, logger); } + /** + * Processes transactions confirmed in a block with the given header and height, returning new + * outputs to watch. See [`block_connected`] for details. + * + * Used instead of [`block_connected`] by clients that are notified of transactions rather than + * blocks. See [`chain::Confirm`] for calling expectations. + * + * [`block_connected`]: Self::block_connected + */ public transactions_confirmed(header: Uint8Array, txdata: TwoTuple_usizeTransactionZ[], height: number, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] { const ret: number = bindings.ChannelMonitor_transactions_confirmed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), bindings.encodeUint32Array(txdata != null ? txdata.map(txdata_conv_28 => txdata_conv_28 != null ? CommonBase.get_ptr_of(txdata_conv_28) : 0) : null), height, broadcaster == null ? 0 : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0 : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0 : CommonBase.get_ptr_of(logger)); const ret_conv_39_len: number = bindings.getArrayLength(ret); @@ -417,12 +517,21 @@ export class ChannelMonitor extends CommonBase { CommonBase.add_ref_from(ret_conv_39_hu_conv, this); ret_conv_39_arr[n] = ret_conv_39_hu_conv; } + bindings.freeWasmMemory(ret) CommonBase.add_ref_from(this, broadcaster); CommonBase.add_ref_from(this, fee_estimator); CommonBase.add_ref_from(this, logger); return ret_conv_39_arr; } + /** + * Processes a transaction that was reorganized out of the chain. + * + * Used instead of [`block_disconnected`] by clients that are notified of transactions rather + * than blocks. See [`chain::Confirm`] for calling expectations. + * + * [`block_disconnected`]: Self::block_disconnected + */ public transaction_unconfirmed(txid: Uint8Array, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): void { bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(txid, 32)), broadcaster == null ? 0 : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0 : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0 : CommonBase.get_ptr_of(logger)); CommonBase.add_ref_from(this, broadcaster); @@ -430,6 +539,15 @@ export class ChannelMonitor extends CommonBase { CommonBase.add_ref_from(this, logger); } + /** + * Updates the monitor with the current best chain tip, returning new outputs to watch. See + * [`block_connected`] for details. + * + * Used instead of [`block_connected`] by clients that are notified of transactions rather than + * blocks. See [`chain::Confirm`] for calling expectations. + * + * [`block_connected`]: Self::block_connected + */ public best_block_updated(header: Uint8Array, height: number, broadcaster: BroadcasterInterface, fee_estimator: FeeEstimator, logger: Logger): TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] { const ret: number = bindings.ChannelMonitor_best_block_updated(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), height, broadcaster == null ? 0 : CommonBase.get_ptr_of(broadcaster), fee_estimator == null ? 0 : CommonBase.get_ptr_of(fee_estimator), logger == null ? 0 : CommonBase.get_ptr_of(logger)); const ret_conv_39_len: number = bindings.getArrayLength(ret); @@ -440,12 +558,16 @@ export class ChannelMonitor extends CommonBase { CommonBase.add_ref_from(ret_conv_39_hu_conv, this); ret_conv_39_arr[n] = ret_conv_39_hu_conv; } + bindings.freeWasmMemory(ret) CommonBase.add_ref_from(this, broadcaster); CommonBase.add_ref_from(this, fee_estimator); CommonBase.add_ref_from(this, logger); return ret_conv_39_arr; } + /** + * Returns the set of txids that should be monitored for re-organization out of the chain. + */ public get_relevant_txids(): Uint8Array[] { const ret: number = bindings.ChannelMonitor_get_relevant_txids(this.ptr); const ret_conv_12_len: number = bindings.getArrayLength(ret); @@ -455,9 +577,14 @@ export class ChannelMonitor extends CommonBase { const ret_conv_12_conv: Uint8Array = bindings.decodeUint8Array(ret_conv_12); ret_conv_12_arr[m] = ret_conv_12_conv; } + bindings.freeWasmMemory(ret) return ret_conv_12_arr; } + /** + * Gets the latest best block which was connected either via the [`chain::Listen`] or + * [`chain::Confirm`] interfaces. + */ public current_best_block(): BestBlock { const ret: number = bindings.ChannelMonitor_current_best_block(this.ptr); const ret_hu_conv: BestBlock = new BestBlock(null, ret); @@ -465,6 +592,22 @@ export class ChannelMonitor extends CommonBase { return ret_hu_conv; } + /** + * Gets the balances in this channel which are either claimable by us if we were to + * force-close the channel now or which are claimable on-chain (possibly awaiting + * confirmation). + * + * Any balances in the channel which are available on-chain (excluding on-chain fees) are + * included here until an [`Event::SpendableOutputs`] event has been generated for the + * balance, or until our counterparty has claimed the balance and accrued several + * confirmations on the claim transaction. + * + * Note that the balances available when you or your counterparty have broadcasted revoked + * state(s) may not be fully captured here. + * + * See [`Balance`] for additional details on the types of claimable balances which + * may be returned here and their meanings. + */ public get_claimable_balances(): Balance[] { const ret: number = bindings.ChannelMonitor_get_claimable_balances(this.ptr); const ret_conv_9_len: number = bindings.getArrayLength(ret); @@ -475,6 +618,7 @@ export class ChannelMonitor extends CommonBase { CommonBase.add_ref_from(ret_conv_9_hu_conv, this); ret_conv_9_arr[j] = ret_conv_9_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_9_arr; } diff --git a/ts/structs/ChannelMonitorUpdate.mts b/ts/structs/ChannelMonitorUpdate.mts index 224c911c..5dc51589 100644 --- a/ts/structs/ChannelMonitorUpdate.mts +++ b/ts/structs/ChannelMonitorUpdate.mts @@ -281,17 +281,47 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An update generated by the underlying Channel itself which contains some new information the + * ChannelMonitor should be made aware of. + */ export class ChannelMonitorUpdate extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelMonitorUpdate_free); } + /** + * The sequence number of this update. Updates *must* be replayed in-order according to this + * sequence number (and updates may panic if they are not). The update_id values are strictly + * increasing and increase by one for each new update, with one exception specified below. + * + * This sequence number is also used to track up to which points updates which returned + * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given + * ChannelMonitor when ChannelManager::channel_monitor_updated is called. + * + * The only instance where update_id values are not strictly increasing is the case where we + * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See + * its docs for more details. + */ public get_update_id(): bigint { const ret: bigint = bindings.ChannelMonitorUpdate_get_update_id(this.ptr); return ret; } + /** + * The sequence number of this update. Updates *must* be replayed in-order according to this + * sequence number (and updates may panic if they are not). The update_id values are strictly + * increasing and increase by one for each new update, with one exception specified below. + * + * This sequence number is also used to track up to which points updates which returned + * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given + * ChannelMonitor when ChannelManager::channel_monitor_updated is called. + * + * The only instance where update_id values are not strictly increasing is the case where we + * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See + * its docs for more details. + */ public set_update_id(val: bigint): void { bindings.ChannelMonitorUpdate_set_update_id(this.ptr, val); } @@ -301,6 +331,9 @@ export class ChannelMonitorUpdate extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelMonitorUpdate + */ public clone(): ChannelMonitorUpdate { const ret: number = bindings.ChannelMonitorUpdate_clone(this.ptr); const ret_hu_conv: ChannelMonitorUpdate = new ChannelMonitorUpdate(null, ret); @@ -308,12 +341,18 @@ export class ChannelMonitorUpdate extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelMonitorUpdate_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write + */ public static constructor_read(ser: Uint8Array): Result_ChannelMonitorUpdateDecodeErrorZ { const ret: number = bindings.ChannelMonitorUpdate_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ChannelMonitorUpdateDecodeErrorZ = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ChannelPublicKeys.mts b/ts/structs/ChannelPublicKeys.mts index b8bfccbd..ccbfb859 100644 --- a/ts/structs/ChannelPublicKeys.mts +++ b/ts/structs/ChannelPublicKeys.mts @@ -281,62 +281,116 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * One counterparty's public keys which do not change over the life of a channel. + */ export class ChannelPublicKeys extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelPublicKeys_free); } + /** + * The public key which is used to sign all commitment transactions, as it appears in the + * on-chain channel lock-in 2-of-2 multisig output. + */ public get_funding_pubkey(): Uint8Array { const ret: number = bindings.ChannelPublicKeys_get_funding_pubkey(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The public key which is used to sign all commitment transactions, as it appears in the + * on-chain channel lock-in 2-of-2 multisig output. + */ public set_funding_pubkey(val: Uint8Array): void { bindings.ChannelPublicKeys_set_funding_pubkey(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The base point which is used (with derive_public_revocation_key) to derive per-commitment + * revocation keys. This is combined with the per-commitment-secret generated by the + * counterparty to create a secret which the counterparty can reveal to revoke previous + * states. + */ public get_revocation_basepoint(): Uint8Array { const ret: number = bindings.ChannelPublicKeys_get_revocation_basepoint(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The base point which is used (with derive_public_revocation_key) to derive per-commitment + * revocation keys. This is combined with the per-commitment-secret generated by the + * counterparty to create a secret which the counterparty can reveal to revoke previous + * states. + */ public set_revocation_basepoint(val: Uint8Array): void { bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately + * spendable primary channel balance on the broadcaster's commitment transaction. This key is + * static across every commitment transaction. + */ public get_payment_point(): Uint8Array { const ret: number = bindings.ChannelPublicKeys_get_payment_point(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately + * spendable primary channel balance on the broadcaster's commitment transaction. This key is + * static across every commitment transaction. + */ public set_payment_point(val: Uint8Array): void { bindings.ChannelPublicKeys_set_payment_point(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The base point which is used (with derive_public_key) to derive a per-commitment payment + * public key which receives non-HTLC-encumbered funds which are only available for spending + * after some delay (or can be claimed via the revocation path). + */ public get_delayed_payment_basepoint(): Uint8Array { const ret: number = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The base point which is used (with derive_public_key) to derive a per-commitment payment + * public key which receives non-HTLC-encumbered funds which are only available for spending + * after some delay (or can be claimed via the revocation path). + */ public set_delayed_payment_basepoint(val: Uint8Array): void { bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The base point which is used (with derive_public_key) to derive a per-commitment public key + * which is used to encumber HTLC-in-flight outputs. + */ public get_htlc_basepoint(): Uint8Array { const ret: number = bindings.ChannelPublicKeys_get_htlc_basepoint(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The base point which is used (with derive_public_key) to derive a per-commitment public key + * which is used to encumber HTLC-in-flight outputs. + */ public set_htlc_basepoint(val: Uint8Array): void { bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Constructs a new ChannelPublicKeys given each field + */ public static constructor_new(funding_pubkey_arg: Uint8Array, revocation_basepoint_arg: Uint8Array, payment_point_arg: Uint8Array, delayed_payment_basepoint_arg: Uint8Array, htlc_basepoint_arg: Uint8Array): ChannelPublicKeys { const ret: number = bindings.ChannelPublicKeys_new(bindings.encodeUint8Array(bindings.check_arr_len(funding_pubkey_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(revocation_basepoint_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(payment_point_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(delayed_payment_basepoint_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(htlc_basepoint_arg, 33))); const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); @@ -349,6 +403,9 @@ export class ChannelPublicKeys extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelPublicKeys + */ public clone(): ChannelPublicKeys { const ret: number = bindings.ChannelPublicKeys_clone(this.ptr); const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); @@ -356,12 +413,18 @@ export class ChannelPublicKeys extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelPublicKeys_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write + */ public static constructor_read(ser: Uint8Array): Result_ChannelPublicKeysDecodeErrorZ { const ret: number = bindings.ChannelPublicKeys_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ChannelPublicKeysDecodeErrorZ = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ChannelReestablish.mts b/ts/structs/ChannelReestablish.mts index ea1fbb23..e5525d1a 100644 --- a/ts/structs/ChannelReestablish.mts +++ b/ts/structs/ChannelReestablish.mts @@ -281,36 +281,57 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A channel_reestablish message to be sent or received from a peer + */ export class ChannelReestablish extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelReestablish_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.ChannelReestablish_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.ChannelReestablish_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The next commitment number for the sender + */ public get_next_local_commitment_number(): bigint { const ret: bigint = bindings.ChannelReestablish_get_next_local_commitment_number(this.ptr); return ret; } + /** + * The next commitment number for the sender + */ public set_next_local_commitment_number(val: bigint): void { bindings.ChannelReestablish_set_next_local_commitment_number(this.ptr, val); } + /** + * The next commitment number for the recipient + */ public get_next_remote_commitment_number(): bigint { const ret: bigint = bindings.ChannelReestablish_get_next_remote_commitment_number(this.ptr); return ret; } + /** + * The next commitment number for the recipient + */ public set_next_remote_commitment_number(val: bigint): void { bindings.ChannelReestablish_set_next_remote_commitment_number(this.ptr, val); } @@ -320,6 +341,9 @@ export class ChannelReestablish extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelReestablish + */ public clone(): ChannelReestablish { const ret: number = bindings.ChannelReestablish_clone(this.ptr); const ret_hu_conv: ChannelReestablish = new ChannelReestablish(null, ret); @@ -327,12 +351,18 @@ export class ChannelReestablish extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelReestablish_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write + */ public static constructor_read(ser: Uint8Array): Result_ChannelReestablishDecodeErrorZ { const ret: number = bindings.ChannelReestablish_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ChannelReestablishDecodeErrorZ = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ChannelTransactionParameters.mts b/ts/structs/ChannelTransactionParameters.mts index 2435a057..b4d0cb68 100644 --- a/ts/structs/ChannelTransactionParameters.mts +++ b/ts/structs/ChannelTransactionParameters.mts @@ -281,12 +281,22 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction). + * The fields are organized by holder/counterparty. + * + * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters + * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions. + */ export class ChannelTransactionParameters extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelTransactionParameters_free); } + /** + * Holder public keys + */ public get_holder_pubkeys(): ChannelPublicKeys { const ret: number = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr); const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); @@ -294,28 +304,51 @@ export class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Holder public keys + */ public set_holder_pubkeys(val: ChannelPublicKeys): void { bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The contest delay selected by the holder, which applies to counterparty-broadcast transactions + */ public get_holder_selected_contest_delay(): number { const ret: number = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr); return ret; } + /** + * The contest delay selected by the holder, which applies to counterparty-broadcast transactions + */ public set_holder_selected_contest_delay(val: number): void { bindings.ChannelTransactionParameters_set_holder_selected_contest_delay(this.ptr, val); } + /** + * Whether the holder is the initiator of this channel. + * This is an input to the commitment number obscure factor computation. + */ public get_is_outbound_from_holder(): boolean { const ret: boolean = bindings.ChannelTransactionParameters_get_is_outbound_from_holder(this.ptr); return ret; } + /** + * Whether the holder is the initiator of this channel. + * This is an input to the commitment number obscure factor computation. + */ public set_is_outbound_from_holder(val: boolean): void { bindings.ChannelTransactionParameters_set_is_outbound_from_holder(this.ptr, val); } + /** + * The late-bound counterparty channel transaction parameters. + * These parameters are populated at the point in the protocol where the counterparty provides them. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_counterparty_parameters(): CounterpartyChannelTransactionParameters { const ret: number = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr); const ret_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, ret); @@ -323,10 +356,21 @@ export class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * The late-bound counterparty channel transaction parameters. + * These parameters are populated at the point in the protocol where the counterparty provides them. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_counterparty_parameters(val: CounterpartyChannelTransactionParameters): void { bindings.ChannelTransactionParameters_set_counterparty_parameters(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The late-bound funding outpoint + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_funding_outpoint(): OutPoint { const ret: number = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr); const ret_hu_conv: OutPoint = new OutPoint(null, ret); @@ -334,19 +378,33 @@ export class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * The late-bound funding outpoint + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_funding_outpoint(val: OutPoint): void { bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Are anchors used for this channel. Boolean is serialization backwards-compatible + */ public get_opt_anchors(): COption_NoneZ { const ret: COption_NoneZ = bindings.ChannelTransactionParameters_get_opt_anchors(this.ptr); return ret; } + /** + * Are anchors used for this channel. Boolean is serialization backwards-compatible + */ public set_opt_anchors(val: COption_NoneZ): void { bindings.ChannelTransactionParameters_set_opt_anchors(this.ptr, val); } + /** + * Constructs a new ChannelTransactionParameters given each field + */ public static constructor_new(holder_pubkeys_arg: ChannelPublicKeys, holder_selected_contest_delay_arg: number, is_outbound_from_holder_arg: boolean, counterparty_parameters_arg: CounterpartyChannelTransactionParameters, funding_outpoint_arg: OutPoint, opt_anchors_arg: COption_NoneZ): ChannelTransactionParameters { const ret: number = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : CommonBase.get_ptr_of(holder_pubkeys_arg) & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : CommonBase.get_ptr_of(counterparty_parameters_arg) & ~1, funding_outpoint_arg == null ? 0 : CommonBase.get_ptr_of(funding_outpoint_arg) & ~1, opt_anchors_arg); const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret); @@ -359,6 +417,9 @@ export class ChannelTransactionParameters extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelTransactionParameters + */ public clone(): ChannelTransactionParameters { const ret: number = bindings.ChannelTransactionParameters_clone(this.ptr); const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret); @@ -366,11 +427,20 @@ export class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Whether the late bound parameters are populated. + */ public is_populated(): boolean { const ret: boolean = bindings.ChannelTransactionParameters_is_populated(this.ptr); return ret; } + /** + * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters, + * given that the holder is the broadcaster. + * + * self.is_populated() must be true before calling this function. + */ public as_holder_broadcastable(): DirectedChannelTransactionParameters { const ret: number = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr); const ret_hu_conv: DirectedChannelTransactionParameters = new DirectedChannelTransactionParameters(null, ret); @@ -378,6 +448,12 @@ export class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters, + * given that the counterparty is the broadcaster. + * + * self.is_populated() must be true before calling this function. + */ public as_counterparty_broadcastable(): DirectedChannelTransactionParameters { const ret: number = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr); const ret_hu_conv: DirectedChannelTransactionParameters = new DirectedChannelTransactionParameters(null, ret); @@ -385,12 +461,18 @@ export class ChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelTransactionParameters_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write + */ public static constructor_read(ser: Uint8Array): Result_ChannelTransactionParametersDecodeErrorZ { const ret: number = bindings.ChannelTransactionParameters_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ChannelTransactionParametersDecodeErrorZ = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ChannelTypeFeatures.mts b/ts/structs/ChannelTypeFeatures.mts index b83ae407..b0ab7249 100644 --- a/ts/structs/ChannelTypeFeatures.mts +++ b/ts/structs/ChannelTypeFeatures.mts @@ -281,12 +281,29 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Features used within the channel_type field in an OpenChannel message. + * + * A channel is always of some known \"type\", describing the transaction formats used and the exact + * semantics of our interaction with our peer. + * + * Note that because a channel is a specific type which is proposed by the opener and accepted by + * the counterparty, only required features are allowed here. + * + * This is serialized differently from other feature types - it is not prefixed by a length, and + * thus must only appear inside a TLV where its length is known in advance. + */ export class ChannelTypeFeatures extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelTypeFeatures_free); } + /** + * Checks if two ChannelTypeFeaturess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: ChannelTypeFeatures): boolean { const ret: boolean = bindings.ChannelTypeFeatures_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); @@ -298,6 +315,9 @@ export class ChannelTypeFeatures extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelTypeFeatures + */ public clone(): ChannelTypeFeatures { const ret: number = bindings.ChannelTypeFeatures_clone(this.ptr); const ret_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, ret); @@ -305,6 +325,9 @@ export class ChannelTypeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Create a blank Features with no features set + */ public static constructor_empty(): ChannelTypeFeatures { const ret: number = bindings.ChannelTypeFeatures_empty(); const ret_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, ret); @@ -312,6 +335,9 @@ export class ChannelTypeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Creates a Features with the bits set which are known by the implementation + */ public static constructor_known(): ChannelTypeFeatures { const ret: number = bindings.ChannelTypeFeatures_known(); const ret_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, ret); @@ -319,17 +345,27 @@ export class ChannelTypeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns true if this `Features` object contains unknown feature flags which are set as + * \"required\". + */ public requires_unknown_bits(): boolean { const ret: boolean = bindings.ChannelTypeFeatures_requires_unknown_bits(this.ptr); return ret; } + /** + * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelTypeFeatures_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write + */ public static constructor_read(ser: Uint8Array): Result_ChannelTypeFeaturesDecodeErrorZ { const ret: number = bindings.ChannelTypeFeatures_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ChannelTypeFeaturesDecodeErrorZ = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ChannelUpdate.mts b/ts/structs/ChannelUpdate.mts index 87feec5f..e796c184 100644 --- a/ts/structs/ChannelUpdate.mts +++ b/ts/structs/ChannelUpdate.mts @@ -281,22 +281,34 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A channel_update message to be sent or received from a peer + */ export class ChannelUpdate extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ChannelUpdate_free); } + /** + * A signature of the channel update + */ public get_signature(): Uint8Array { const ret: number = bindings.ChannelUpdate_get_signature(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * A signature of the channel update + */ public set_signature(val: Uint8Array): void { bindings.ChannelUpdate_set_signature(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * The actual channel update + */ public get_contents(): UnsignedChannelUpdate { const ret: number = bindings.ChannelUpdate_get_contents(this.ptr); const ret_hu_conv: UnsignedChannelUpdate = new UnsignedChannelUpdate(null, ret); @@ -304,10 +316,16 @@ export class ChannelUpdate extends CommonBase { return ret_hu_conv; } + /** + * The actual channel update + */ public set_contents(val: UnsignedChannelUpdate): void { bindings.ChannelUpdate_set_contents(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new ChannelUpdate given each field + */ public static constructor_new(signature_arg: Uint8Array, contents_arg: UnsignedChannelUpdate): ChannelUpdate { const ret: number = bindings.ChannelUpdate_new(bindings.encodeUint8Array(bindings.check_arr_len(signature_arg, 64)), contents_arg == null ? 0 : CommonBase.get_ptr_of(contents_arg) & ~1); const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); @@ -320,6 +338,9 @@ export class ChannelUpdate extends CommonBase { return ret; } + /** + * Creates a copy of the ChannelUpdate + */ public clone(): ChannelUpdate { const ret: number = bindings.ChannelUpdate_clone(this.ptr); const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); @@ -327,12 +348,18 @@ export class ChannelUpdate extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read + */ public write(): Uint8Array { const ret: number = bindings.ChannelUpdate_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write + */ public static constructor_read(ser: Uint8Array): Result_ChannelUpdateDecodeErrorZ { const ret: number = bindings.ChannelUpdate_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ChannelUpdateDecodeErrorZ = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ClosingSigned.mts b/ts/structs/ClosingSigned.mts index 516b2d02..c1680d45 100644 --- a/ts/structs/ClosingSigned.mts +++ b/ts/structs/ClosingSigned.mts @@ -281,41 +281,68 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A closing_signed message to be sent or received from a peer + */ export class ClosingSigned extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ClosingSigned_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.ClosingSigned_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.ClosingSigned_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The proposed total fee for the closing transaction + */ public get_fee_satoshis(): bigint { const ret: bigint = bindings.ClosingSigned_get_fee_satoshis(this.ptr); return ret; } + /** + * The proposed total fee for the closing transaction + */ public set_fee_satoshis(val: bigint): void { bindings.ClosingSigned_set_fee_satoshis(this.ptr, val); } + /** + * A signature on the closing transaction + */ public get_signature(): Uint8Array { const ret: number = bindings.ClosingSigned_get_signature(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * A signature on the closing transaction + */ public set_signature(val: Uint8Array): void { bindings.ClosingSigned_set_signature(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * The minimum and maximum fees which the sender is willing to accept, provided only by new + * nodes. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_fee_range(): ClosingSignedFeeRange { const ret: number = bindings.ClosingSigned_get_fee_range(this.ptr); const ret_hu_conv: ClosingSignedFeeRange = new ClosingSignedFeeRange(null, ret); @@ -323,10 +350,19 @@ export class ClosingSigned extends CommonBase { return ret_hu_conv; } + /** + * The minimum and maximum fees which the sender is willing to accept, provided only by new + * nodes. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_fee_range(val: ClosingSignedFeeRange): void { bindings.ClosingSigned_set_fee_range(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new ClosingSigned given each field + */ public static constructor_new(channel_id_arg: Uint8Array, fee_satoshis_arg: bigint, signature_arg: Uint8Array, fee_range_arg: ClosingSignedFeeRange): ClosingSigned { const ret: number = bindings.ClosingSigned_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), fee_satoshis_arg, bindings.encodeUint8Array(bindings.check_arr_len(signature_arg, 64)), fee_range_arg == null ? 0 : CommonBase.get_ptr_of(fee_range_arg) & ~1); const ret_hu_conv: ClosingSigned = new ClosingSigned(null, ret); @@ -339,6 +375,9 @@ export class ClosingSigned extends CommonBase { return ret; } + /** + * Creates a copy of the ClosingSigned + */ public clone(): ClosingSigned { const ret: number = bindings.ClosingSigned_clone(this.ptr); const ret_hu_conv: ClosingSigned = new ClosingSigned(null, ret); @@ -346,12 +385,18 @@ export class ClosingSigned extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read + */ public write(): Uint8Array { const ret: number = bindings.ClosingSigned_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ClosingSigned from a byte array, created by ClosingSigned_write + */ public static constructor_read(ser: Uint8Array): Result_ClosingSignedDecodeErrorZ { const ret: number = bindings.ClosingSigned_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ClosingSignedDecodeErrorZ = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ClosingSignedFeeRange.mts b/ts/structs/ClosingSignedFeeRange.mts index 13da9438..3fe3c79e 100644 --- a/ts/structs/ClosingSignedFeeRange.mts +++ b/ts/structs/ClosingSignedFeeRange.mts @@ -281,30 +281,54 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * The minimum and maximum fees which the sender is willing to place on the closing transaction. + * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing + * to use. + */ export class ClosingSignedFeeRange extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ClosingSignedFeeRange_free); } + /** + * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing + * transaction. + */ public get_min_fee_satoshis(): bigint { const ret: bigint = bindings.ClosingSignedFeeRange_get_min_fee_satoshis(this.ptr); return ret; } + /** + * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing + * transaction. + */ public set_min_fee_satoshis(val: bigint): void { bindings.ClosingSignedFeeRange_set_min_fee_satoshis(this.ptr, val); } + /** + * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing + * transaction. + */ public get_max_fee_satoshis(): bigint { const ret: bigint = bindings.ClosingSignedFeeRange_get_max_fee_satoshis(this.ptr); return ret; } + /** + * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing + * transaction. + */ public set_max_fee_satoshis(val: bigint): void { bindings.ClosingSignedFeeRange_set_max_fee_satoshis(this.ptr, val); } + /** + * Constructs a new ClosingSignedFeeRange given each field + */ public static constructor_new(min_fee_satoshis_arg: bigint, max_fee_satoshis_arg: bigint): ClosingSignedFeeRange { const ret: number = bindings.ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg); const ret_hu_conv: ClosingSignedFeeRange = new ClosingSignedFeeRange(null, ret); @@ -317,6 +341,9 @@ export class ClosingSignedFeeRange extends CommonBase { return ret; } + /** + * Creates a copy of the ClosingSignedFeeRange + */ public clone(): ClosingSignedFeeRange { const ret: number = bindings.ClosingSignedFeeRange_clone(this.ptr); const ret_hu_conv: ClosingSignedFeeRange = new ClosingSignedFeeRange(null, ret); @@ -324,12 +351,18 @@ export class ClosingSignedFeeRange extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read + */ public write(): Uint8Array { const ret: number = bindings.ClosingSignedFeeRange_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write + */ public static constructor_read(ser: Uint8Array): Result_ClosingSignedFeeRangeDecodeErrorZ { const ret: number = bindings.ClosingSignedFeeRange_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ClosingSignedFeeRangeDecodeErrorZ = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ClosingTransaction.mts b/ts/structs/ClosingTransaction.mts index 4dd07455..cd5ff846 100644 --- a/ts/structs/ClosingTransaction.mts +++ b/ts/structs/ClosingTransaction.mts @@ -281,6 +281,13 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * This class tracks the per-transaction information needed to build a closing transaction and will + * actually build it and sign. + * + * This class can be used inside a signer implementation to generate a signature given the relevant + * secret key. + */ export class ClosingTransaction extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { @@ -292,6 +299,9 @@ export class ClosingTransaction extends CommonBase { return ret; } + /** + * Creates a copy of the ClosingTransaction + */ public clone(): ClosingTransaction { const ret: number = bindings.ClosingTransaction_clone(this.ptr); const ret_hu_conv: ClosingTransaction = new ClosingTransaction(null, ret); @@ -299,11 +309,17 @@ export class ClosingTransaction extends CommonBase { return ret_hu_conv; } + /** + * Checks if two ClosingTransactions contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.ClosingTransaction_hash(this.ptr); return ret; } + /** + * Construct an object of the class + */ public static constructor_new(to_holder_value_sat: bigint, to_counterparty_value_sat: bigint, to_holder_script: Uint8Array, to_counterparty_script: Uint8Array, funding_outpoint: OutPoint): ClosingTransaction { const ret: number = bindings.ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, bindings.encodeUint8Array(to_holder_script), bindings.encodeUint8Array(to_counterparty_script), funding_outpoint == null ? 0 : CommonBase.get_ptr_of(funding_outpoint) & ~1); const ret_hu_conv: ClosingTransaction = new ClosingTransaction(null, ret); @@ -311,6 +327,14 @@ export class ClosingTransaction extends CommonBase { return ret_hu_conv; } + /** + * Trust our pre-built transaction. + * + * Applies a wrapper which allows access to the transaction. + * + * This should only be used if you fully trust the builder of this object. It should not + * be used by an external signer - instead use the verify function. + */ public trust(): TrustedClosingTransaction { const ret: number = bindings.ClosingTransaction_trust(this.ptr); const ret_hu_conv: TrustedClosingTransaction = new TrustedClosingTransaction(null, ret); @@ -318,28 +342,48 @@ export class ClosingTransaction extends CommonBase { return ret_hu_conv; } + /** + * Verify our pre-built transaction. + * + * Applies a wrapper which allows access to the transaction. + * + * An external validating signer must call this method before signing + * or using the built transaction. + */ public verify(funding_outpoint: OutPoint): Result_TrustedClosingTransactionNoneZ { const ret: number = bindings.ClosingTransaction_verify(this.ptr, funding_outpoint == null ? 0 : CommonBase.get_ptr_of(funding_outpoint) & ~1); const ret_hu_conv: Result_TrustedClosingTransactionNoneZ = Result_TrustedClosingTransactionNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * The value to be sent to the holder, or zero if the output will be omitted + */ public to_holder_value_sat(): bigint { const ret: bigint = bindings.ClosingTransaction_to_holder_value_sat(this.ptr); return ret; } + /** + * The value to be sent to the counterparty, or zero if the output will be omitted + */ public to_counterparty_value_sat(): bigint { const ret: bigint = bindings.ClosingTransaction_to_counterparty_value_sat(this.ptr); return ret; } + /** + * The destination of the holder's output + */ public to_holder_script(): Uint8Array { const ret: number = bindings.ClosingTransaction_to_holder_script(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The destination of the counterparty's output + */ public to_counterparty_script(): Uint8Array { const ret: number = bindings.ClosingTransaction_to_counterparty_script(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); diff --git a/ts/structs/ClosureReason.mts b/ts/structs/ClosureReason.mts index 891376a1..cfeb62b4 100644 --- a/ts/structs/ClosureReason.mts +++ b/ts/structs/ClosureReason.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * The reason the channel was closed. See individual variants more details. + */ export class ClosureReason extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.ClosureReason_free); } /* @internal */ @@ -304,6 +307,9 @@ export class ClosureReason extends CommonBase { return ret; } + /** + * Creates a copy of the ClosureReason + */ public clone(): ClosureReason { const ret: number = bindings.ClosureReason_clone(this.ptr); const ret_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(ret); @@ -311,6 +317,9 @@ export class ClosureReason extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason + */ public static constructor_counterparty_force_closed(peer_msg: string): ClosureReason { const ret: number = bindings.ClosureReason_counterparty_force_closed(bindings.encodeString(peer_msg)); const ret_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(ret); @@ -318,6 +327,9 @@ export class ClosureReason extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new HolderForceClosed-variant ClosureReason + */ public static constructor_holder_force_closed(): ClosureReason { const ret: number = bindings.ClosureReason_holder_force_closed(); const ret_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(ret); @@ -325,6 +337,9 @@ export class ClosureReason extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new CooperativeClosure-variant ClosureReason + */ public static constructor_cooperative_closure(): ClosureReason { const ret: number = bindings.ClosureReason_cooperative_closure(); const ret_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(ret); @@ -332,6 +347,9 @@ export class ClosureReason extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason + */ public static constructor_commitment_tx_confirmed(): ClosureReason { const ret: number = bindings.ClosureReason_commitment_tx_confirmed(); const ret_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(ret); @@ -339,6 +357,9 @@ export class ClosureReason extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new FundingTimedOut-variant ClosureReason + */ public static constructor_funding_timed_out(): ClosureReason { const ret: number = bindings.ClosureReason_funding_timed_out(); const ret_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(ret); @@ -346,6 +367,9 @@ export class ClosureReason extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new ProcessingError-variant ClosureReason + */ public static constructor_processing_error(err: string): ClosureReason { const ret: number = bindings.ClosureReason_processing_error(bindings.encodeString(err)); const ret_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(ret); @@ -353,6 +377,9 @@ export class ClosureReason extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new DisconnectedPeer-variant ClosureReason + */ public static constructor_disconnected_peer(): ClosureReason { const ret: number = bindings.ClosureReason_disconnected_peer(); const ret_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(ret); @@ -360,6 +387,9 @@ export class ClosureReason extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason + */ public static constructor_outdated_channel_manager(): ClosureReason { const ret: number = bindings.ClosureReason_outdated_channel_manager(); const ret_hu_conv: ClosureReason = ClosureReason.constr_from_ptr(ret); @@ -367,6 +397,9 @@ export class ClosureReason extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read + */ public write(): Uint8Array { const ret: number = bindings.ClosureReason_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); @@ -374,7 +407,15 @@ export class ClosureReason extends CommonBase { } } +/** A ClosureReason of type CounterpartyForceClosed */ export class ClosureReason_CounterpartyForceClosed extends ClosureReason { + /** + * The error which the peer sent us. + * + * The string should be sanitized before it is used (e.g emitted to logs + * or printed to stdout). Otherwise, a well crafted error message may exploit + * a security vulnerability in the terminal emulator or the logging subsystem. + */ public peer_msg: string; /* @internal */ public constructor(ptr: number) { @@ -384,31 +425,39 @@ export class ClosureReason_CounterpartyForceClosed extends ClosureReason { this.peer_msg = peer_msg_conv; } } +/** A ClosureReason of type HolderForceClosed */ export class ClosureReason_HolderForceClosed extends ClosureReason { /* @internal */ public constructor(ptr: number) { super(null, ptr); } } +/** A ClosureReason of type CooperativeClosure */ export class ClosureReason_CooperativeClosure extends ClosureReason { /* @internal */ public constructor(ptr: number) { super(null, ptr); } } +/** A ClosureReason of type CommitmentTxConfirmed */ export class ClosureReason_CommitmentTxConfirmed extends ClosureReason { /* @internal */ public constructor(ptr: number) { super(null, ptr); } } +/** A ClosureReason of type FundingTimedOut */ export class ClosureReason_FundingTimedOut extends ClosureReason { /* @internal */ public constructor(ptr: number) { super(null, ptr); } } +/** A ClosureReason of type ProcessingError */ export class ClosureReason_ProcessingError extends ClosureReason { + /** + * A developer-readable error message which we generated. + */ public err: string; /* @internal */ public constructor(ptr: number) { @@ -418,12 +467,14 @@ export class ClosureReason_ProcessingError extends ClosureReason { this.err = err_conv; } } +/** A ClosureReason of type DisconnectedPeer */ export class ClosureReason_DisconnectedPeer extends ClosureReason { /* @internal */ public constructor(ptr: number) { super(null, ptr); } } +/** A ClosureReason of type OutdatedChannelManager */ export class ClosureReason_OutdatedChannelManager extends ClosureReason { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/CommitmentSigned.mts b/ts/structs/CommitmentSigned.mts index 989eca3d..60a519a6 100644 --- a/ts/structs/CommitmentSigned.mts +++ b/ts/structs/CommitmentSigned.mts @@ -281,36 +281,57 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A commitment_signed message to be sent or received from a peer + */ export class CommitmentSigned extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.CommitmentSigned_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.CommitmentSigned_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.CommitmentSigned_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * A signature on the commitment transaction + */ public get_signature(): Uint8Array { const ret: number = bindings.CommitmentSigned_get_signature(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * A signature on the commitment transaction + */ public set_signature(val: Uint8Array): void { bindings.CommitmentSigned_set_signature(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * Signatures on the HTLC transactions + */ public set_htlc_signatures(val: Uint8Array[]): void { bindings.CommitmentSigned_set_htlc_signatures(this.ptr, bindings.encodeUint32Array(val != null ? val.map(val_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(val_conv_12, 64))) : null)); } + /** + * Constructs a new CommitmentSigned given each field + */ public static constructor_new(channel_id_arg: Uint8Array, signature_arg: Uint8Array, htlc_signatures_arg: Uint8Array[]): CommitmentSigned { const ret: number = bindings.CommitmentSigned_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), bindings.encodeUint8Array(bindings.check_arr_len(signature_arg, 64)), bindings.encodeUint32Array(htlc_signatures_arg != null ? htlc_signatures_arg.map(htlc_signatures_arg_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(htlc_signatures_arg_conv_12, 64))) : null)); const ret_hu_conv: CommitmentSigned = new CommitmentSigned(null, ret); @@ -323,6 +344,9 @@ export class CommitmentSigned extends CommonBase { return ret; } + /** + * Creates a copy of the CommitmentSigned + */ public clone(): CommitmentSigned { const ret: number = bindings.CommitmentSigned_clone(this.ptr); const ret_hu_conv: CommitmentSigned = new CommitmentSigned(null, ret); @@ -330,12 +354,18 @@ export class CommitmentSigned extends CommonBase { return ret_hu_conv; } + /** + * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read + */ public write(): Uint8Array { const ret: number = bindings.CommitmentSigned_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write + */ public static constructor_read(ser: Uint8Array): Result_CommitmentSignedDecodeErrorZ { const ret: number = bindings.CommitmentSigned_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_CommitmentSignedDecodeErrorZ = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/CommitmentTransaction.mts b/ts/structs/CommitmentTransaction.mts index eaf63efc..2155e2c7 100644 --- a/ts/structs/CommitmentTransaction.mts +++ b/ts/structs/CommitmentTransaction.mts @@ -281,6 +281,14 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * This class tracks the per-transaction information needed to build a commitment transaction and will + * actually build it and sign. It is used for holder transactions that we sign only when needed + * and for transactions we sign for the counterparty. + * + * This class can be used inside a signer implementation to generate a signature given the relevant + * secret key. + */ export class CommitmentTransaction extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { @@ -292,6 +300,9 @@ export class CommitmentTransaction extends CommonBase { return ret; } + /** + * Creates a copy of the CommitmentTransaction + */ public clone(): CommitmentTransaction { const ret: number = bindings.CommitmentTransaction_clone(this.ptr); const ret_hu_conv: CommitmentTransaction = new CommitmentTransaction(null, ret); @@ -299,38 +310,64 @@ export class CommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read + */ public write(): Uint8Array { const ret: number = bindings.CommitmentTransaction_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write + */ public static constructor_read(ser: Uint8Array): Result_CommitmentTransactionDecodeErrorZ { const ret: number = bindings.CommitmentTransaction_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_CommitmentTransactionDecodeErrorZ = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * The backwards-counting commitment number + */ public commitment_number(): bigint { const ret: bigint = bindings.CommitmentTransaction_commitment_number(this.ptr); return ret; } + /** + * The value to be sent to the broadcaster + */ public to_broadcaster_value_sat(): bigint { const ret: bigint = bindings.CommitmentTransaction_to_broadcaster_value_sat(this.ptr); return ret; } + /** + * The value to be sent to the counterparty + */ public to_countersignatory_value_sat(): bigint { const ret: bigint = bindings.CommitmentTransaction_to_countersignatory_value_sat(this.ptr); return ret; } + /** + * The feerate paid per 1000-weight-unit in this commitment transaction. + */ public feerate_per_kw(): number { const ret: number = bindings.CommitmentTransaction_feerate_per_kw(this.ptr); return ret; } + /** + * Trust our pre-built transaction and derived transaction creation public keys. + * + * Applies a wrapper which allows access to these fields. + * + * This should only be used if you fully trust the builder of this object. It should not + * be used by an external signer - instead use the verify function. + */ public trust(): TrustedCommitmentTransaction { const ret: number = bindings.CommitmentTransaction_trust(this.ptr); const ret_hu_conv: TrustedCommitmentTransaction = new TrustedCommitmentTransaction(null, ret); @@ -338,6 +375,14 @@ export class CommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * Verify our pre-built transaction and derived transaction creation public keys. + * + * Applies a wrapper which allows access to these fields. + * + * An external validating signer must call this method before signing + * or using the built transaction. + */ public verify(channel_parameters: DirectedChannelTransactionParameters, broadcaster_keys: ChannelPublicKeys, countersignatory_keys: ChannelPublicKeys): Result_TrustedCommitmentTransactionNoneZ { const ret: number = bindings.CommitmentTransaction_verify(this.ptr, channel_parameters == null ? 0 : CommonBase.get_ptr_of(channel_parameters) & ~1, broadcaster_keys == null ? 0 : CommonBase.get_ptr_of(broadcaster_keys) & ~1, countersignatory_keys == null ? 0 : CommonBase.get_ptr_of(countersignatory_keys) & ~1); const ret_hu_conv: Result_TrustedCommitmentTransactionNoneZ = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/CommitmentUpdate.mts b/ts/structs/CommitmentUpdate.mts index 705129c5..8eff6401 100644 --- a/ts/structs/CommitmentUpdate.mts +++ b/ts/structs/CommitmentUpdate.mts @@ -281,12 +281,19 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment + * transaction updates if they were pending. + */ export class CommitmentUpdate extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.CommitmentUpdate_free); } + /** + * update_add_htlc messages which should be sent + */ public get_update_add_htlcs(): UpdateAddHTLC[] { const ret: number = bindings.CommitmentUpdate_get_update_add_htlcs(this.ptr); const ret_conv_15_len: number = bindings.getArrayLength(ret); @@ -297,13 +304,20 @@ export class CommitmentUpdate extends CommonBase { CommonBase.add_ref_from(ret_conv_15_hu_conv, this); ret_conv_15_arr[p] = ret_conv_15_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_15_arr; } + /** + * update_add_htlc messages which should be sent + */ public set_update_add_htlcs(val: UpdateAddHTLC[]): void { bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, bindings.encodeUint32Array(val != null ? val.map(val_conv_15 => val_conv_15 == null ? 0 : CommonBase.get_ptr_of(val_conv_15) & ~1) : null)); } + /** + * update_fulfill_htlc messages which should be sent + */ public get_update_fulfill_htlcs(): UpdateFulfillHTLC[] { const ret: number = bindings.CommitmentUpdate_get_update_fulfill_htlcs(this.ptr); const ret_conv_19_len: number = bindings.getArrayLength(ret); @@ -314,13 +328,20 @@ export class CommitmentUpdate extends CommonBase { CommonBase.add_ref_from(ret_conv_19_hu_conv, this); ret_conv_19_arr[t] = ret_conv_19_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_19_arr; } + /** + * update_fulfill_htlc messages which should be sent + */ public set_update_fulfill_htlcs(val: UpdateFulfillHTLC[]): void { bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, bindings.encodeUint32Array(val != null ? val.map(val_conv_19 => val_conv_19 == null ? 0 : CommonBase.get_ptr_of(val_conv_19) & ~1) : null)); } + /** + * update_fail_htlc messages which should be sent + */ public get_update_fail_htlcs(): UpdateFailHTLC[] { const ret: number = bindings.CommitmentUpdate_get_update_fail_htlcs(this.ptr); const ret_conv_16_len: number = bindings.getArrayLength(ret); @@ -331,13 +352,20 @@ export class CommitmentUpdate extends CommonBase { CommonBase.add_ref_from(ret_conv_16_hu_conv, this); ret_conv_16_arr[q] = ret_conv_16_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_16_arr; } + /** + * update_fail_htlc messages which should be sent + */ public set_update_fail_htlcs(val: UpdateFailHTLC[]): void { bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, bindings.encodeUint32Array(val != null ? val.map(val_conv_16 => val_conv_16 == null ? 0 : CommonBase.get_ptr_of(val_conv_16) & ~1) : null)); } + /** + * update_fail_malformed_htlc messages which should be sent + */ public get_update_fail_malformed_htlcs(): UpdateFailMalformedHTLC[] { const ret: number = bindings.CommitmentUpdate_get_update_fail_malformed_htlcs(this.ptr); const ret_conv_25_len: number = bindings.getArrayLength(ret); @@ -348,13 +376,22 @@ export class CommitmentUpdate extends CommonBase { CommonBase.add_ref_from(ret_conv_25_hu_conv, this); ret_conv_25_arr[z] = ret_conv_25_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_25_arr; } + /** + * update_fail_malformed_htlc messages which should be sent + */ public set_update_fail_malformed_htlcs(val: UpdateFailMalformedHTLC[]): void { bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, bindings.encodeUint32Array(val != null ? val.map(val_conv_25 => val_conv_25 == null ? 0 : CommonBase.get_ptr_of(val_conv_25) & ~1) : null)); } + /** + * An update_fee message which should be sent + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_update_fee(): UpdateFee { const ret: number = bindings.CommitmentUpdate_get_update_fee(this.ptr); const ret_hu_conv: UpdateFee = new UpdateFee(null, ret); @@ -362,10 +399,18 @@ export class CommitmentUpdate extends CommonBase { return ret_hu_conv; } + /** + * An update_fee message which should be sent + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_update_fee(val: UpdateFee): void { bindings.CommitmentUpdate_set_update_fee(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Finally, the commitment_signed message which should be sent + */ public get_commitment_signed(): CommitmentSigned { const ret: number = bindings.CommitmentUpdate_get_commitment_signed(this.ptr); const ret_hu_conv: CommitmentSigned = new CommitmentSigned(null, ret); @@ -373,10 +418,16 @@ export class CommitmentUpdate extends CommonBase { return ret_hu_conv; } + /** + * Finally, the commitment_signed message which should be sent + */ public set_commitment_signed(val: CommitmentSigned): void { bindings.CommitmentUpdate_set_commitment_signed(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new CommitmentUpdate given each field + */ public static constructor_new(update_add_htlcs_arg: UpdateAddHTLC[], update_fulfill_htlcs_arg: UpdateFulfillHTLC[], update_fail_htlcs_arg: UpdateFailHTLC[], update_fail_malformed_htlcs_arg: UpdateFailMalformedHTLC[], update_fee_arg: UpdateFee, commitment_signed_arg: CommitmentSigned): CommitmentUpdate { const ret: number = bindings.CommitmentUpdate_new(bindings.encodeUint32Array(update_add_htlcs_arg != null ? update_add_htlcs_arg.map(update_add_htlcs_arg_conv_15 => update_add_htlcs_arg_conv_15 == null ? 0 : CommonBase.get_ptr_of(update_add_htlcs_arg_conv_15) & ~1) : null), bindings.encodeUint32Array(update_fulfill_htlcs_arg != null ? update_fulfill_htlcs_arg.map(update_fulfill_htlcs_arg_conv_19 => update_fulfill_htlcs_arg_conv_19 == null ? 0 : CommonBase.get_ptr_of(update_fulfill_htlcs_arg_conv_19) & ~1) : null), bindings.encodeUint32Array(update_fail_htlcs_arg != null ? update_fail_htlcs_arg.map(update_fail_htlcs_arg_conv_16 => update_fail_htlcs_arg_conv_16 == null ? 0 : CommonBase.get_ptr_of(update_fail_htlcs_arg_conv_16) & ~1) : null), bindings.encodeUint32Array(update_fail_malformed_htlcs_arg != null ? update_fail_malformed_htlcs_arg.map(update_fail_malformed_htlcs_arg_conv_25 => update_fail_malformed_htlcs_arg_conv_25 == null ? 0 : CommonBase.get_ptr_of(update_fail_malformed_htlcs_arg_conv_25) & ~1) : null), update_fee_arg == null ? 0 : CommonBase.get_ptr_of(update_fee_arg) & ~1, commitment_signed_arg == null ? 0 : CommonBase.get_ptr_of(commitment_signed_arg) & ~1); const ret_hu_conv: CommitmentUpdate = new CommitmentUpdate(null, ret); @@ -389,6 +440,9 @@ export class CommitmentUpdate extends CommonBase { return ret; } + /** + * Creates a copy of the CommitmentUpdate + */ public clone(): CommitmentUpdate { const ret: number = bindings.CommitmentUpdate_clone(this.ptr); const ret_hu_conv: CommitmentUpdate = new CommitmentUpdate(null, ret); diff --git a/ts/structs/Confirm.mts b/ts/structs/Confirm.mts index 2878b12d..5d08223b 100644 --- a/ts/structs/Confirm.mts +++ b/ts/structs/Confirm.mts @@ -283,10 +283,53 @@ import * as bindings from '../bindings.mjs' +/** An implementation of Confirm */ export interface ConfirmInterface { + /**Processes transactions confirmed in a block with a given header and height. + * + * Should be called for any transactions registered by [`Filter::register_tx`] or any + * transactions spending an output registered by [`Filter::register_output`]. Such transactions + * appearing in the same block do not need to be included in the same call; instead, multiple + * calls with additional transactions may be made so long as they are made in [chain order]. + * + * May be called before or after [`best_block_updated`] for the corresponding block. However, + * in the event of a chain reorganization, it must not be called with a `header` that is no + * longer in the chain as of the last call to [`best_block_updated`]. + * + * [chain order]: Confirm#Order + * [`best_block_updated`]: Self::best_block_updated + */ transactions_confirmed(header: Uint8Array, txdata: TwoTuple_usizeTransactionZ[], height: number): void; + /**Processes a transaction that is no longer confirmed as result of a chain reorganization. + * + * Should be called for any transaction returned by [`get_relevant_txids`] if it has been + * reorganized out of the best chain. Once called, the given transaction should not be returned + * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`]. + * + * [`get_relevant_txids`]: Self::get_relevant_txids + * [`transactions_confirmed`]: Self::transactions_confirmed + */ transaction_unconfirmed(txid: Uint8Array): void; + /**Processes an update to the best header connected at the given height. + * + * Should be called when a new header is available but may be skipped for intermediary blocks + * if they become available at the same time. + */ best_block_updated(header: Uint8Array, height: number): void; + /**Returns transactions that should be monitored for reorganization out of the chain. + * + * Should include any transactions passed to [`transactions_confirmed`] that have insufficient + * confirmations to be safe from a chain reorganization. Should not include any transactions + * passed to [`transaction_unconfirmed`] unless later reconfirmed. + * + * May be called to determine the subset of transactions that must still be monitored for + * reorganization. Will be idempotent between calls but may change as a result of calls to the + * other interface methods. Thus, this is useful to determine which transactions may need to be + * given to [`transaction_unconfirmed`]. + * + * [`transactions_confirmed`]: Self::transactions_confirmed + * [`transaction_unconfirmed`]: Self::transaction_unconfirmed + */ get_relevant_txids(): Uint8Array[]; } @@ -294,6 +337,40 @@ class LDKConfirmHolder { held: Confirm; } +/** + * The `Confirm` trait is used to notify when transactions have been confirmed on chain or + * unconfirmed during a chain reorganization. + * + * Clients sourcing chain data using a transaction-oriented API should prefer this interface over + * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity + * related to registered transactions and outputs. Upon notification, it would pass along the + * matching transactions using this interface. + * + * # Use + * + * The intended use is as follows: + * - Call [`transactions_confirmed`] to process any on-chain activity of interest. + * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`] + * that has been reorganized out of the chain. + * - Call [`best_block_updated`] whenever a new chain tip becomes available. + * + * # Order + * + * Clients must call these methods in chain order. Specifically: + * - Transactions confirmed in a block must be given before transactions confirmed in a later + * block. + * - Dependent transactions within the same block must be given in topological order, possibly in + * separate calls. + * - Unconfirmed transactions must be given after the original confirmations and before any + * reconfirmation. + * + * See individual method documentation for further details. + * + * [`transactions_confirmed`]: Self::transactions_confirmed + * [`transaction_unconfirmed`]: Self::transaction_unconfirmed + * [`best_block_updated`]: Self::best_block_updated + * [`get_relevant_txids`]: Self::get_relevant_txids + */ export class Confirm extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKConfirm; @@ -304,7 +381,8 @@ export class Confirm extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: ConfirmInterface): Confirm { + /** Creates a new instance of Confirm from a given implementation */ + public static new_impl(arg: ConfirmInterface): Confirm { const impl_holder: LDKConfirmHolder = new LDKConfirmHolder(); let structImplementation = { transactions_confirmed (header: number, txdata: number, height: number): void { @@ -317,6 +395,7 @@ export class Confirm extends CommonBase { CommonBase.add_ref_from(txdata_conv_28_hu_conv, this); txdata_conv_28_arr[c] = txdata_conv_28_hu_conv; } + bindings.freeWasmMemory(txdata) arg.transactions_confirmed(header_conv, txdata_conv_28_arr, height); }, transaction_unconfirmed (txid: number): void { @@ -339,18 +418,65 @@ export class Confirm extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Processes transactions confirmed in a block with a given header and height. + * + * Should be called for any transactions registered by [`Filter::register_tx`] or any + * transactions spending an output registered by [`Filter::register_output`]. Such transactions + * appearing in the same block do not need to be included in the same call; instead, multiple + * calls with additional transactions may be made so long as they are made in [chain order]. + * + * May be called before or after [`best_block_updated`] for the corresponding block. However, + * in the event of a chain reorganization, it must not be called with a `header` that is no + * longer in the chain as of the last call to [`best_block_updated`]. + * + * [chain order]: Confirm#Order + * [`best_block_updated`]: Self::best_block_updated + */ public transactions_confirmed(header: Uint8Array, txdata: TwoTuple_usizeTransactionZ[], height: number): void { bindings.Confirm_transactions_confirmed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), bindings.encodeUint32Array(txdata != null ? txdata.map(txdata_conv_28 => txdata_conv_28 != null ? CommonBase.get_ptr_of(txdata_conv_28) : 0) : null), height); } + /** + * Processes a transaction that is no longer confirmed as result of a chain reorganization. + * + * Should be called for any transaction returned by [`get_relevant_txids`] if it has been + * reorganized out of the best chain. Once called, the given transaction should not be returned + * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`]. + * + * [`get_relevant_txids`]: Self::get_relevant_txids + * [`transactions_confirmed`]: Self::transactions_confirmed + */ public transaction_unconfirmed(txid: Uint8Array): void { bindings.Confirm_transaction_unconfirmed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(txid, 32))); } + /** + * Processes an update to the best header connected at the given height. + * + * Should be called when a new header is available but may be skipped for intermediary blocks + * if they become available at the same time. + */ public best_block_updated(header: Uint8Array, height: number): void { bindings.Confirm_best_block_updated(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), height); } + /** + * Returns transactions that should be monitored for reorganization out of the chain. + * + * Should include any transactions passed to [`transactions_confirmed`] that have insufficient + * confirmations to be safe from a chain reorganization. Should not include any transactions + * passed to [`transaction_unconfirmed`] unless later reconfirmed. + * + * May be called to determine the subset of transactions that must still be monitored for + * reorganization. Will be idempotent between calls but may change as a result of calls to the + * other interface methods. Thus, this is useful to determine which transactions may need to be + * given to [`transaction_unconfirmed`]. + * + * [`transactions_confirmed`]: Self::transactions_confirmed + * [`transaction_unconfirmed`]: Self::transaction_unconfirmed + */ public get_relevant_txids(): Uint8Array[] { const ret: number = bindings.Confirm_get_relevant_txids(this.ptr); const ret_conv_12_len: number = bindings.getArrayLength(ret); @@ -360,6 +486,7 @@ export class Confirm extends CommonBase { const ret_conv_12_conv: Uint8Array = bindings.decodeUint8Array(ret_conv_12); ret_conv_12_arr[m] = ret_conv_12_conv; } + bindings.freeWasmMemory(ret) return ret_conv_12_arr; } diff --git a/ts/structs/CounterpartyChannelTransactionParameters.mts b/ts/structs/CounterpartyChannelTransactionParameters.mts index 56bf5f33..1c674442 100644 --- a/ts/structs/CounterpartyChannelTransactionParameters.mts +++ b/ts/structs/CounterpartyChannelTransactionParameters.mts @@ -281,12 +281,18 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Late-bound per-channel counterparty data used to build transactions. + */ export class CounterpartyChannelTransactionParameters extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.CounterpartyChannelTransactionParameters_free); } + /** + * Counter-party public keys + */ public get_pubkeys(): ChannelPublicKeys { const ret: number = bindings.CounterpartyChannelTransactionParameters_get_pubkeys(this.ptr); const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); @@ -294,19 +300,31 @@ export class CounterpartyChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Counter-party public keys + */ public set_pubkeys(val: ChannelPublicKeys): void { bindings.CounterpartyChannelTransactionParameters_set_pubkeys(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The contest delay selected by the counterparty, which applies to holder-broadcast transactions + */ public get_selected_contest_delay(): number { const ret: number = bindings.CounterpartyChannelTransactionParameters_get_selected_contest_delay(this.ptr); return ret; } + /** + * The contest delay selected by the counterparty, which applies to holder-broadcast transactions + */ public set_selected_contest_delay(val: number): void { bindings.CounterpartyChannelTransactionParameters_set_selected_contest_delay(this.ptr, val); } + /** + * Constructs a new CounterpartyChannelTransactionParameters given each field + */ public static constructor_new(pubkeys_arg: ChannelPublicKeys, selected_contest_delay_arg: number): CounterpartyChannelTransactionParameters { const ret: number = bindings.CounterpartyChannelTransactionParameters_new(pubkeys_arg == null ? 0 : CommonBase.get_ptr_of(pubkeys_arg) & ~1, selected_contest_delay_arg); const ret_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, ret); @@ -319,6 +337,9 @@ export class CounterpartyChannelTransactionParameters extends CommonBase { return ret; } + /** + * Creates a copy of the CounterpartyChannelTransactionParameters + */ public clone(): CounterpartyChannelTransactionParameters { const ret: number = bindings.CounterpartyChannelTransactionParameters_clone(this.ptr); const ret_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, ret); @@ -326,12 +347,18 @@ export class CounterpartyChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read + */ public write(): Uint8Array { const ret: number = bindings.CounterpartyChannelTransactionParameters_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write + */ public static constructor_read(ser: Uint8Array): Result_CounterpartyChannelTransactionParametersDecodeErrorZ { const ret: number = bindings.CounterpartyChannelTransactionParameters_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_CounterpartyChannelTransactionParametersDecodeErrorZ = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/CounterpartyForwardingInfo.mts b/ts/structs/CounterpartyForwardingInfo.mts index 48233820..6c0fb474 100644 --- a/ts/structs/CounterpartyForwardingInfo.mts +++ b/ts/structs/CounterpartyForwardingInfo.mts @@ -281,39 +281,67 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Information needed for constructing an invoice route hint for this channel. + */ export class CounterpartyForwardingInfo extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.CounterpartyForwardingInfo_free); } + /** + * Base routing fee in millisatoshis. + */ public get_fee_base_msat(): number { const ret: number = bindings.CounterpartyForwardingInfo_get_fee_base_msat(this.ptr); return ret; } + /** + * Base routing fee in millisatoshis. + */ public set_fee_base_msat(val: number): void { bindings.CounterpartyForwardingInfo_set_fee_base_msat(this.ptr, val); } + /** + * Amount in millionths of a satoshi the channel will charge per transferred satoshi. + */ public get_fee_proportional_millionths(): number { const ret: number = bindings.CounterpartyForwardingInfo_get_fee_proportional_millionths(this.ptr); return ret; } + /** + * Amount in millionths of a satoshi the channel will charge per transferred satoshi. + */ public set_fee_proportional_millionths(val: number): void { bindings.CounterpartyForwardingInfo_set_fee_proportional_millionths(this.ptr, val); } + /** + * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart, + * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s + * `cltv_expiry_delta` for more details. + */ public get_cltv_expiry_delta(): number { const ret: number = bindings.CounterpartyForwardingInfo_get_cltv_expiry_delta(this.ptr); return ret; } + /** + * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart, + * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s + * `cltv_expiry_delta` for more details. + */ public set_cltv_expiry_delta(val: number): void { bindings.CounterpartyForwardingInfo_set_cltv_expiry_delta(this.ptr, val); } + /** + * Constructs a new CounterpartyForwardingInfo given each field + */ public static constructor_new(fee_base_msat_arg: number, fee_proportional_millionths_arg: number, cltv_expiry_delta_arg: number): CounterpartyForwardingInfo { const ret: number = bindings.CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); const ret_hu_conv: CounterpartyForwardingInfo = new CounterpartyForwardingInfo(null, ret); @@ -326,6 +354,9 @@ export class CounterpartyForwardingInfo extends CommonBase { return ret; } + /** + * Creates a copy of the CounterpartyForwardingInfo + */ public clone(): CounterpartyForwardingInfo { const ret: number = bindings.CounterpartyForwardingInfo_clone(this.ptr); const ret_hu_conv: CounterpartyForwardingInfo = new CounterpartyForwardingInfo(null, ret); diff --git a/ts/structs/CustomMessageHandler.mts b/ts/structs/CustomMessageHandler.mts index 585e17d3..db8cf77b 100644 --- a/ts/structs/CustomMessageHandler.mts +++ b/ts/structs/CustomMessageHandler.mts @@ -283,8 +283,17 @@ import * as bindings from '../bindings.mjs' +/** An implementation of CustomMessageHandler */ export interface CustomMessageHandlerInterface { + /**Called with the message type that was received and the buffer to be read. + * Can return a `MessageHandlingError` if the message could not be handled. + */ handle_custom_message(msg: Type, sender_node_id: Uint8Array): Result_NoneLightningErrorZ; + /**Gets the list of pending messages which were generated by the custom message + * handler, clearing the list in the process. The first tuple element must + * correspond to the intended recipients node ids. If no connection to one of the + * specified node does not exist, the message is simply not sent to it. + */ get_and_clear_pending_msg(): TwoTuple_PublicKeyTypeZ[]; } @@ -292,6 +301,9 @@ class LDKCustomMessageHandlerHolder { held: CustomMessageHandler; } +/** + * Handler for BOLT1-compliant messages. + */ export class CustomMessageHandler extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKCustomMessageHandler; @@ -302,7 +314,8 @@ export class CustomMessageHandler extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: CustomMessageHandlerInterface, customMessageReader_impl: CustomMessageReaderInterface): CustomMessageHandler { + /** Creates a new instance of CustomMessageHandler from a given implementation */ + public static new_impl(arg: CustomMessageHandlerInterface, customMessageReader_impl: CustomMessageReaderInterface): CustomMessageHandler { const impl_holder: LDKCustomMessageHandlerHolder = new LDKCustomMessageHandlerHolder(); let structImplementation = { handle_custom_message (msg: number, sender_node_id: number): number { @@ -327,6 +340,11 @@ export class CustomMessageHandler extends CommonBase { impl_holder.held.ptrs_to.push(customMessageReader); return impl_holder.held; } + + /** + * Called with the message type that was received and the buffer to be read. + * Can return a `MessageHandlingError` if the message could not be handled. + */ public handle_custom_message(msg: Type, sender_node_id: Uint8Array): Result_NoneLightningErrorZ { const ret: number = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg), bindings.encodeUint8Array(bindings.check_arr_len(sender_node_id, 33))); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); @@ -334,6 +352,12 @@ export class CustomMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Gets the list of pending messages which were generated by the custom message + * handler, clearing the list in the process. The first tuple element must + * correspond to the intended recipients node ids. If no connection to one of the + * specified node does not exist, the message is simply not sent to it. + */ public get_and_clear_pending_msg(): TwoTuple_PublicKeyTypeZ[] { const ret: number = bindings.CustomMessageHandler_get_and_clear_pending_msg(this.ptr); const ret_conv_25_len: number = bindings.getArrayLength(ret); @@ -344,6 +368,7 @@ export class CustomMessageHandler extends CommonBase { CommonBase.add_ref_from(ret_conv_25_hu_conv, this); ret_conv_25_arr[z] = ret_conv_25_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_25_arr; } diff --git a/ts/structs/CustomMessageReader.mts b/ts/structs/CustomMessageReader.mts index 4189b334..4f313819 100644 --- a/ts/structs/CustomMessageReader.mts +++ b/ts/structs/CustomMessageReader.mts @@ -283,7 +283,13 @@ import * as bindings from '../bindings.mjs' +/** An implementation of CustomMessageReader */ export interface CustomMessageReaderInterface { + /**Decodes a custom message to `CustomMessageType`. If the given message type is known to the + * implementation and the message could be decoded, must return `Ok(Some(message))`. If the + * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error + * occur, must return `Err(DecodeError::X)` where `X` details the encountered error. + */ read(message_type: number, buffer: Uint8Array): Result_COption_TypeZDecodeErrorZ; } @@ -291,6 +297,10 @@ class LDKCustomMessageReaderHolder { held: CustomMessageReader; } +/** + * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers) + * decoders. + */ export class CustomMessageReader extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKCustomMessageReader; @@ -301,7 +311,8 @@ export class CustomMessageReader extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: CustomMessageReaderInterface): CustomMessageReader { + /** Creates a new instance of CustomMessageReader from a given implementation */ + public static new_impl(arg: CustomMessageReaderInterface): CustomMessageReader { const impl_holder: LDKCustomMessageReaderHolder = new LDKCustomMessageReaderHolder(); let structImplementation = { read (message_type: number, buffer: number): number { @@ -317,6 +328,13 @@ export class CustomMessageReader extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Decodes a custom message to `CustomMessageType`. If the given message type is known to the + * implementation and the message could be decoded, must return `Ok(Some(message))`. If the + * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error + * occur, must return `Err(DecodeError::X)` where `X` details the encountered error. + */ public read(message_type: number, buffer: Uint8Array): Result_COption_TypeZDecodeErrorZ { const ret: number = bindings.CustomMessageReader_read(this.ptr, message_type, bindings.encodeUint8Array(buffer)); const ret_hu_conv: Result_COption_TypeZDecodeErrorZ = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/DataLossProtect.mts b/ts/structs/DataLossProtect.mts index 86c15f16..8f136867 100644 --- a/ts/structs/DataLossProtect.mts +++ b/ts/structs/DataLossProtect.mts @@ -281,32 +281,55 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Proof that the sender knows the per-commitment secret of the previous commitment transaction. + * This is used to convince the recipient that the channel is at a certain commitment + * number even if they lost that data due to a local failure. Of course, the peer may lie + * and even later commitments may have been revoked. + */ export class DataLossProtect extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.DataLossProtect_free); } + /** + * Proof that the sender knows the per-commitment secret of a specific commitment transaction + * belonging to the recipient + */ public get_your_last_per_commitment_secret(): Uint8Array { const ret: number = bindings.DataLossProtect_get_your_last_per_commitment_secret(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Proof that the sender knows the per-commitment secret of a specific commitment transaction + * belonging to the recipient + */ public set_your_last_per_commitment_secret(val: Uint8Array): void { bindings.DataLossProtect_set_your_last_per_commitment_secret(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The sender's per-commitment point for their current commitment transaction + */ public get_my_current_per_commitment_point(): Uint8Array { const ret: number = bindings.DataLossProtect_get_my_current_per_commitment_point(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The sender's per-commitment point for their current commitment transaction + */ public set_my_current_per_commitment_point(val: Uint8Array): void { bindings.DataLossProtect_set_my_current_per_commitment_point(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Constructs a new DataLossProtect given each field + */ public static constructor_new(your_last_per_commitment_secret_arg: Uint8Array, my_current_per_commitment_point_arg: Uint8Array): DataLossProtect { const ret: number = bindings.DataLossProtect_new(bindings.encodeUint8Array(bindings.check_arr_len(your_last_per_commitment_secret_arg, 32)), bindings.encodeUint8Array(bindings.check_arr_len(my_current_per_commitment_point_arg, 33))); const ret_hu_conv: DataLossProtect = new DataLossProtect(null, ret); @@ -319,6 +342,9 @@ export class DataLossProtect extends CommonBase { return ret; } + /** + * Creates a copy of the DataLossProtect + */ public clone(): DataLossProtect { const ret: number = bindings.DataLossProtect_clone(this.ptr); const ret_hu_conv: DataLossProtect = new DataLossProtect(null, ret); diff --git a/ts/structs/DecodeError.mts b/ts/structs/DecodeError.mts index 3e6c005f..7d75216e 100644 --- a/ts/structs/DecodeError.mts +++ b/ts/structs/DecodeError.mts @@ -281,6 +281,9 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An error in decoding a message or struct. + */ export class DecodeError extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { @@ -292,6 +295,9 @@ export class DecodeError extends CommonBase { return ret; } + /** + * Creates a copy of the DecodeError + */ public clone(): DecodeError { const ret: number = bindings.DecodeError_clone(this.ptr); const ret_hu_conv: DecodeError = new DecodeError(null, ret); diff --git a/ts/structs/DelayedPaymentOutputDescriptor.mts b/ts/structs/DelayedPaymentOutputDescriptor.mts index a9bb19b9..7a1ec1b0 100644 --- a/ts/structs/DelayedPaymentOutputDescriptor.mts +++ b/ts/structs/DelayedPaymentOutputDescriptor.mts @@ -281,12 +281,19 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Information about a spendable output to a P2WSH script. See + * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this. + */ export class DelayedPaymentOutputDescriptor extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.DelayedPaymentOutputDescriptor_free); } + /** + * The outpoint which is spendable + */ public get_outpoint(): OutPoint { const ret: number = bindings.DelayedPaymentOutputDescriptor_get_outpoint(this.ptr); const ret_hu_conv: OutPoint = new OutPoint(null, ret); @@ -294,62 +301,109 @@ export class DelayedPaymentOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * The outpoint which is spendable + */ public set_outpoint(val: OutPoint): void { bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Per commitment point to derive delayed_payment_key by key holder + */ public get_per_commitment_point(): Uint8Array { const ret: number = bindings.DelayedPaymentOutputDescriptor_get_per_commitment_point(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Per commitment point to derive delayed_payment_key by key holder + */ public set_per_commitment_point(val: Uint8Array): void { bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The nSequence value which must be set in the spending input to satisfy the OP_CSV in + * the witness_script. + */ public get_to_self_delay(): number { const ret: number = bindings.DelayedPaymentOutputDescriptor_get_to_self_delay(this.ptr); return ret; } + /** + * The nSequence value which must be set in the spending input to satisfy the OP_CSV in + * the witness_script. + */ public set_to_self_delay(val: number): void { bindings.DelayedPaymentOutputDescriptor_set_to_self_delay(this.ptr, val); } + /** + * The output which is referenced by the given outpoint + */ public set_output(val: TxOut): void { bindings.DelayedPaymentOutputDescriptor_set_output(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * The revocation point specific to the commitment transaction which was broadcast. Used to + * derive the witnessScript for this output. + */ public get_revocation_pubkey(): Uint8Array { const ret: number = bindings.DelayedPaymentOutputDescriptor_get_revocation_pubkey(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The revocation point specific to the commitment transaction which was broadcast. Used to + * derive the witnessScript for this output. + */ public set_revocation_pubkey(val: Uint8Array): void { bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Arbitrary identification information returned by a call to + * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in + * the channel to spend the output. + */ public get_channel_keys_id(): Uint8Array { const ret: number = bindings.DelayedPaymentOutputDescriptor_get_channel_keys_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Arbitrary identification information returned by a call to + * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in + * the channel to spend the output. + */ public set_channel_keys_id(val: Uint8Array): void { bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The value of the channel which this output originated from, possibly indirectly. + */ public get_channel_value_satoshis(): bigint { const ret: bigint = bindings.DelayedPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr); return ret; } + /** + * The value of the channel which this output originated from, possibly indirectly. + */ public set_channel_value_satoshis(val: bigint): void { bindings.DelayedPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val); } + /** + * Constructs a new DelayedPaymentOutputDescriptor given each field + */ public static constructor_new(outpoint_arg: OutPoint, per_commitment_point_arg: Uint8Array, to_self_delay_arg: number, output_arg: TxOut, revocation_pubkey_arg: Uint8Array, channel_keys_id_arg: Uint8Array, channel_value_satoshis_arg: bigint): DelayedPaymentOutputDescriptor { const ret: number = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : CommonBase.get_ptr_of(outpoint_arg) & ~1, bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point_arg, 33)), to_self_delay_arg, CommonBase.get_ptr_of(output_arg), bindings.encodeUint8Array(bindings.check_arr_len(revocation_pubkey_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(channel_keys_id_arg, 32)), channel_value_satoshis_arg); const ret_hu_conv: DelayedPaymentOutputDescriptor = new DelayedPaymentOutputDescriptor(null, ret); @@ -362,6 +416,9 @@ export class DelayedPaymentOutputDescriptor extends CommonBase { return ret; } + /** + * Creates a copy of the DelayedPaymentOutputDescriptor + */ public clone(): DelayedPaymentOutputDescriptor { const ret: number = bindings.DelayedPaymentOutputDescriptor_clone(this.ptr); const ret_hu_conv: DelayedPaymentOutputDescriptor = new DelayedPaymentOutputDescriptor(null, ret); @@ -369,12 +426,18 @@ export class DelayedPaymentOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read + */ public write(): Uint8Array { const ret: number = bindings.DelayedPaymentOutputDescriptor_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write + */ public static constructor_read(ser: Uint8Array): Result_DelayedPaymentOutputDescriptorDecodeErrorZ { const ret: number = bindings.DelayedPaymentOutputDescriptor_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_DelayedPaymentOutputDescriptorDecodeErrorZ = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/DirectedChannelTransactionParameters.mts b/ts/structs/DirectedChannelTransactionParameters.mts index c72939d0..4bc56f48 100644 --- a/ts/structs/DirectedChannelTransactionParameters.mts +++ b/ts/structs/DirectedChannelTransactionParameters.mts @@ -281,12 +281,22 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Static channel fields used to build transactions given per-commitment fields, organized by + * broadcaster/countersignatory. + * + * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the + * as_holder_broadcastable and as_counterparty_broadcastable functions. + */ export class DirectedChannelTransactionParameters extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.DirectedChannelTransactionParameters_free); } + /** + * Get the channel pubkeys for the broadcaster + */ public broadcaster_pubkeys(): ChannelPublicKeys { const ret: number = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr); const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); @@ -294,6 +304,9 @@ export class DirectedChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Get the channel pubkeys for the countersignatory + */ public countersignatory_pubkeys(): ChannelPublicKeys { const ret: number = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr); const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); @@ -301,16 +314,29 @@ export class DirectedChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Get the contest delay applicable to the transactions. + * Note that the contest delay was selected by the countersignatory. + */ public contest_delay(): number { const ret: number = bindings.DirectedChannelTransactionParameters_contest_delay(this.ptr); return ret; } + /** + * Whether the channel is outbound from the broadcaster. + * + * The boolean representing the side that initiated the channel is + * an input to the commitment number obscure factor computation. + */ public is_outbound(): boolean { const ret: boolean = bindings.DirectedChannelTransactionParameters_is_outbound(this.ptr); return ret; } + /** + * The funding outpoint + */ public funding_outpoint(): OutPoint { const ret: number = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr); const ret_hu_conv: OutPoint = new OutPoint(null, ret); @@ -318,6 +344,9 @@ export class DirectedChannelTransactionParameters extends CommonBase { return ret_hu_conv; } + /** + * Whether to use anchors for this channel + */ public opt_anchors(): boolean { const ret: boolean = bindings.DirectedChannelTransactionParameters_opt_anchors(this.ptr); return ret; diff --git a/ts/structs/DirectionalChannelInfo.mts b/ts/structs/DirectionalChannelInfo.mts index 6eb6915b..c00f7618 100644 --- a/ts/structs/DirectionalChannelInfo.mts +++ b/ts/structs/DirectionalChannelInfo.mts @@ -281,48 +281,81 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Details about one direction of a channel. Received + * within a channel update. + */ export class DirectionalChannelInfo extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.DirectionalChannelInfo_free); } + /** + * When the last update to the channel direction was issued. + * Value is opaque, as set in the announcement. + */ public get_last_update(): number { const ret: number = bindings.DirectionalChannelInfo_get_last_update(this.ptr); return ret; } + /** + * When the last update to the channel direction was issued. + * Value is opaque, as set in the announcement. + */ public set_last_update(val: number): void { bindings.DirectionalChannelInfo_set_last_update(this.ptr, val); } + /** + * Whether the channel can be currently used for payments (in this one direction). + */ public get_enabled(): boolean { const ret: boolean = bindings.DirectionalChannelInfo_get_enabled(this.ptr); return ret; } + /** + * Whether the channel can be currently used for payments (in this one direction). + */ public set_enabled(val: boolean): void { bindings.DirectionalChannelInfo_set_enabled(this.ptr, val); } + /** + * The difference in CLTV values that you must have when routing through this channel. + */ public get_cltv_expiry_delta(): number { const ret: number = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this.ptr); return ret; } + /** + * The difference in CLTV values that you must have when routing through this channel. + */ public set_cltv_expiry_delta(val: number): void { bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this.ptr, val); } + /** + * The minimum value, which must be relayed to the next hop via the channel + */ public get_htlc_minimum_msat(): bigint { const ret: bigint = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this.ptr); return ret; } + /** + * The minimum value, which must be relayed to the next hop via the channel + */ public set_htlc_minimum_msat(val: bigint): void { bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this.ptr, val); } + /** + * The maximum value which may be relayed to the next hop via the channel. + */ public get_htlc_maximum_msat(): Option_u64Z { const ret: number = bindings.DirectionalChannelInfo_get_htlc_maximum_msat(this.ptr); const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret); @@ -330,10 +363,16 @@ export class DirectionalChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * The maximum value which may be relayed to the next hop via the channel. + */ public set_htlc_maximum_msat(val: Option_u64Z): void { bindings.DirectionalChannelInfo_set_htlc_maximum_msat(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * Fees charged when the channel is used for routing + */ public get_fees(): RoutingFees { const ret: number = bindings.DirectionalChannelInfo_get_fees(this.ptr); const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); @@ -341,10 +380,21 @@ export class DirectionalChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Fees charged when the channel is used for routing + */ public set_fees(val: RoutingFees): void { bindings.DirectionalChannelInfo_set_fees(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Most recent update for the channel received from the network + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_last_update_message(): ChannelUpdate { const ret: number = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr); const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); @@ -352,10 +402,21 @@ export class DirectionalChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Most recent update for the channel received from the network + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_last_update_message(val: ChannelUpdate): void { bindings.DirectionalChannelInfo_set_last_update_message(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new DirectionalChannelInfo given each field + */ public static constructor_new(last_update_arg: number, enabled_arg: boolean, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: bigint, htlc_maximum_msat_arg: Option_u64Z, fees_arg: RoutingFees, last_update_message_arg: ChannelUpdate): DirectionalChannelInfo { const ret: number = bindings.DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, CommonBase.get_ptr_of(htlc_maximum_msat_arg), fees_arg == null ? 0 : CommonBase.get_ptr_of(fees_arg) & ~1, last_update_message_arg == null ? 0 : CommonBase.get_ptr_of(last_update_message_arg) & ~1); const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret); @@ -368,6 +429,9 @@ export class DirectionalChannelInfo extends CommonBase { return ret; } + /** + * Creates a copy of the DirectionalChannelInfo + */ public clone(): DirectionalChannelInfo { const ret: number = bindings.DirectionalChannelInfo_clone(this.ptr); const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret); @@ -375,12 +439,18 @@ export class DirectionalChannelInfo extends CommonBase { return ret_hu_conv; } + /** + * Serialize the DirectionalChannelInfo object into a byte array which can be read by DirectionalChannelInfo_read + */ public write(): Uint8Array { const ret: number = bindings.DirectionalChannelInfo_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a DirectionalChannelInfo from a byte array, created by DirectionalChannelInfo_write + */ public static constructor_read(ser: Uint8Array): Result_DirectionalChannelInfoDecodeErrorZ { const ret: number = bindings.DirectionalChannelInfo_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_DirectionalChannelInfoDecodeErrorZ = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ErrorAction.mts b/ts/structs/ErrorAction.mts index 9eeabc8a..901dca87 100644 --- a/ts/structs/ErrorAction.mts +++ b/ts/structs/ErrorAction.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Used to put an error message in a LightningError + */ export class ErrorAction extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.ErrorAction_free); } /* @internal */ @@ -301,6 +304,9 @@ export class ErrorAction extends CommonBase { return ret; } + /** + * Creates a copy of the ErrorAction + */ public clone(): ErrorAction { const ret: number = bindings.ErrorAction_clone(this.ptr); const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret); @@ -308,6 +314,9 @@ export class ErrorAction extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new DisconnectPeer-variant ErrorAction + */ public static constructor_disconnect_peer(msg: ErrorMessage): ErrorAction { const ret: number = bindings.ErrorAction_disconnect_peer(msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret); @@ -315,6 +324,9 @@ export class ErrorAction extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new IgnoreError-variant ErrorAction + */ public static constructor_ignore_error(): ErrorAction { const ret: number = bindings.ErrorAction_ignore_error(); const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret); @@ -322,6 +334,9 @@ export class ErrorAction extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new IgnoreAndLog-variant ErrorAction + */ public static constructor_ignore_and_log(a: Level): ErrorAction { const ret: number = bindings.ErrorAction_ignore_and_log(a); const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret); @@ -329,6 +344,9 @@ export class ErrorAction extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction + */ public static constructor_ignore_duplicate_gossip(): ErrorAction { const ret: number = bindings.ErrorAction_ignore_duplicate_gossip(); const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret); @@ -336,6 +354,9 @@ export class ErrorAction extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendErrorMessage-variant ErrorAction + */ public static constructor_send_error_message(msg: ErrorMessage): ErrorAction { const ret: number = bindings.ErrorAction_send_error_message(msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret); @@ -344,7 +365,13 @@ export class ErrorAction extends CommonBase { } } +/** A ErrorAction of type DisconnectPeer */ export class ErrorAction_DisconnectPeer extends ErrorAction { + /** + * An error message which we should make an effort to send before we disconnect. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public msg: ErrorMessage; /* @internal */ public constructor(ptr: number) { @@ -355,12 +382,14 @@ export class ErrorAction_DisconnectPeer extends ErrorAction { this.msg = msg_hu_conv; } } +/** A ErrorAction of type IgnoreError */ export class ErrorAction_IgnoreError extends ErrorAction { /* @internal */ public constructor(ptr: number) { super(null, ptr); } } +/** A ErrorAction of type IgnoreAndLog */ export class ErrorAction_IgnoreAndLog extends ErrorAction { public ignore_and_log: Level; /* @internal */ @@ -369,13 +398,18 @@ export class ErrorAction_IgnoreAndLog extends ErrorAction { this.ignore_and_log = bindings.LDKErrorAction_IgnoreAndLog_get_ignore_and_log(ptr); } } +/** A ErrorAction of type IgnoreDuplicateGossip */ export class ErrorAction_IgnoreDuplicateGossip extends ErrorAction { /* @internal */ public constructor(ptr: number) { super(null, ptr); } } +/** A ErrorAction of type SendErrorMessage */ export class ErrorAction_SendErrorMessage extends ErrorAction { + /** + * The message to send. + */ public msg: ErrorMessage; /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/ErrorMessage.mts b/ts/structs/ErrorMessage.mts index ceb06ef0..1b009843 100644 --- a/ts/structs/ErrorMessage.mts +++ b/ts/structs/ErrorMessage.mts @@ -281,32 +281,56 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An error message to be sent or received from a peer + */ export class ErrorMessage extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ErrorMessage_free); } + /** + * The channel ID involved in the error + */ public get_channel_id(): Uint8Array { const ret: number = bindings.ErrorMessage_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID involved in the error + */ public set_channel_id(val: Uint8Array): void { bindings.ErrorMessage_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * A possibly human-readable error description. + * The string should be sanitized before it is used (e.g. emitted to logs + * or printed to stdout). Otherwise, a well crafted error message may trigger a security + * vulnerability in the terminal emulator or the logging subsystem. + */ public get_data(): string { const ret: number = bindings.ErrorMessage_get_data(this.ptr); const ret_conv: string = bindings.decodeString(ret); return ret_conv; } + /** + * A possibly human-readable error description. + * The string should be sanitized before it is used (e.g. emitted to logs + * or printed to stdout). Otherwise, a well crafted error message may trigger a security + * vulnerability in the terminal emulator or the logging subsystem. + */ public set_data(val: string): void { bindings.ErrorMessage_set_data(this.ptr, bindings.encodeString(val)); } + /** + * Constructs a new ErrorMessage given each field + */ public static constructor_new(channel_id_arg: Uint8Array, data_arg: string): ErrorMessage { const ret: number = bindings.ErrorMessage_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), bindings.encodeString(data_arg)); const ret_hu_conv: ErrorMessage = new ErrorMessage(null, ret); @@ -319,6 +343,9 @@ export class ErrorMessage extends CommonBase { return ret; } + /** + * Creates a copy of the ErrorMessage + */ public clone(): ErrorMessage { const ret: number = bindings.ErrorMessage_clone(this.ptr); const ret_hu_conv: ErrorMessage = new ErrorMessage(null, ret); @@ -326,12 +353,18 @@ export class ErrorMessage extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read + */ public write(): Uint8Array { const ret: number = bindings.ErrorMessage_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ErrorMessage from a byte array, created by ErrorMessage_write + */ public static constructor_read(ser: Uint8Array): Result_ErrorMessageDecodeErrorZ { const ret: number = bindings.ErrorMessage_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ErrorMessageDecodeErrorZ = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ErroringMessageHandler.mts b/ts/structs/ErroringMessageHandler.mts index 52457b6d..bf48b63e 100644 --- a/ts/structs/ErroringMessageHandler.mts +++ b/ts/structs/ErroringMessageHandler.mts @@ -281,12 +281,19 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A dummy struct which implements `ChannelMessageHandler` without having any channels. + * You can provide one of these as the route_handler in a MessageHandler. + */ export class ErroringMessageHandler extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ErroringMessageHandler_free); } + /** + * Constructs a new ErroringMessageHandler + */ public static constructor_new(): ErroringMessageHandler { const ret: number = bindings.ErroringMessageHandler_new(); const ret_hu_conv: ErroringMessageHandler = new ErroringMessageHandler(null, ret); @@ -294,6 +301,10 @@ export class ErroringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is + */ public as_MessageSendEventsProvider(): MessageSendEventsProvider { const ret: number = bindings.ErroringMessageHandler_as_MessageSendEventsProvider(this.ptr); const ret_hu_conv: MessageSendEventsProvider = new MessageSendEventsProvider(null, ret); @@ -301,6 +312,10 @@ export class ErroringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is + */ public as_ChannelMessageHandler(): ChannelMessageHandler { const ret: number = bindings.ErroringMessageHandler_as_ChannelMessageHandler(this.ptr); const ret_hu_conv: ChannelMessageHandler = new ChannelMessageHandler(null, ret); diff --git a/ts/structs/Event.mts b/ts/structs/Event.mts index 94b83309..6204b4d1 100644 --- a/ts/structs/Event.mts +++ b/ts/structs/Event.mts @@ -280,6 +280,13 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An Event which you should probably take some action in response to. + * + * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use + * them directly as they don't round-trip exactly (for example FundingGenerationReady is never + * written as it makes no sense to respond to it after reconnecting to peers). + */ export class Event extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.Event_free); } /* @internal */ @@ -307,6 +314,9 @@ export class Event extends CommonBase { return ret; } + /** + * Creates a copy of the Event + */ public clone(): Event { const ret: number = bindings.Event_clone(this.ptr); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -314,6 +324,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new FundingGenerationReady-variant Event + */ public static constructor_funding_generation_ready(temporary_channel_id: Uint8Array, channel_value_satoshis: bigint, output_script: Uint8Array, user_channel_id: bigint): Event { const ret: number = bindings.Event_funding_generation_ready(bindings.encodeUint8Array(bindings.check_arr_len(temporary_channel_id, 32)), channel_value_satoshis, bindings.encodeUint8Array(output_script), user_channel_id); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -321,6 +334,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new PaymentReceived-variant Event + */ public static constructor_payment_received(payment_hash: Uint8Array, amt: bigint, purpose: PaymentPurpose): Event { const ret: number = bindings.Event_payment_received(bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), amt, CommonBase.get_ptr_of(purpose)); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -328,6 +344,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new PaymentSent-variant Event + */ public static constructor_payment_sent(payment_id: Uint8Array, payment_preimage: Uint8Array, payment_hash: Uint8Array, fee_paid_msat: Option_u64Z): Event { const ret: number = bindings.Event_payment_sent(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_preimage, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), CommonBase.get_ptr_of(fee_paid_msat)); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -335,6 +354,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new PaymentPathFailed-variant Event + */ public static constructor_payment_path_failed(payment_id: Uint8Array, payment_hash: Uint8Array, rejected_by_dest: boolean, network_update: Option_NetworkUpdateZ, all_paths_failed: boolean, path: RouteHop[], short_channel_id: Option_u64Z, retry: RouteParameters): Event { const ret: number = bindings.Event_payment_path_failed(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), rejected_by_dest, CommonBase.get_ptr_of(network_update), all_paths_failed, bindings.encodeUint32Array(path != null ? path.map(path_conv_10 => path_conv_10 == null ? 0 : CommonBase.get_ptr_of(path_conv_10) & ~1) : null), CommonBase.get_ptr_of(short_channel_id), retry == null ? 0 : CommonBase.get_ptr_of(retry) & ~1); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -342,6 +364,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new PaymentFailed-variant Event + */ public static constructor_payment_failed(payment_id: Uint8Array, payment_hash: Uint8Array): Event { const ret: number = bindings.Event_payment_failed(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32))); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -349,6 +374,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new PendingHTLCsForwardable-variant Event + */ public static constructor_pending_htlcs_forwardable(time_forwardable: bigint): Event { const ret: number = bindings.Event_pending_htlcs_forwardable(time_forwardable); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -356,6 +384,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SpendableOutputs-variant Event + */ public static constructor_spendable_outputs(outputs: SpendableOutputDescriptor[]): Event { const ret: number = bindings.Event_spendable_outputs(bindings.encodeUint32Array(outputs != null ? outputs.map(outputs_conv_27 => CommonBase.get_ptr_of(outputs_conv_27)) : null)); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -363,6 +394,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new PaymentForwarded-variant Event + */ public static constructor_payment_forwarded(fee_earned_msat: Option_u64Z, claim_from_onchain_tx: boolean): Event { const ret: number = bindings.Event_payment_forwarded(CommonBase.get_ptr_of(fee_earned_msat), claim_from_onchain_tx); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -370,6 +404,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new ChannelClosed-variant Event + */ public static constructor_channel_closed(channel_id: Uint8Array, user_channel_id: bigint, reason: ClosureReason): Event { const ret: number = bindings.Event_channel_closed(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), user_channel_id, CommonBase.get_ptr_of(reason)); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -377,6 +414,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new DiscardFunding-variant Event + */ public static constructor_discard_funding(channel_id: Uint8Array, transaction: Uint8Array): Event { const ret: number = bindings.Event_discard_funding(bindings.encodeUint8Array(bindings.check_arr_len(channel_id, 32)), bindings.encodeUint8Array(transaction)); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -384,6 +424,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new PaymentPathSuccessful-variant Event + */ public static constructor_payment_path_successful(payment_id: Uint8Array, payment_hash: Uint8Array, path: RouteHop[]): Event { const ret: number = bindings.Event_payment_path_successful(bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_hash, 32)), bindings.encodeUint32Array(path != null ? path.map(path_conv_10 => path_conv_10 == null ? 0 : CommonBase.get_ptr_of(path_conv_10) & ~1) : null)); const ret_hu_conv: Event = Event.constr_from_ptr(ret); @@ -391,6 +434,9 @@ export class Event extends CommonBase { return ret_hu_conv; } + /** + * Serialize the Event object into a byte array which can be read by Event_read + */ public write(): Uint8Array { const ret: number = bindings.Event_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); @@ -398,10 +444,27 @@ export class Event extends CommonBase { } } +/** A Event of type FundingGenerationReady */ export class Event_FundingGenerationReady extends Event { + /** + * The random channel_id we picked which you'll need to pass into + * ChannelManager::funding_transaction_generated. + */ public temporary_channel_id: Uint8Array; + /** + * The value, in satoshis, that the output should have. + */ public channel_value_satoshis: bigint; + /** + * The script which should be used in the transaction output. + */ public output_script: Uint8Array; + /** + * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for + * an inbound channel. + * + * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel + */ public user_channel_id: bigint; /* @internal */ public constructor(ptr: number) { @@ -416,9 +479,21 @@ export class Event_FundingGenerationReady extends Event { this.user_channel_id = bindings.LDKEvent_FundingGenerationReady_get_user_channel_id(ptr); } } +/** A Event of type PaymentReceived */ export class Event_PaymentReceived extends Event { + /** + * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will + * not stop you from registering duplicate payment hashes for inbound payments. + */ public payment_hash: Uint8Array; + /** + * The value, in thousandths of a satoshi, that this payment is for. + */ public amt: bigint; + /** + * Information for claiming this received payment, based on whether the purpose of the + * payment is to pay an invoice or to send a spontaneous payment. + */ public purpose: PaymentPurpose; /* @internal */ public constructor(ptr: number) { @@ -433,10 +508,41 @@ export class Event_PaymentReceived extends Event { this.purpose = purpose_hu_conv; } } +/** A Event of type PaymentSent */ export class Event_PaymentSent extends Event { + /** + * The id returned by [`ChannelManager::send_payment`] and used with + * [`ChannelManager::retry_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public payment_id: Uint8Array; + /** + * The preimage to the hash given to ChannelManager::send_payment. + * Note that this serves as a payment receipt, if you wish to have such a thing, you must + * store it somehow! + */ public payment_preimage: Uint8Array; + /** + * The hash that was given to [`ChannelManager::send_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + */ public payment_hash: Uint8Array; + /** + * The total fee which was spent at intermediate hops in this payment, across all paths. + * + * Note that, like [`Route::get_total_fees`] this does *not* include any potential + * overpayment to the recipient node. + * + * If the recipient or an intermediate node misbehaves and gives us free money, this may + * overstate the amount paid, though this is unlikely. + * + * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees + */ public fee_paid_msat: Option_u64Z; /* @internal */ public constructor(ptr: number) { @@ -456,14 +562,83 @@ export class Event_PaymentSent extends Event { this.fee_paid_msat = fee_paid_msat_hu_conv; } } +/** A Event of type PaymentPathFailed */ export class Event_PaymentPathFailed extends Event { + /** + * The id returned by [`ChannelManager::send_payment`] and used with + * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public payment_id: Uint8Array; + /** + * The hash that was given to [`ChannelManager::send_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + */ public payment_hash: Uint8Array; + /** + * Indicates the payment was rejected for some reason by the recipient. This implies that + * the payment has failed, not just the route in question. If this is not set, you may + * retry the payment via a different route. + */ public rejected_by_dest: boolean; + /** + * Any failure information conveyed via the Onion return packet by a node along the failed + * payment route. + * + * Should be applied to the [`NetworkGraph`] so that routing decisions can take into + * account the update. [`NetGraphMsgHandler`] is capable of doing this. + * + * [`NetworkGraph`]: crate::routing::network_graph::NetworkGraph + * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler + */ public network_update: Option_NetworkUpdateZ; + /** + * For both single-path and multi-path payments, this is set if all paths of the payment have + * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the + * larger MPP payment were still in flight when this event was generated. + * + * Note that if you are retrying individual MPP parts, using this value to determine if a + * payment has fully failed is race-y. Because multiple failures can happen prior to events + * being processed, you may retry in response to a first failure, with a second failure + * (with `all_paths_failed` set) still pending. Then, when the second failure is processed + * you will see `all_paths_failed` set even though the retry of the first failure still + * has an associated in-flight HTLC. See (1) for an example of such a failure. + * + * If you wish to retry individual MPP parts and learn when a payment has failed, you must + * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event. + * + * (1) + * + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment + */ public all_paths_failed: boolean; + /** + * The payment path that failed. + */ public path: RouteHop[]; + /** + * The channel responsible for the failed payment path. + * + * If this is `Some`, then the corresponding channel should be avoided when the payment is + * retried. May be `None` for older [`Event`] serializations. + */ public short_channel_id: Option_u64Z; + /** + * Parameters needed to compute a new [`Route`] when retrying the failed payment path. + * + * See [`find_route`] for details. + * + * [`Route`]: crate::routing::router::Route + * [`find_route`]: crate::routing::router::find_route + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public retry: RouteParameters; /* @internal */ public constructor(ptr: number) { @@ -489,6 +664,7 @@ export class Event_PaymentPathFailed extends Event { CommonBase.add_ref_from(path_conv_10_hu_conv, this); path_conv_10_arr[k] = path_conv_10_hu_conv; } + bindings.freeWasmMemory(path) this.path = path_conv_10_arr; const short_channel_id: number = bindings.LDKEvent_PaymentPathFailed_get_short_channel_id(ptr); const short_channel_id_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(short_channel_id); @@ -500,8 +676,22 @@ export class Event_PaymentPathFailed extends Event { this.retry = retry_hu_conv; } } +/** A Event of type PaymentFailed */ export class Event_PaymentFailed extends Event { + /** + * The id returned by [`ChannelManager::send_payment`] and used with + * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment + */ public payment_id: Uint8Array; + /** + * The hash that was given to [`ChannelManager::send_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + */ public payment_hash: Uint8Array; /* @internal */ public constructor(ptr: number) { @@ -514,7 +704,14 @@ export class Event_PaymentFailed extends Event { this.payment_hash = payment_hash_conv; } } +/** A Event of type PendingHTLCsForwardable */ export class Event_PendingHTLCsForwardable extends Event { + /** + * The minimum amount of time that should be waited prior to calling + * process_pending_htlc_forwards. To increase the effort required to correlate payments, + * you should wait a random amount of time in roughly the range (now + time_forwardable, + * now + 5*time_forwardable). + */ public time_forwardable: bigint; /* @internal */ public constructor(ptr: number) { @@ -522,7 +719,11 @@ export class Event_PendingHTLCsForwardable extends Event { this.time_forwardable = bindings.LDKEvent_PendingHTLCsForwardable_get_time_forwardable(ptr); } } +/** A Event of type SpendableOutputs */ export class Event_SpendableOutputs extends Event { + /** + * The outputs which you should store as spendable by you. + */ public outputs: SpendableOutputDescriptor[]; /* @internal */ public constructor(ptr: number) { @@ -536,11 +737,32 @@ export class Event_SpendableOutputs extends Event { CommonBase.add_ref_from(outputs_conv_27_hu_conv, this); outputs_conv_27_arr[b] = outputs_conv_27_hu_conv; } + bindings.freeWasmMemory(outputs) this.outputs = outputs_conv_27_arr; } } +/** A Event of type PaymentForwarded */ export class Event_PaymentForwarded extends Event { + /** + * The fee, in milli-satoshis, which was earned as a result of the payment. + * + * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC + * was pending, the amount the next hop claimed will have been rounded down to the nearest + * whole satoshi. Thus, the fee calculated here may be higher than expected as we still + * claimed the full value in millisatoshis from the source. In this case, + * `claim_from_onchain_tx` will be set. + * + * If the channel which sent us the payment has been force-closed, we will claim the funds + * via an on-chain transaction. In that case we do not yet know the on-chain transaction + * fees which we will spend and will instead set this to `None`. It is possible duplicate + * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is + * `None`. + */ public fee_earned_msat: Option_u64Z; + /** + * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain + * transaction. + */ public claim_from_onchain_tx: boolean; /* @internal */ public constructor(ptr: number) { @@ -552,9 +774,24 @@ export class Event_PaymentForwarded extends Event { this.claim_from_onchain_tx = bindings.LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr); } } +/** A Event of type ChannelClosed */ export class Event_ChannelClosed extends Event { + /** + * The channel_id of the channel which has been closed. Note that on-chain transactions + * resolving the channel are likely still awaiting confirmation. + */ public channel_id: Uint8Array; + /** + * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for + * an inbound channel. This will always be zero for objects serialized with LDK versions + * prior to 0.0.102. + * + * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel + */ public user_channel_id: bigint; + /** + * The reason the channel was closed. + */ public reason: ClosureReason; /* @internal */ public constructor(ptr: number) { @@ -569,8 +806,15 @@ export class Event_ChannelClosed extends Event { this.reason = reason_hu_conv; } } +/** A Event of type DiscardFunding */ export class Event_DiscardFunding extends Event { + /** + * The channel_id of the channel which has been closed. + */ public channel_id: Uint8Array; + /** + * The full transaction received from the user + */ public transaction: Uint8Array; /* @internal */ public constructor(ptr: number) { @@ -583,9 +827,29 @@ export class Event_DiscardFunding extends Event { this.transaction = transaction_conv; } } +/** A Event of type PaymentPathSuccessful */ export class Event_PaymentPathSuccessful extends Event { + /** + * The id returned by [`ChannelManager::send_payment`] and used with + * [`ChannelManager::retry_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment + */ public payment_id: Uint8Array; + /** + * The hash that was given to [`ChannelManager::send_payment`]. + * + * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public payment_hash: Uint8Array; + /** + * The payment path that was successful. + * + * May contain a closed channel if the HTLC sent along the path was fulfilled on chain. + */ public path: RouteHop[]; /* @internal */ public constructor(ptr: number) { @@ -605,6 +869,7 @@ export class Event_PaymentPathSuccessful extends Event { CommonBase.add_ref_from(path_conv_10_hu_conv, this); path_conv_10_arr[k] = path_conv_10_hu_conv; } + bindings.freeWasmMemory(path) this.path = path_conv_10_arr; } } diff --git a/ts/structs/EventHandler.mts b/ts/structs/EventHandler.mts index 83727493..dbd405d8 100644 --- a/ts/structs/EventHandler.mts +++ b/ts/structs/EventHandler.mts @@ -283,7 +283,12 @@ import * as bindings from '../bindings.mjs' +/** An implementation of EventHandler */ export interface EventHandlerInterface { + /**Handles the given [`Event`]. + * + * See [`EventsProvider`] for details that must be considered when implementing this method. + */ handle_event(event: Event): void; } @@ -291,6 +296,9 @@ class LDKEventHandlerHolder { held: EventHandler; } +/** + * A trait implemented for objects handling events from [`EventsProvider`]. + */ export class EventHandler extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKEventHandler; @@ -301,7 +309,8 @@ export class EventHandler extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: EventHandlerInterface): EventHandler { + /** Creates a new instance of EventHandler from a given implementation */ + public static new_impl(arg: EventHandlerInterface): EventHandler { const impl_holder: LDKEventHandlerHolder = new LDKEventHandlerHolder(); let structImplementation = { handle_event (event: number): void { @@ -315,6 +324,12 @@ export class EventHandler extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Handles the given [`Event`]. + * + * See [`EventsProvider`] for details that must be considered when implementing this method. + */ public handle_event(event: Event): void { bindings.EventHandler_handle_event(this.ptr, event == null ? 0 : CommonBase.get_ptr_of(event) & ~1); } diff --git a/ts/structs/EventsProvider.mts b/ts/structs/EventsProvider.mts index c8bc9725..e9600685 100644 --- a/ts/structs/EventsProvider.mts +++ b/ts/structs/EventsProvider.mts @@ -283,7 +283,14 @@ import * as bindings from '../bindings.mjs' +/** An implementation of EventsProvider */ export interface EventsProviderInterface { + /**Processes any events generated since the last call using the given event handler. + * + * Subsequent calls must only process new events. However, handlers must be capable of handling + * duplicate events across process restarts. This may occur if the provider was recovered from + * an old state (i.e., it hadn't been successfully persisted after processing pending events). + */ process_pending_events(handler: EventHandler): void; } @@ -291,6 +298,32 @@ class LDKEventsProviderHolder { held: EventsProvider; } +/** + * A trait indicating an object may generate events. + * + * Events are processed by passing an [`EventHandler`] to [`process_pending_events`]. + * + * # Requirements + * + * See [`process_pending_events`] for requirements around event processing. + * + * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending + * event since the last invocation. The handler must either act upon the event immediately + * or preserve it for later handling. + * + * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to + * consult the provider's documentation on the implication of processing events and how a handler + * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and + * [`ChainMonitor::process_pending_events`]). + * + * (C-not implementable) As there is likely no reason for a user to implement this trait on their + * own type(s). + * + * [`process_pending_events`]: Self::process_pending_events + * [`handle_event`]: EventHandler::handle_event + * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events + * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events + */ export class EventsProvider extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKEventsProvider; @@ -301,7 +334,8 @@ export class EventsProvider extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: EventsProviderInterface): EventsProvider { + /** Creates a new instance of EventsProvider from a given implementation */ + public static new_impl(arg: EventsProviderInterface): EventsProvider { const impl_holder: LDKEventsProviderHolder = new LDKEventsProviderHolder(); let structImplementation = { process_pending_events (handler: number): void { @@ -316,6 +350,14 @@ export class EventsProvider extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Processes any events generated since the last call using the given event handler. + * + * Subsequent calls must only process new events. However, handlers must be capable of handling + * duplicate events across process restarts. This may occur if the provider was recovered from + * an old state (i.e., it hadn't been successfully persisted after processing pending events). + */ public process_pending_events(handler: EventHandler): void { bindings.EventsProvider_process_pending_events(this.ptr, handler == null ? 0 : CommonBase.get_ptr_of(handler)); CommonBase.add_ref_from(this, handler); diff --git a/ts/structs/FeeEstimator.mts b/ts/structs/FeeEstimator.mts index 04442ad5..c22e1672 100644 --- a/ts/structs/FeeEstimator.mts +++ b/ts/structs/FeeEstimator.mts @@ -283,7 +283,17 @@ import * as bindings from '../bindings.mjs' +/** An implementation of FeeEstimator */ export interface FeeEstimatorInterface { + /**Gets estimated satoshis of fee required per 1000 Weight-Units. + * + * Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later + * round-downs don't put us below 1 satoshi-per-byte). + * + * This method can be implemented with the following unit conversions: + * max(satoshis-per-byte * 250, 253) + * max(satoshis-per-kbyte / 4, 253) + */ get_est_sat_per_1000_weight(confirmation_target: ConfirmationTarget): number; } @@ -291,6 +301,13 @@ class LDKFeeEstimatorHolder { held: FeeEstimator; } +/** + * A trait which should be implemented to provide feerate information on a number of time + * horizons. + * + * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're + * called from inside the library in response to chain events, P2P events, or timer events). + */ export class FeeEstimator extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKFeeEstimator; @@ -301,7 +318,8 @@ export class FeeEstimator extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: FeeEstimatorInterface): FeeEstimator { + /** Creates a new instance of FeeEstimator from a given implementation */ + public static new_impl(arg: FeeEstimatorInterface): FeeEstimator { const impl_holder: LDKFeeEstimatorHolder = new LDKFeeEstimatorHolder(); let structImplementation = { get_est_sat_per_1000_weight (confirmation_target: ConfirmationTarget): number { @@ -315,6 +333,17 @@ export class FeeEstimator extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Gets estimated satoshis of fee required per 1000 Weight-Units. + * + * Must return a value no smaller than 253 (ie 1 satoshi-per-byte rounded up to ensure later + * round-downs don't put us below 1 satoshi-per-byte). + * + * This method can be implemented with the following unit conversions: + * max(satoshis-per-byte * 250, 253) + * max(satoshis-per-kbyte / 4, 253) + */ public get_est_sat_per_1000_weight(confirmation_target: ConfirmationTarget): number { const ret: number = bindings.FeeEstimator_get_est_sat_per_1000_weight(this.ptr, confirmation_target); return ret; diff --git a/ts/structs/Filter.mts b/ts/structs/Filter.mts index 77faea82..61fd0945 100644 --- a/ts/structs/Filter.mts +++ b/ts/structs/Filter.mts @@ -283,8 +283,22 @@ import * as bindings from '../bindings.mjs' +/** An implementation of Filter */ export interface FilterInterface { + /**Registers interest in a transaction with `txid` and having an output with `script_pubkey` as + * a spending condition. + */ register_tx(txid: Uint8Array, script_pubkey: Uint8Array): void; + /**Registers interest in spends of a transaction output. + * + * Optionally, when `output.block_hash` is set, should return any transaction spending the + * output that is found in the corresponding block along with its index. + * + * This return value is useful for Electrum clients in order to supply in-block descendant + * transactions which otherwise were not included. This is not necessary for other clients if + * such descendant transactions were already included (e.g., when a BIP 157 client provides the + * full block). + */ register_output(output: WatchedOutput): Option_C2Tuple_usizeTransactionZZ; } @@ -292,6 +306,28 @@ class LDKFilterHolder { held: Filter; } +/** + * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to + * channels. + * + * This is useful in order to have a [`Watch`] implementation convey to a chain source which + * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in + * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If + * receiving full blocks from a chain source, any further filtering is unnecessary. + * + * After an output has been registered, subsequent block retrievals from the chain source must not + * exclude any transactions matching the new criteria nor any in-block descendants of such + * transactions. + * + * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter` + * should not block on I/O. Implementations should instead queue the newly monitored data to be + * processed later. Then, in order to block until the data has been processed, any [`Watch`] + * invocation that has called the `Filter` must return [`TemporaryFailure`]. + * + * [`TemporaryFailure`]: ChannelMonitorUpdateErr::TemporaryFailure + * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki + * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki + */ export class Filter extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKFilter; @@ -302,7 +338,8 @@ export class Filter extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: FilterInterface): Filter { + /** Creates a new instance of Filter from a given implementation */ + public static new_impl(arg: FilterInterface): Filter { const impl_holder: LDKFilterHolder = new LDKFilterHolder(); let structImplementation = { register_tx (txid: number, script_pubkey: number): void { @@ -324,10 +361,26 @@ export class Filter extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as + * a spending condition. + */ public register_tx(txid: Uint8Array, script_pubkey: Uint8Array): void { bindings.Filter_register_tx(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(txid, 32)), bindings.encodeUint8Array(script_pubkey)); } + /** + * Registers interest in spends of a transaction output. + * + * Optionally, when `output.block_hash` is set, should return any transaction spending the + * output that is found in the corresponding block along with its index. + * + * This return value is useful for Electrum clients in order to supply in-block descendant + * transactions which otherwise were not included. This is not necessary for other clients if + * such descendant transactions were already included (e.g., when a BIP 157 client provides the + * full block). + */ public register_output(output: WatchedOutput): Option_C2Tuple_usizeTransactionZZ { const ret: number = bindings.Filter_register_output(this.ptr, output == null ? 0 : CommonBase.get_ptr_of(output) & ~1); const ret_hu_conv: Option_C2Tuple_usizeTransactionZZ = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); diff --git a/ts/structs/FundingCreated.mts b/ts/structs/FundingCreated.mts index 973d7811..ed663410 100644 --- a/ts/structs/FundingCreated.mts +++ b/ts/structs/FundingCreated.mts @@ -281,51 +281,81 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A funding_created message to be sent or received from a peer + */ export class FundingCreated extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.FundingCreated_free); } + /** + * A temporary channel ID, until the funding is established + */ public get_temporary_channel_id(): Uint8Array { const ret: number = bindings.FundingCreated_get_temporary_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * A temporary channel ID, until the funding is established + */ public set_temporary_channel_id(val: Uint8Array): void { bindings.FundingCreated_set_temporary_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The funding transaction ID + */ public get_funding_txid(): Uint8Array { const ret: number = bindings.FundingCreated_get_funding_txid(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The funding transaction ID + */ public set_funding_txid(val: Uint8Array): void { bindings.FundingCreated_set_funding_txid(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The specific output index funding this channel + */ public get_funding_output_index(): number { const ret: number = bindings.FundingCreated_get_funding_output_index(this.ptr); return ret; } + /** + * The specific output index funding this channel + */ public set_funding_output_index(val: number): void { bindings.FundingCreated_set_funding_output_index(this.ptr, val); } + /** + * The signature of the channel initiator (funder) on the initial commitment transaction + */ public get_signature(): Uint8Array { const ret: number = bindings.FundingCreated_get_signature(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The signature of the channel initiator (funder) on the initial commitment transaction + */ public set_signature(val: Uint8Array): void { bindings.FundingCreated_set_signature(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * Constructs a new FundingCreated given each field + */ public static constructor_new(temporary_channel_id_arg: Uint8Array, funding_txid_arg: Uint8Array, funding_output_index_arg: number, signature_arg: Uint8Array): FundingCreated { const ret: number = bindings.FundingCreated_new(bindings.encodeUint8Array(bindings.check_arr_len(temporary_channel_id_arg, 32)), bindings.encodeUint8Array(bindings.check_arr_len(funding_txid_arg, 32)), funding_output_index_arg, bindings.encodeUint8Array(bindings.check_arr_len(signature_arg, 64))); const ret_hu_conv: FundingCreated = new FundingCreated(null, ret); @@ -338,6 +368,9 @@ export class FundingCreated extends CommonBase { return ret; } + /** + * Creates a copy of the FundingCreated + */ public clone(): FundingCreated { const ret: number = bindings.FundingCreated_clone(this.ptr); const ret_hu_conv: FundingCreated = new FundingCreated(null, ret); @@ -345,12 +378,18 @@ export class FundingCreated extends CommonBase { return ret_hu_conv; } + /** + * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read + */ public write(): Uint8Array { const ret: number = bindings.FundingCreated_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a FundingCreated from a byte array, created by FundingCreated_write + */ public static constructor_read(ser: Uint8Array): Result_FundingCreatedDecodeErrorZ { const ret: number = bindings.FundingCreated_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_FundingCreatedDecodeErrorZ = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/FundingLocked.mts b/ts/structs/FundingLocked.mts index b1a5cdfb..e846ec66 100644 --- a/ts/structs/FundingLocked.mts +++ b/ts/structs/FundingLocked.mts @@ -281,32 +281,50 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A funding_locked message to be sent or received from a peer + */ export class FundingLocked extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.FundingLocked_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.FundingLocked_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.FundingLocked_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The per-commitment point of the second commitment transaction + */ public get_next_per_commitment_point(): Uint8Array { const ret: number = bindings.FundingLocked_get_next_per_commitment_point(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The per-commitment point of the second commitment transaction + */ public set_next_per_commitment_point(val: Uint8Array): void { bindings.FundingLocked_set_next_per_commitment_point(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Constructs a new FundingLocked given each field + */ public static constructor_new(channel_id_arg: Uint8Array, next_per_commitment_point_arg: Uint8Array): FundingLocked { const ret: number = bindings.FundingLocked_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), bindings.encodeUint8Array(bindings.check_arr_len(next_per_commitment_point_arg, 33))); const ret_hu_conv: FundingLocked = new FundingLocked(null, ret); @@ -319,6 +337,9 @@ export class FundingLocked extends CommonBase { return ret; } + /** + * Creates a copy of the FundingLocked + */ public clone(): FundingLocked { const ret: number = bindings.FundingLocked_clone(this.ptr); const ret_hu_conv: FundingLocked = new FundingLocked(null, ret); @@ -326,12 +347,18 @@ export class FundingLocked extends CommonBase { return ret_hu_conv; } + /** + * Serialize the FundingLocked object into a byte array which can be read by FundingLocked_read + */ public write(): Uint8Array { const ret: number = bindings.FundingLocked_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a FundingLocked from a byte array, created by FundingLocked_write + */ public static constructor_read(ser: Uint8Array): Result_FundingLockedDecodeErrorZ { const ret: number = bindings.FundingLocked_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_FundingLockedDecodeErrorZ = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/FundingSigned.mts b/ts/structs/FundingSigned.mts index ed633b5d..dc48ec80 100644 --- a/ts/structs/FundingSigned.mts +++ b/ts/structs/FundingSigned.mts @@ -281,32 +281,50 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A funding_signed message to be sent or received from a peer + */ export class FundingSigned extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.FundingSigned_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.FundingSigned_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.FundingSigned_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The signature of the channel acceptor (fundee) on the initial commitment transaction + */ public get_signature(): Uint8Array { const ret: number = bindings.FundingSigned_get_signature(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The signature of the channel acceptor (fundee) on the initial commitment transaction + */ public set_signature(val: Uint8Array): void { bindings.FundingSigned_set_signature(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * Constructs a new FundingSigned given each field + */ public static constructor_new(channel_id_arg: Uint8Array, signature_arg: Uint8Array): FundingSigned { const ret: number = bindings.FundingSigned_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), bindings.encodeUint8Array(bindings.check_arr_len(signature_arg, 64))); const ret_hu_conv: FundingSigned = new FundingSigned(null, ret); @@ -319,6 +337,9 @@ export class FundingSigned extends CommonBase { return ret; } + /** + * Creates a copy of the FundingSigned + */ public clone(): FundingSigned { const ret: number = bindings.FundingSigned_clone(this.ptr); const ret_hu_conv: FundingSigned = new FundingSigned(null, ret); @@ -326,12 +347,18 @@ export class FundingSigned extends CommonBase { return ret_hu_conv; } + /** + * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read + */ public write(): Uint8Array { const ret: number = bindings.FundingSigned_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a FundingSigned from a byte array, created by FundingSigned_write + */ public static constructor_read(ser: Uint8Array): Result_FundingSignedDecodeErrorZ { const ret: number = bindings.FundingSigned_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_FundingSignedDecodeErrorZ = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/GossipTimestampFilter.mts b/ts/structs/GossipTimestampFilter.mts index 782d2921..76480d91 100644 --- a/ts/structs/GossipTimestampFilter.mts +++ b/ts/structs/GossipTimestampFilter.mts @@ -281,40 +281,66 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A gossip_timestamp_filter message is used by a node to request + * gossip relay for messages in the requested time range when the + * gossip_queries feature has been negotiated. + */ export class GossipTimestampFilter extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.GossipTimestampFilter_free); } + /** + * The genesis hash of the blockchain for channel and node information + */ public get_chain_hash(): Uint8Array { const ret: number = bindings.GossipTimestampFilter_get_chain_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The genesis hash of the blockchain for channel and node information + */ public set_chain_hash(val: Uint8Array): void { bindings.GossipTimestampFilter_set_chain_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The starting unix timestamp + */ public get_first_timestamp(): number { const ret: number = bindings.GossipTimestampFilter_get_first_timestamp(this.ptr); return ret; } + /** + * The starting unix timestamp + */ public set_first_timestamp(val: number): void { bindings.GossipTimestampFilter_set_first_timestamp(this.ptr, val); } + /** + * The range of information in seconds + */ public get_timestamp_range(): number { const ret: number = bindings.GossipTimestampFilter_get_timestamp_range(this.ptr); return ret; } + /** + * The range of information in seconds + */ public set_timestamp_range(val: number): void { bindings.GossipTimestampFilter_set_timestamp_range(this.ptr, val); } + /** + * Constructs a new GossipTimestampFilter given each field + */ public static constructor_new(chain_hash_arg: Uint8Array, first_timestamp_arg: number, timestamp_range_arg: number): GossipTimestampFilter { const ret: number = bindings.GossipTimestampFilter_new(bindings.encodeUint8Array(bindings.check_arr_len(chain_hash_arg, 32)), first_timestamp_arg, timestamp_range_arg); const ret_hu_conv: GossipTimestampFilter = new GossipTimestampFilter(null, ret); @@ -327,6 +353,9 @@ export class GossipTimestampFilter extends CommonBase { return ret; } + /** + * Creates a copy of the GossipTimestampFilter + */ public clone(): GossipTimestampFilter { const ret: number = bindings.GossipTimestampFilter_clone(this.ptr); const ret_hu_conv: GossipTimestampFilter = new GossipTimestampFilter(null, ret); @@ -334,12 +363,18 @@ export class GossipTimestampFilter extends CommonBase { return ret_hu_conv; } + /** + * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read + */ public write(): Uint8Array { const ret: number = bindings.GossipTimestampFilter_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write + */ public static constructor_read(ser: Uint8Array): Result_GossipTimestampFilterDecodeErrorZ { const ret: number = bindings.GossipTimestampFilter_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_GossipTimestampFilterDecodeErrorZ = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/HTLCOutputInCommitment.mts b/ts/structs/HTLCOutputInCommitment.mts index ef679245..c03d2816 100644 --- a/ts/structs/HTLCOutputInCommitment.mts +++ b/ts/structs/HTLCOutputInCommitment.mts @@ -281,49 +281,89 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Information about an HTLC as it appears in a commitment transaction + */ export class HTLCOutputInCommitment extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.HTLCOutputInCommitment_free); } + /** + * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction). + * Note that this is not the same as whether it is ountbound *from us*. To determine that you + * need to compare this value to whether the commitment transaction in question is that of + * the counterparty or our own. + */ public get_offered(): boolean { const ret: boolean = bindings.HTLCOutputInCommitment_get_offered(this.ptr); return ret; } + /** + * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction). + * Note that this is not the same as whether it is ountbound *from us*. To determine that you + * need to compare this value to whether the commitment transaction in question is that of + * the counterparty or our own. + */ public set_offered(val: boolean): void { bindings.HTLCOutputInCommitment_set_offered(this.ptr, val); } + /** + * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is + * this divided by 1000. + */ public get_amount_msat(): bigint { const ret: bigint = bindings.HTLCOutputInCommitment_get_amount_msat(this.ptr); return ret; } + /** + * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is + * this divided by 1000. + */ public set_amount_msat(val: bigint): void { bindings.HTLCOutputInCommitment_set_amount_msat(this.ptr, val); } + /** + * The CLTV lock-time at which this HTLC expires. + */ public get_cltv_expiry(): number { const ret: number = bindings.HTLCOutputInCommitment_get_cltv_expiry(this.ptr); return ret; } + /** + * The CLTV lock-time at which this HTLC expires. + */ public set_cltv_expiry(val: number): void { bindings.HTLCOutputInCommitment_set_cltv_expiry(this.ptr, val); } + /** + * The hash of the preimage which unlocks this HTLC. + */ public get_payment_hash(): Uint8Array { const ret: number = bindings.HTLCOutputInCommitment_get_payment_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The hash of the preimage which unlocks this HTLC. + */ public set_payment_hash(val: Uint8Array): void { bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The position within the commitment transactions' outputs. This may be None if the value is + * below the dust limit (in which case no output appears in the commitment transaction and the + * value is spent to additional transaction fees). + */ public get_transaction_output_index(): Option_u32Z { const ret: number = bindings.HTLCOutputInCommitment_get_transaction_output_index(this.ptr); const ret_hu_conv: Option_u32Z = Option_u32Z.constr_from_ptr(ret); @@ -331,10 +371,18 @@ export class HTLCOutputInCommitment extends CommonBase { return ret_hu_conv; } + /** + * The position within the commitment transactions' outputs. This may be None if the value is + * below the dust limit (in which case no output appears in the commitment transaction and the + * value is spent to additional transaction fees). + */ public set_transaction_output_index(val: Option_u32Z): void { bindings.HTLCOutputInCommitment_set_transaction_output_index(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * Constructs a new HTLCOutputInCommitment given each field + */ public static constructor_new(offered_arg: boolean, amount_msat_arg: bigint, cltv_expiry_arg: number, payment_hash_arg: Uint8Array, transaction_output_index_arg: Option_u32Z): HTLCOutputInCommitment { const ret: number = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, bindings.encodeUint8Array(bindings.check_arr_len(payment_hash_arg, 32)), CommonBase.get_ptr_of(transaction_output_index_arg)); const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret); @@ -347,6 +395,9 @@ export class HTLCOutputInCommitment extends CommonBase { return ret; } + /** + * Creates a copy of the HTLCOutputInCommitment + */ public clone(): HTLCOutputInCommitment { const ret: number = bindings.HTLCOutputInCommitment_clone(this.ptr); const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret); @@ -354,12 +405,18 @@ export class HTLCOutputInCommitment extends CommonBase { return ret_hu_conv; } + /** + * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read + */ public write(): Uint8Array { const ret: number = bindings.HTLCOutputInCommitment_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write + */ public static constructor_read(ser: Uint8Array): Result_HTLCOutputInCommitmentDecodeErrorZ { const ret: number = bindings.HTLCOutputInCommitment_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_HTLCOutputInCommitmentDecodeErrorZ = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/HTLCUpdate.mts b/ts/structs/HTLCUpdate.mts index 49fccab0..b792216e 100644 --- a/ts/structs/HTLCUpdate.mts +++ b/ts/structs/HTLCUpdate.mts @@ -281,6 +281,11 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on + * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the + * preimage claim backward will lead to loss of funds. + */ export class HTLCUpdate extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { @@ -292,6 +297,9 @@ export class HTLCUpdate extends CommonBase { return ret; } + /** + * Creates a copy of the HTLCUpdate + */ public clone(): HTLCUpdate { const ret: number = bindings.HTLCUpdate_clone(this.ptr); const ret_hu_conv: HTLCUpdate = new HTLCUpdate(null, ret); @@ -299,12 +307,18 @@ export class HTLCUpdate extends CommonBase { return ret_hu_conv; } + /** + * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read + */ public write(): Uint8Array { const ret: number = bindings.HTLCUpdate_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write + */ public static constructor_read(ser: Uint8Array): Result_HTLCUpdateDecodeErrorZ { const ret: number = bindings.HTLCUpdate_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_HTLCUpdateDecodeErrorZ = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/HolderCommitmentTransaction.mts b/ts/structs/HolderCommitmentTransaction.mts index 78d9258c..1ed85e21 100644 --- a/ts/structs/HolderCommitmentTransaction.mts +++ b/ts/structs/HolderCommitmentTransaction.mts @@ -281,22 +281,36 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Information needed to build and sign a holder's commitment transaction. + * + * The transaction is only signed once we are ready to broadcast. + */ export class HolderCommitmentTransaction extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.HolderCommitmentTransaction_free); } + /** + * Our counterparty's signature for the transaction + */ public get_counterparty_sig(): Uint8Array { const ret: number = bindings.HolderCommitmentTransaction_get_counterparty_sig(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Our counterparty's signature for the transaction + */ public set_counterparty_sig(val: Uint8Array): void { bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * All non-dust counterparty HTLC signatures, in the order they appear in the transaction + */ public set_counterparty_htlc_sigs(val: Uint8Array[]): void { bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, bindings.encodeUint32Array(val != null ? val.map(val_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(val_conv_12, 64))) : null)); } @@ -306,6 +320,9 @@ export class HolderCommitmentTransaction extends CommonBase { return ret; } + /** + * Creates a copy of the HolderCommitmentTransaction + */ public clone(): HolderCommitmentTransaction { const ret: number = bindings.HolderCommitmentTransaction_clone(this.ptr); const ret_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, ret); @@ -313,18 +330,28 @@ export class HolderCommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read + */ public write(): Uint8Array { const ret: number = bindings.HolderCommitmentTransaction_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write + */ public static constructor_read(ser: Uint8Array): Result_HolderCommitmentTransactionDecodeErrorZ { const ret: number = bindings.HolderCommitmentTransaction_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_HolderCommitmentTransactionDecodeErrorZ = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Create a new holder transaction with the given counterparty signatures. + * The funding keys are used to figure out which signature should go first when building the transaction for broadcast. + */ public static constructor_new(commitment_tx: CommitmentTransaction, counterparty_sig: Uint8Array, counterparty_htlc_sigs: Uint8Array[], holder_funding_key: Uint8Array, counterparty_funding_key: Uint8Array): HolderCommitmentTransaction { const ret: number = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : CommonBase.get_ptr_of(commitment_tx) & ~1, bindings.encodeUint8Array(bindings.check_arr_len(counterparty_sig, 64)), bindings.encodeUint32Array(counterparty_htlc_sigs != null ? counterparty_htlc_sigs.map(counterparty_htlc_sigs_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(counterparty_htlc_sigs_conv_12, 64))) : null), bindings.encodeUint8Array(bindings.check_arr_len(holder_funding_key, 33)), bindings.encodeUint8Array(bindings.check_arr_len(counterparty_funding_key, 33))); const ret_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, ret); diff --git a/ts/structs/IgnoringMessageHandler.mts b/ts/structs/IgnoringMessageHandler.mts index c976ceaf..072c563a 100644 --- a/ts/structs/IgnoringMessageHandler.mts +++ b/ts/structs/IgnoringMessageHandler.mts @@ -281,12 +281,19 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A dummy struct which implements `RoutingMessageHandler` without storing any routing information + * or doing any processing. You can provide one of these as the route_handler in a MessageHandler. + */ export class IgnoringMessageHandler extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.IgnoringMessageHandler_free); } + /** + * Constructs a new IgnoringMessageHandler given each field + */ public static constructor_new(): IgnoringMessageHandler { const ret: number = bindings.IgnoringMessageHandler_new(); const ret_hu_conv: IgnoringMessageHandler = new IgnoringMessageHandler(null, ret); @@ -294,6 +301,10 @@ export class IgnoringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is + */ public as_MessageSendEventsProvider(): MessageSendEventsProvider { const ret: number = bindings.IgnoringMessageHandler_as_MessageSendEventsProvider(this.ptr); const ret_hu_conv: MessageSendEventsProvider = new MessageSendEventsProvider(null, ret); @@ -301,6 +312,10 @@ export class IgnoringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is + */ public as_RoutingMessageHandler(): RoutingMessageHandler { const ret: number = bindings.IgnoringMessageHandler_as_RoutingMessageHandler(this.ptr); const ret_hu_conv: RoutingMessageHandler = new RoutingMessageHandler(null, ret); @@ -308,6 +323,10 @@ export class IgnoringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new CustomMessageReader which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is + */ public as_CustomMessageReader(): CustomMessageReader { const ret: number = bindings.IgnoringMessageHandler_as_CustomMessageReader(this.ptr); const ret_hu_conv: CustomMessageReader = new CustomMessageReader(null, ret); @@ -315,6 +334,10 @@ export class IgnoringMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is + */ public as_CustomMessageHandler(): CustomMessageHandler { const ret: number = bindings.IgnoringMessageHandler_as_CustomMessageHandler(this.ptr); const ret_hu_conv: CustomMessageHandler = new CustomMessageHandler(null, ret); diff --git a/ts/structs/InMemorySigner.mts b/ts/structs/InMemorySigner.mts index 7f5113ad..72df2739 100644 --- a/ts/structs/InMemorySigner.mts +++ b/ts/structs/InMemorySigner.mts @@ -281,68 +281,110 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A simple implementation of Sign that just keeps the private keys in memory. + * + * This implementation performs no policy checks and is insufficient by itself as + * a secure external signer. + */ export class InMemorySigner extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.InMemorySigner_free); } + /** + * Private key of anchor tx + */ public get_funding_key(): Uint8Array { const ret: number = bindings.InMemorySigner_get_funding_key(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Private key of anchor tx + */ public set_funding_key(val: Uint8Array): void { bindings.InMemorySigner_set_funding_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Holder secret key for blinded revocation pubkey + */ public get_revocation_base_key(): Uint8Array { const ret: number = bindings.InMemorySigner_get_revocation_base_key(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Holder secret key for blinded revocation pubkey + */ public set_revocation_base_key(val: Uint8Array): void { bindings.InMemorySigner_set_revocation_base_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Holder secret key used for our balance in counterparty-broadcasted commitment transactions + */ public get_payment_key(): Uint8Array { const ret: number = bindings.InMemorySigner_get_payment_key(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Holder secret key used for our balance in counterparty-broadcasted commitment transactions + */ public set_payment_key(val: Uint8Array): void { bindings.InMemorySigner_set_payment_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Holder secret key used in HTLC tx + */ public get_delayed_payment_base_key(): Uint8Array { const ret: number = bindings.InMemorySigner_get_delayed_payment_base_key(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Holder secret key used in HTLC tx + */ public set_delayed_payment_base_key(val: Uint8Array): void { bindings.InMemorySigner_set_delayed_payment_base_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Holder htlc secret key used in commitment tx htlc outputs + */ public get_htlc_base_key(): Uint8Array { const ret: number = bindings.InMemorySigner_get_htlc_base_key(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Holder htlc secret key used in commitment tx htlc outputs + */ public set_htlc_base_key(val: Uint8Array): void { bindings.InMemorySigner_set_htlc_base_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Commitment seed + */ public get_commitment_seed(): Uint8Array { const ret: number = bindings.InMemorySigner_get_commitment_seed(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Commitment seed + */ public set_commitment_seed(val: Uint8Array): void { bindings.InMemorySigner_set_commitment_seed(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } @@ -352,6 +394,9 @@ export class InMemorySigner extends CommonBase { return ret; } + /** + * Creates a copy of the InMemorySigner + */ public clone(): InMemorySigner { const ret: number = bindings.InMemorySigner_clone(this.ptr); const ret_hu_conv: InMemorySigner = new InMemorySigner(null, ret); @@ -359,6 +404,9 @@ export class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Create a new InMemorySigner + */ public static constructor_new(funding_key: Uint8Array, revocation_base_key: Uint8Array, payment_key: Uint8Array, delayed_payment_base_key: Uint8Array, htlc_base_key: Uint8Array, commitment_seed: Uint8Array, channel_value_satoshis: bigint, channel_keys_id: Uint8Array): InMemorySigner { const ret: number = bindings.InMemorySigner_new(bindings.encodeUint8Array(bindings.check_arr_len(funding_key, 32)), bindings.encodeUint8Array(bindings.check_arr_len(revocation_base_key, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_key, 32)), bindings.encodeUint8Array(bindings.check_arr_len(delayed_payment_base_key, 32)), bindings.encodeUint8Array(bindings.check_arr_len(htlc_base_key, 32)), bindings.encodeUint8Array(bindings.check_arr_len(commitment_seed, 32)), channel_value_satoshis, bindings.encodeUint8Array(bindings.check_arr_len(channel_keys_id, 32))); const ret_hu_conv: InMemorySigner = new InMemorySigner(null, ret); @@ -366,6 +414,10 @@ export class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Counterparty pubkeys. + * Will panic if ready_channel wasn't called. + */ public counterparty_pubkeys(): ChannelPublicKeys { const ret: number = bindings.InMemorySigner_counterparty_pubkeys(this.ptr); const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); @@ -373,21 +425,41 @@ export class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * The contest_delay value specified by our counterparty and applied on holder-broadcastable + * transactions, ie the amount of time that we have to wait to recover our funds if we + * broadcast a transaction. + * Will panic if ready_channel wasn't called. + */ public counterparty_selected_contest_delay(): number { const ret: number = bindings.InMemorySigner_counterparty_selected_contest_delay(this.ptr); return ret; } + /** + * The contest_delay value specified by us and applied on transactions broadcastable + * by our counterparty, ie the amount of time that they have to wait to recover their funds + * if they broadcast a transaction. + * Will panic if ready_channel wasn't called. + */ public holder_selected_contest_delay(): number { const ret: number = bindings.InMemorySigner_holder_selected_contest_delay(this.ptr); return ret; } + /** + * Whether the holder is the initiator + * Will panic if ready_channel wasn't called. + */ public is_outbound(): boolean { const ret: boolean = bindings.InMemorySigner_is_outbound(this.ptr); return ret; } + /** + * Funding outpoint + * Will panic if ready_channel wasn't called. + */ public funding_outpoint(): OutPoint { const ret: number = bindings.InMemorySigner_funding_outpoint(this.ptr); const ret_hu_conv: OutPoint = new OutPoint(null, ret); @@ -395,6 +467,12 @@ export class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or + * building transactions. + * + * Will panic if ready_channel wasn't called. + */ public get_channel_parameters(): ChannelTransactionParameters { const ret: number = bindings.InMemorySigner_get_channel_parameters(this.ptr); const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret); @@ -402,11 +480,22 @@ export class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Whether anchors should be used. + * Will panic if ready_channel wasn't called. + */ public opt_anchors(): boolean { const ret: boolean = bindings.InMemorySigner_opt_anchors(this.ptr); return ret; } + /** + * Sign the single input of spend_tx at index `input_idx` which spends the output + * described by descriptor, returning the witness stack for the input. + * + * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig, + * or is not spending the outpoint described by `descriptor.outpoint`. + */ public sign_counterparty_payment_input(spend_tx: Uint8Array, input_idx: number, descriptor: StaticPaymentOutputDescriptor): Result_CVec_CVec_u8ZZNoneZ { const ret: number = bindings.InMemorySigner_sign_counterparty_payment_input(this.ptr, bindings.encodeUint8Array(spend_tx), input_idx, descriptor == null ? 0 : CommonBase.get_ptr_of(descriptor) & ~1); const ret_hu_conv: Result_CVec_CVec_u8ZZNoneZ = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); @@ -414,6 +503,14 @@ export class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Sign the single input of spend_tx at index `input_idx` which spends the output + * described by descriptor, returning the witness stack for the input. + * + * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig, + * is not spending the outpoint described by `descriptor.outpoint`, or does not have a + * sequence set to `descriptor.to_self_delay`. + */ public sign_dynamic_p2wsh_input(spend_tx: Uint8Array, input_idx: number, descriptor: DelayedPaymentOutputDescriptor): Result_CVec_CVec_u8ZZNoneZ { const ret: number = bindings.InMemorySigner_sign_dynamic_p2wsh_input(this.ptr, bindings.encodeUint8Array(spend_tx), input_idx, descriptor == null ? 0 : CommonBase.get_ptr_of(descriptor) & ~1); const ret_hu_conv: Result_CVec_CVec_u8ZZNoneZ = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); @@ -421,6 +518,10 @@ export class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new BaseSign which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is + */ public as_BaseSign(): BaseSign { const ret: number = bindings.InMemorySigner_as_BaseSign(this.ptr); const ret_hu_conv: BaseSign = new BaseSign(null, ret); @@ -428,6 +529,10 @@ export class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new Sign which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is + */ public as_Sign(): Sign { const ret: number = bindings.InMemorySigner_as_Sign(this.ptr); const ret_hu_conv: Sign = new Sign(null, ret); @@ -435,12 +540,18 @@ export class InMemorySigner extends CommonBase { return ret_hu_conv; } + /** + * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read + */ public write(): Uint8Array { const ret: number = bindings.InMemorySigner_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a InMemorySigner from a byte array, created by InMemorySigner_write + */ public static constructor_read(ser: Uint8Array): Result_InMemorySignerDecodeErrorZ { const ret: number = bindings.InMemorySigner_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_InMemorySignerDecodeErrorZ = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Init.mts b/ts/structs/Init.mts index eefc9b42..bda324db 100644 --- a/ts/structs/Init.mts +++ b/ts/structs/Init.mts @@ -281,12 +281,18 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An init message to be sent or received from a peer + */ export class Init extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.Init_free); } + /** + * The relevant features which the sender supports + */ public get_features(): InitFeatures { const ret: number = bindings.Init_get_features(this.ptr); const ret_hu_conv: InitFeatures = new InitFeatures(null, ret); @@ -294,10 +300,16 @@ export class Init extends CommonBase { return ret_hu_conv; } + /** + * The relevant features which the sender supports + */ public set_features(val: InitFeatures): void { bindings.Init_set_features(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new Init given each field + */ public static constructor_new(features_arg: InitFeatures): Init { const ret: number = bindings.Init_new(features_arg == null ? 0 : CommonBase.get_ptr_of(features_arg) & ~1); const ret_hu_conv: Init = new Init(null, ret); @@ -310,6 +322,9 @@ export class Init extends CommonBase { return ret; } + /** + * Creates a copy of the Init + */ public clone(): Init { const ret: number = bindings.Init_clone(this.ptr); const ret_hu_conv: Init = new Init(null, ret); @@ -317,12 +332,18 @@ export class Init extends CommonBase { return ret_hu_conv; } + /** + * Serialize the Init object into a byte array which can be read by Init_read + */ public write(): Uint8Array { const ret: number = bindings.Init_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a Init from a byte array, created by Init_write + */ public static constructor_read(ser: Uint8Array): Result_InitDecodeErrorZ { const ret: number = bindings.Init_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_InitDecodeErrorZ = Result_InitDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/InitFeatures.mts b/ts/structs/InitFeatures.mts index 2cfc335f..9399d9a7 100644 --- a/ts/structs/InitFeatures.mts +++ b/ts/structs/InitFeatures.mts @@ -281,12 +281,20 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Features used within an `init` message. + */ export class InitFeatures extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.InitFeatures_free); } + /** + * Checks if two InitFeaturess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: InitFeatures): boolean { const ret: boolean = bindings.InitFeatures_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); @@ -298,6 +306,9 @@ export class InitFeatures extends CommonBase { return ret; } + /** + * Creates a copy of the InitFeatures + */ public clone(): InitFeatures { const ret: number = bindings.InitFeatures_clone(this.ptr); const ret_hu_conv: InitFeatures = new InitFeatures(null, ret); @@ -305,6 +316,9 @@ export class InitFeatures extends CommonBase { return ret_hu_conv; } + /** + * Create a blank Features with no features set + */ public static constructor_empty(): InitFeatures { const ret: number = bindings.InitFeatures_empty(); const ret_hu_conv: InitFeatures = new InitFeatures(null, ret); @@ -312,6 +326,9 @@ export class InitFeatures extends CommonBase { return ret_hu_conv; } + /** + * Creates a Features with the bits set which are known by the implementation + */ public static constructor_known(): InitFeatures { const ret: number = bindings.InitFeatures_known(); const ret_hu_conv: InitFeatures = new InitFeatures(null, ret); @@ -319,17 +336,27 @@ export class InitFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns true if this `Features` object contains unknown feature flags which are set as + * \"required\". + */ public requires_unknown_bits(): boolean { const ret: boolean = bindings.InitFeatures_requires_unknown_bits(this.ptr); return ret; } + /** + * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read + */ public write(): Uint8Array { const ret: number = bindings.InitFeatures_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a InitFeatures from a byte array, created by InitFeatures_write + */ public static constructor_read(ser: Uint8Array): Result_InitFeaturesDecodeErrorZ { const ret: number = bindings.InitFeatures_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_InitFeaturesDecodeErrorZ = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/InvalidShutdownScript.mts b/ts/structs/InvalidShutdownScript.mts index 1de545e6..639c464c 100644 --- a/ts/structs/InvalidShutdownScript.mts +++ b/ts/structs/InvalidShutdownScript.mts @@ -281,22 +281,38 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An error occurring when converting from [`Script`] to [`ShutdownScript`]. + */ export class InvalidShutdownScript extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.InvalidShutdownScript_free); } + /** + * The script that did not meet the requirements from [BOLT #2]. + * + * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md + */ public get_script(): Uint8Array { const ret: number = bindings.InvalidShutdownScript_get_script(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The script that did not meet the requirements from [BOLT #2]. + * + * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md + */ public set_script(val: Uint8Array): void { bindings.InvalidShutdownScript_set_script(this.ptr, bindings.encodeUint8Array(val)); } + /** + * Constructs a new InvalidShutdownScript given each field + */ public static constructor_new(script_arg: Uint8Array): InvalidShutdownScript { const ret: number = bindings.InvalidShutdownScript_new(bindings.encodeUint8Array(script_arg)); const ret_hu_conv: InvalidShutdownScript = new InvalidShutdownScript(null, ret); @@ -309,6 +325,9 @@ export class InvalidShutdownScript extends CommonBase { return ret; } + /** + * Creates a copy of the InvalidShutdownScript + */ public clone(): InvalidShutdownScript { const ret: number = bindings.InvalidShutdownScript_clone(this.ptr); const ret_hu_conv: InvalidShutdownScript = new InvalidShutdownScript(null, ret); diff --git a/ts/structs/InvoiceFeatures.mts b/ts/structs/InvoiceFeatures.mts index e292f065..04fe7a6b 100644 --- a/ts/structs/InvoiceFeatures.mts +++ b/ts/structs/InvoiceFeatures.mts @@ -281,12 +281,20 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Features used within an invoice. + */ export class InvoiceFeatures extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.InvoiceFeatures_free); } + /** + * Checks if two InvoiceFeaturess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: InvoiceFeatures): boolean { const ret: boolean = bindings.InvoiceFeatures_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); @@ -298,6 +306,9 @@ export class InvoiceFeatures extends CommonBase { return ret; } + /** + * Creates a copy of the InvoiceFeatures + */ public clone(): InvoiceFeatures { const ret: number = bindings.InvoiceFeatures_clone(this.ptr); const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret); @@ -305,6 +316,9 @@ export class InvoiceFeatures extends CommonBase { return ret_hu_conv; } + /** + * Create a blank Features with no features set + */ public static constructor_empty(): InvoiceFeatures { const ret: number = bindings.InvoiceFeatures_empty(); const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret); @@ -312,6 +326,9 @@ export class InvoiceFeatures extends CommonBase { return ret_hu_conv; } + /** + * Creates a Features with the bits set which are known by the implementation + */ public static constructor_known(): InvoiceFeatures { const ret: number = bindings.InvoiceFeatures_known(); const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret); @@ -319,17 +336,27 @@ export class InvoiceFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns true if this `Features` object contains unknown feature flags which are set as + * \"required\". + */ public requires_unknown_bits(): boolean { const ret: boolean = bindings.InvoiceFeatures_requires_unknown_bits(this.ptr); return ret; } + /** + * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read + */ public write(): Uint8Array { const ret: number = bindings.InvoiceFeatures_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write + */ public static constructor_read(ser: Uint8Array): Result_InvoiceFeaturesDecodeErrorZ { const ret: number = bindings.InvoiceFeatures_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_InvoiceFeaturesDecodeErrorZ = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/KeysInterface.mts b/ts/structs/KeysInterface.mts index bef4b4f6..43fc30cf 100644 --- a/ts/structs/KeysInterface.mts +++ b/ts/structs/KeysInterface.mts @@ -283,14 +283,56 @@ import * as bindings from '../bindings.mjs' +/** An implementation of KeysInterface */ export interface KeysInterfaceInterface { + /**Get node secret key (aka node_id or network_key). + * + * This method must return the same value each time it is called. + */ get_node_secret(): Uint8Array; + /**Get a script pubkey which we send funds to when claiming on-chain contestable outputs. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ get_destination_script(): Uint8Array; + /**Get a script pubkey which we will send funds to when closing a channel. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ get_shutdown_scriptpubkey(): ShutdownScript; + /**Get a new set of Sign for per-channel secrets. These MUST be unique even if you + * restarted with some stale data! + * + * This method must return a different value each time it is called. + */ get_channel_signer(inbound: boolean, channel_value_satoshis: bigint): Sign; + /**Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting + * onion packets and for temporary channel IDs. There is no requirement that these be + * persisted anywhere, though they must be unique across restarts. + * + * This method must return a different value each time it is called. + */ get_secure_random_bytes(): Uint8Array; + /**Reads a `Signer` for this `KeysInterface` from the given input stream. + * This is only called during deserialization of other objects which contain + * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s). + * The bytes are exactly those which `::write()` writes, and + * contain no versioning scheme. You may wish to include your own version prefix and ensure + * you've read all of the provided bytes to ensure no corruption occurred. + */ read_chan_signer(reader: Uint8Array): Result_SignDecodeErrorZ; + /**Sign an invoice's preimage (note that this is the preimage of the invoice, not the HTLC's + * preimage). By parameterizing by the preimage instead of the hash, we allow implementors of + * this trait to parse the invoice and make sure they're signing what they expect, rather than + * blindly signing the hash. + */ sign_invoice(invoice_preimage: Uint8Array): Result_RecoverableSignatureNoneZ; + /**Get secret key material as bytes for use in encrypting and decrypting inbound payment data. + * + * This method must return the same value each time it is called. + */ get_inbound_payment_key_material(): Uint8Array; } @@ -298,6 +340,9 @@ class LDKKeysInterfaceHolder { held: KeysInterface; } +/** + * A trait to describe an object which can get user secrets and key material. + */ export class KeysInterface extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKKeysInterface; @@ -308,7 +353,8 @@ export class KeysInterface extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: KeysInterfaceInterface): KeysInterface { + /** Creates a new instance of KeysInterface from a given implementation */ + public static new_impl(arg: KeysInterfaceInterface): KeysInterface { const impl_holder: LDKKeysInterfaceHolder = new LDKKeysInterfaceHolder(); let structImplementation = { get_node_secret (): number { @@ -361,18 +407,36 @@ export class KeysInterface extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Get node secret key (aka node_id or network_key). + * + * This method must return the same value each time it is called. + */ public get_node_secret(): Uint8Array { const ret: number = bindings.KeysInterface_get_node_secret(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Get a script pubkey which we send funds to when claiming on-chain contestable outputs. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ public get_destination_script(): Uint8Array { const ret: number = bindings.KeysInterface_get_destination_script(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Get a script pubkey which we will send funds to when closing a channel. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds across channels as controlled to the same user. + */ public get_shutdown_scriptpubkey(): ShutdownScript { const ret: number = bindings.KeysInterface_get_shutdown_scriptpubkey(this.ptr); const ret_hu_conv: ShutdownScript = new ShutdownScript(null, ret); @@ -380,6 +444,12 @@ export class KeysInterface extends CommonBase { return ret_hu_conv; } + /** + * Get a new set of Sign for per-channel secrets. These MUST be unique even if you + * restarted with some stale data! + * + * This method must return a different value each time it is called. + */ public get_channel_signer(inbound: boolean, channel_value_satoshis: bigint): Sign { const ret: number = bindings.KeysInterface_get_channel_signer(this.ptr, inbound, channel_value_satoshis); const ret_hu_conv: Sign = new Sign(null, ret); @@ -387,24 +457,50 @@ export class KeysInterface extends CommonBase { return ret_hu_conv; } + /** + * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting + * onion packets and for temporary channel IDs. There is no requirement that these be + * persisted anywhere, though they must be unique across restarts. + * + * This method must return a different value each time it is called. + */ public get_secure_random_bytes(): Uint8Array { const ret: number = bindings.KeysInterface_get_secure_random_bytes(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Reads a `Signer` for this `KeysInterface` from the given input stream. + * This is only called during deserialization of other objects which contain + * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s). + * The bytes are exactly those which `::write()` writes, and + * contain no versioning scheme. You may wish to include your own version prefix and ensure + * you've read all of the provided bytes to ensure no corruption occurred. + */ public read_chan_signer(reader: Uint8Array): Result_SignDecodeErrorZ { const ret: number = bindings.KeysInterface_read_chan_signer(this.ptr, bindings.encodeUint8Array(reader)); const ret_hu_conv: Result_SignDecodeErrorZ = Result_SignDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Sign an invoice's preimage (note that this is the preimage of the invoice, not the HTLC's + * preimage). By parameterizing by the preimage instead of the hash, we allow implementors of + * this trait to parse the invoice and make sure they're signing what they expect, rather than + * blindly signing the hash. + */ public sign_invoice(invoice_preimage: Uint8Array): Result_RecoverableSignatureNoneZ { const ret: number = bindings.KeysInterface_sign_invoice(this.ptr, bindings.encodeUint8Array(invoice_preimage)); const ret_hu_conv: Result_RecoverableSignatureNoneZ = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Get secret key material as bytes for use in encrypting and decrypting inbound payment data. + * + * This method must return the same value each time it is called. + */ public get_inbound_payment_key_material(): Uint8Array { const ret: number = bindings.KeysInterface_get_inbound_payment_key_material(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); diff --git a/ts/structs/KeysManager.mts b/ts/structs/KeysManager.mts index 15eee002..8a1524cc 100644 --- a/ts/structs/KeysManager.mts +++ b/ts/structs/KeysManager.mts @@ -281,12 +281,42 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key + * and derives keys from that. + * + * Your node_id is seed/0' + * ChannelMonitor closes may use seed/1' + * Cooperative closes may use seed/2' + * The two close keys may be needed to claim on-chain funds! + */ export class KeysManager extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.KeysManager_free); } + /** + * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your + * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds). + * starting_time isn't strictly required to actually be a time, but it must absolutely, + * without a doubt, be unique to this instance. ie if you start multiple times with the same + * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to + * simply use the current time (with very high precision). + * + * The seed MUST be backed up safely prior to use so that the keys can be re-created, however, + * obviously, starting_time should be unique every time you reload the library - it is only + * used to generate new ephemeral key data (which will be stored by the individual channel if + * necessary). + * + * Note that the seed is required to recover certain on-chain funds independent of + * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any + * channel, and some on-chain during-closing funds. + * + * Note that until the 0.1 release there is no guarantee of backward compatibility between + * versions. Once the library is more fully supported, the docs will be updated to include a + * detailed description of the guarantee. + */ public static constructor_new(seed: Uint8Array, starting_time_secs: bigint, starting_time_nanos: number): KeysManager { const ret: number = bindings.KeysManager_new(bindings.encodeUint8Array(bindings.check_arr_len(seed, 32)), starting_time_secs, starting_time_nanos); const ret_hu_conv: KeysManager = new KeysManager(null, ret); @@ -294,6 +324,13 @@ export class KeysManager extends CommonBase { return ret_hu_conv; } + /** + * Derive an old Sign containing per-channel secrets based on a key derivation parameters. + * + * Key derivation parameters are accessible through a per-channel secrets + * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of + * onchain output detection for which a corresponding delayed_payment_key must be derived. + */ public derive_channel_keys(channel_value_satoshis: bigint, params: Uint8Array): InMemorySigner { const ret: number = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, bindings.encodeUint8Array(bindings.check_arr_len(params, 32))); const ret_hu_conv: InMemorySigner = new InMemorySigner(null, ret); @@ -301,12 +338,29 @@ export class KeysManager extends CommonBase { return ret_hu_conv; } + /** + * Creates a Transaction which spends the given descriptors to the given outputs, plus an + * output to the given change destination (if sufficient change value remains). The + * transaction will have a feerate, at least, of the given value. + * + * Returns `Err(())` if the output value is greater than the input value minus required fee or + * if a descriptor was duplicated. + * + * We do not enforce that outputs meet the dust limit or that any output scripts are standard. + * + * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used + * this KeysManager or one of the `InMemorySigner` created by this KeysManager. + */ public spend_spendable_outputs(descriptors: SpendableOutputDescriptor[], outputs: TxOut[], change_destination_script: Uint8Array, feerate_sat_per_1000_weight: number): Result_TransactionNoneZ { const ret: number = bindings.KeysManager_spend_spendable_outputs(this.ptr, bindings.encodeUint32Array(descriptors != null ? descriptors.map(descriptors_conv_27 => CommonBase.get_ptr_of(descriptors_conv_27)) : null), bindings.encodeUint32Array(outputs != null ? outputs.map(outputs_conv_7 => CommonBase.get_ptr_of(outputs_conv_7)) : null), bindings.encodeUint8Array(change_destination_script), feerate_sat_per_1000_weight); const ret_hu_conv: Result_TransactionNoneZ = Result_TransactionNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Constructs a new KeysInterface which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is + */ public as_KeysInterface(): KeysInterface { const ret: number = bindings.KeysManager_as_KeysInterface(this.ptr); const ret_hu_conv: KeysInterface = new KeysInterface(null, ret); diff --git a/ts/structs/LightningError.mts b/ts/structs/LightningError.mts index b06555d8..dd5f2ae5 100644 --- a/ts/structs/LightningError.mts +++ b/ts/structs/LightningError.mts @@ -281,22 +281,34 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An Err type for failure to process messages. + */ export class LightningError extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.LightningError_free); } + /** + * A human-readable message describing the error + */ public get_err(): string { const ret: number = bindings.LightningError_get_err(this.ptr); const ret_conv: string = bindings.decodeString(ret); return ret_conv; } + /** + * A human-readable message describing the error + */ public set_err(val: string): void { bindings.LightningError_set_err(this.ptr, bindings.encodeString(val)); } + /** + * The action which should be taken against the offending peer. + */ public get_action(): ErrorAction { const ret: number = bindings.LightningError_get_action(this.ptr); const ret_hu_conv: ErrorAction = ErrorAction.constr_from_ptr(ret); @@ -304,10 +316,16 @@ export class LightningError extends CommonBase { return ret_hu_conv; } + /** + * The action which should be taken against the offending peer. + */ public set_action(val: ErrorAction): void { bindings.LightningError_set_action(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * Constructs a new LightningError given each field + */ public static constructor_new(err_arg: string, action_arg: ErrorAction): LightningError { const ret: number = bindings.LightningError_new(bindings.encodeString(err_arg), CommonBase.get_ptr_of(action_arg)); const ret_hu_conv: LightningError = new LightningError(null, ret); @@ -320,6 +338,9 @@ export class LightningError extends CommonBase { return ret; } + /** + * Creates a copy of the LightningError + */ public clone(): LightningError { const ret: number = bindings.LightningError_clone(this.ptr); const ret_hu_conv: LightningError = new LightningError(null, ret); diff --git a/ts/structs/Listen.mts b/ts/structs/Listen.mts index 3e3f61c2..a19b9d5d 100644 --- a/ts/structs/Listen.mts +++ b/ts/structs/Listen.mts @@ -283,8 +283,13 @@ import * as bindings from '../bindings.mjs' +/** An implementation of Listen */ export interface ListenInterface { + /**Notifies the listener that a block was added at the given height. + */ block_connected(block: Uint8Array, height: number): void; + /**Notifies the listener that a block was removed at the given height. + */ block_disconnected(header: Uint8Array, height: number): void; } @@ -292,6 +297,15 @@ class LDKListenHolder { held: Listen; } +/** + * The `Listen` trait is used to notify when blocks have been connected or disconnected from the + * chain. + * + * Useful when needing to replay chain data upon startup or as new chain events occur. Clients + * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`]. + * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers + * when needed. + */ export class Listen extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKListen; @@ -302,7 +316,8 @@ export class Listen extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: ListenInterface): Listen { + /** Creates a new instance of Listen from a given implementation */ + public static new_impl(arg: ListenInterface): Listen { const impl_holder: LDKListenHolder = new LDKListenHolder(); let structImplementation = { block_connected (block: number, height: number): void { @@ -320,10 +335,17 @@ export class Listen extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Notifies the listener that a block was added at the given height. + */ public block_connected(block: Uint8Array, height: number): void { bindings.Listen_block_connected(this.ptr, bindings.encodeUint8Array(block), height); } + /** + * Notifies the listener that a block was removed at the given height. + */ public block_disconnected(header: Uint8Array, height: number): void { bindings.Listen_block_disconnected(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(header, 80)), height); } diff --git a/ts/structs/LockableScore.mts b/ts/structs/LockableScore.mts index 564bacbe..7582f892 100644 --- a/ts/structs/LockableScore.mts +++ b/ts/structs/LockableScore.mts @@ -283,7 +283,10 @@ import * as bindings from '../bindings.mjs' +/** An implementation of LockableScore */ export interface LockableScoreInterface { + /**Returns the locked scorer. + */ lock(): Score; } @@ -291,6 +294,16 @@ class LDKLockableScoreHolder { held: LockableScore; } +/** + * A scorer that is accessed under a lock. + * + * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while + * having shared ownership of a scorer but without requiring internal locking in [`Score`] + * implementations. Internal locking would be detrimental to route finding performance and could + * result in [`Score::channel_penalty_msat`] returning a different value for the same channel. + * + * [`find_route`]: crate::routing::router::find_route + */ export class LockableScore extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKLockableScore; @@ -301,7 +314,8 @@ export class LockableScore extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: LockableScoreInterface): LockableScore { + /** Creates a new instance of LockableScore from a given implementation */ + public static new_impl(arg: LockableScoreInterface): LockableScore { const impl_holder: LDKLockableScoreHolder = new LDKLockableScoreHolder(); let structImplementation = { lock (): number { @@ -317,6 +331,10 @@ export class LockableScore extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Returns the locked scorer. + */ public lock(): Score { const ret: number = bindings.LockableScore_lock(this.ptr); const ret_hu_conv: Score = new Score(null, ret); diff --git a/ts/structs/LockedChannelMonitor.mts b/ts/structs/LockedChannelMonitor.mts index e68e9a48..98352ceb 100644 --- a/ts/structs/LockedChannelMonitor.mts +++ b/ts/structs/LockedChannelMonitor.mts @@ -281,6 +281,12 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' /** XXX: DO NOT USE THIS - it remains locked until the GC runs (if that ever happens */ +/** + * A read-only reference to a current ChannelMonitor. + * + * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is + * released. + */ export class LockedChannelMonitor extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { diff --git a/ts/structs/Logger.mts b/ts/structs/Logger.mts index e5aafecc..1e88a8ab 100644 --- a/ts/structs/Logger.mts +++ b/ts/structs/Logger.mts @@ -283,7 +283,10 @@ import * as bindings from '../bindings.mjs' +/** An implementation of Logger */ export interface LoggerInterface { + /**Logs the `Record` + */ log(record: Record): void; } @@ -291,6 +294,9 @@ class LDKLoggerHolder { held: Logger; } +/** + * A trait encapsulating the operations required of a logger + */ export class Logger extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKLogger; @@ -301,7 +307,8 @@ export class Logger extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: LoggerInterface): Logger { + /** Creates a new instance of Logger from a given implementation */ + public static new_impl(arg: LoggerInterface): Logger { const impl_holder: LDKLoggerHolder = new LDKLoggerHolder(); let structImplementation = { log (record: number): void { @@ -315,4 +322,5 @@ export class Logger extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + } diff --git a/ts/structs/MessageHandler.mts b/ts/structs/MessageHandler.mts index 47ef9ec7..0ba9d56c 100644 --- a/ts/structs/MessageHandler.mts +++ b/ts/structs/MessageHandler.mts @@ -281,12 +281,21 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Provides references to trait impls which handle different types of messages. + */ export class MessageHandler extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.MessageHandler_free); } + /** + * A message handler which handles messages specific to channels. Usually this is just a + * [`ChannelManager`] object or an [`ErroringMessageHandler`]. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + */ public get_chan_handler(): ChannelMessageHandler { const ret: number = bindings.MessageHandler_get_chan_handler(this.ptr); const ret_hu_conv: ChannelMessageHandler = new ChannelMessageHandler(null, ret); @@ -294,11 +303,24 @@ export class MessageHandler extends CommonBase { return ret_hu_conv; } + /** + * A message handler which handles messages specific to channels. Usually this is just a + * [`ChannelManager`] object or an [`ErroringMessageHandler`]. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + */ public set_chan_handler(val: ChannelMessageHandler): void { bindings.MessageHandler_set_chan_handler(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val)); CommonBase.add_ref_from(this, val); } + /** + * A message handler which handles messages updating our knowledge of the network channel + * graph. Usually this is just a [`NetGraphMsgHandler`] object or an + * [`IgnoringMessageHandler`]. + * + * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler + */ public get_route_handler(): RoutingMessageHandler { const ret: number = bindings.MessageHandler_get_route_handler(this.ptr); const ret_hu_conv: RoutingMessageHandler = new RoutingMessageHandler(null, ret); @@ -306,11 +328,21 @@ export class MessageHandler extends CommonBase { return ret_hu_conv; } + /** + * A message handler which handles messages updating our knowledge of the network channel + * graph. Usually this is just a [`NetGraphMsgHandler`] object or an + * [`IgnoringMessageHandler`]. + * + * [`NetGraphMsgHandler`]: crate::routing::network_graph::NetGraphMsgHandler + */ public set_route_handler(val: RoutingMessageHandler): void { bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val)); CommonBase.add_ref_from(this, val); } + /** + * Constructs a new MessageHandler given each field + */ public static constructor_new(chan_handler_arg: ChannelMessageHandler, route_handler_arg: RoutingMessageHandler): MessageHandler { const ret: number = bindings.MessageHandler_new(chan_handler_arg == null ? 0 : CommonBase.get_ptr_of(chan_handler_arg), route_handler_arg == null ? 0 : CommonBase.get_ptr_of(route_handler_arg)); const ret_hu_conv: MessageHandler = new MessageHandler(null, ret); diff --git a/ts/structs/MessageSendEvent.mts b/ts/structs/MessageSendEvent.mts index 52d8c05e..26ff2f63 100644 --- a/ts/structs/MessageSendEvent.mts +++ b/ts/structs/MessageSendEvent.mts @@ -280,6 +280,11 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An event generated by ChannelManager which indicates a message should be sent to a peer (or + * broadcast to most peers). + * These events are handled by PeerManager::process_events if you are using a PeerManager. + */ export class MessageSendEvent extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.MessageSendEvent_free); } /* @internal */ @@ -315,6 +320,9 @@ export class MessageSendEvent extends CommonBase { return ret; } + /** + * Creates a copy of the MessageSendEvent + */ public clone(): MessageSendEvent { const ret: number = bindings.MessageSendEvent_clone(this.ptr); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -322,6 +330,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent + */ public static constructor_send_accept_channel(node_id: Uint8Array, msg: AcceptChannel): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_accept_channel(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -329,6 +340,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent + */ public static constructor_send_open_channel(node_id: Uint8Array, msg: OpenChannel): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_open_channel(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -336,6 +350,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent + */ public static constructor_send_funding_created(node_id: Uint8Array, msg: FundingCreated): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_funding_created(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -343,6 +360,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent + */ public static constructor_send_funding_signed(node_id: Uint8Array, msg: FundingSigned): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_funding_signed(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -350,6 +370,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent + */ public static constructor_send_funding_locked(node_id: Uint8Array, msg: FundingLocked): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_funding_locked(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -357,6 +380,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent + */ public static constructor_send_announcement_signatures(node_id: Uint8Array, msg: AnnouncementSignatures): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_announcement_signatures(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -364,6 +390,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent + */ public static constructor_update_htlcs(node_id: Uint8Array, updates: CommitmentUpdate): MessageSendEvent { const ret: number = bindings.MessageSendEvent_update_htlcs(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), updates == null ? 0 : CommonBase.get_ptr_of(updates) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -371,6 +400,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent + */ public static constructor_send_revoke_and_ack(node_id: Uint8Array, msg: RevokeAndACK): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_revoke_and_ack(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -378,6 +410,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent + */ public static constructor_send_closing_signed(node_id: Uint8Array, msg: ClosingSigned): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_closing_signed(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -385,6 +420,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendShutdown-variant MessageSendEvent + */ public static constructor_send_shutdown(node_id: Uint8Array, msg: Shutdown): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_shutdown(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -392,6 +430,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent + */ public static constructor_send_channel_reestablish(node_id: Uint8Array, msg: ChannelReestablish): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_channel_reestablish(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -399,6 +440,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent + */ public static constructor_broadcast_channel_announcement(msg: ChannelAnnouncement, update_msg: ChannelUpdate): MessageSendEvent { const ret: number = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1, update_msg == null ? 0 : CommonBase.get_ptr_of(update_msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -406,6 +450,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent + */ public static constructor_broadcast_node_announcement(msg: NodeAnnouncement): MessageSendEvent { const ret: number = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -413,6 +460,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent + */ public static constructor_broadcast_channel_update(msg: ChannelUpdate): MessageSendEvent { const ret: number = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -420,6 +470,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent + */ public static constructor_send_channel_update(node_id: Uint8Array, msg: ChannelUpdate): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_channel_update(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -427,6 +480,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new HandleError-variant MessageSendEvent + */ public static constructor_handle_error(node_id: Uint8Array, action: ErrorAction): MessageSendEvent { const ret: number = bindings.MessageSendEvent_handle_error(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), CommonBase.get_ptr_of(action)); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -434,6 +490,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent + */ public static constructor_send_channel_range_query(node_id: Uint8Array, msg: QueryChannelRange): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_channel_range_query(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -441,6 +500,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent + */ public static constructor_send_short_ids_query(node_id: Uint8Array, msg: QueryShortChannelIds): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_short_ids_query(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -448,6 +510,9 @@ export class MessageSendEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent + */ public static constructor_send_reply_channel_range(node_id: Uint8Array, msg: ReplyChannelRange): MessageSendEvent { const ret: number = bindings.MessageSendEvent_send_reply_channel_range(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: MessageSendEvent = MessageSendEvent.constr_from_ptr(ret); @@ -456,8 +521,15 @@ export class MessageSendEvent extends CommonBase { } } +/** A MessageSendEvent of type SendAcceptChannel */ export class MessageSendEvent_SendAcceptChannel extends MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ public node_id: Uint8Array; + /** + * The message which should be sent. + */ public msg: AcceptChannel; /* @internal */ public constructor(ptr: number) { @@ -471,8 +543,15 @@ export class MessageSendEvent_SendAcceptChannel extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type SendOpenChannel */ export class MessageSendEvent_SendOpenChannel extends MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ public node_id: Uint8Array; + /** + * The message which should be sent. + */ public msg: OpenChannel; /* @internal */ public constructor(ptr: number) { @@ -486,8 +565,15 @@ export class MessageSendEvent_SendOpenChannel extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type SendFundingCreated */ export class MessageSendEvent_SendFundingCreated extends MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ public node_id: Uint8Array; + /** + * The message which should be sent. + */ public msg: FundingCreated; /* @internal */ public constructor(ptr: number) { @@ -501,8 +587,15 @@ export class MessageSendEvent_SendFundingCreated extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type SendFundingSigned */ export class MessageSendEvent_SendFundingSigned extends MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ public node_id: Uint8Array; + /** + * The message which should be sent. + */ public msg: FundingSigned; /* @internal */ public constructor(ptr: number) { @@ -516,8 +609,15 @@ export class MessageSendEvent_SendFundingSigned extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type SendFundingLocked */ export class MessageSendEvent_SendFundingLocked extends MessageSendEvent { + /** + * The node_id of the node which should receive these message(s) + */ public node_id: Uint8Array; + /** + * The funding_locked message which should be sent. + */ public msg: FundingLocked; /* @internal */ public constructor(ptr: number) { @@ -531,8 +631,15 @@ export class MessageSendEvent_SendFundingLocked extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type SendAnnouncementSignatures */ export class MessageSendEvent_SendAnnouncementSignatures extends MessageSendEvent { + /** + * The node_id of the node which should receive these message(s) + */ public node_id: Uint8Array; + /** + * The announcement_signatures message which should be sent. + */ public msg: AnnouncementSignatures; /* @internal */ public constructor(ptr: number) { @@ -546,8 +653,15 @@ export class MessageSendEvent_SendAnnouncementSignatures extends MessageSendEven this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type UpdateHTLCs */ export class MessageSendEvent_UpdateHTLCs extends MessageSendEvent { + /** + * The node_id of the node which should receive these message(s) + */ public node_id: Uint8Array; + /** + * The update messages which should be sent. ALL messages in the struct should be sent! + */ public updates: CommitmentUpdate; /* @internal */ public constructor(ptr: number) { @@ -561,8 +675,15 @@ export class MessageSendEvent_UpdateHTLCs extends MessageSendEvent { this.updates = updates_hu_conv; } } +/** A MessageSendEvent of type SendRevokeAndACK */ export class MessageSendEvent_SendRevokeAndACK extends MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ public node_id: Uint8Array; + /** + * The message which should be sent. + */ public msg: RevokeAndACK; /* @internal */ public constructor(ptr: number) { @@ -576,8 +697,15 @@ export class MessageSendEvent_SendRevokeAndACK extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type SendClosingSigned */ export class MessageSendEvent_SendClosingSigned extends MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ public node_id: Uint8Array; + /** + * The message which should be sent. + */ public msg: ClosingSigned; /* @internal */ public constructor(ptr: number) { @@ -591,8 +719,15 @@ export class MessageSendEvent_SendClosingSigned extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type SendShutdown */ export class MessageSendEvent_SendShutdown extends MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ public node_id: Uint8Array; + /** + * The message which should be sent. + */ public msg: Shutdown; /* @internal */ public constructor(ptr: number) { @@ -606,8 +741,15 @@ export class MessageSendEvent_SendShutdown extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type SendChannelReestablish */ export class MessageSendEvent_SendChannelReestablish extends MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ public node_id: Uint8Array; + /** + * The message which should be sent. + */ public msg: ChannelReestablish; /* @internal */ public constructor(ptr: number) { @@ -621,8 +763,15 @@ export class MessageSendEvent_SendChannelReestablish extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type BroadcastChannelAnnouncement */ export class MessageSendEvent_BroadcastChannelAnnouncement extends MessageSendEvent { + /** + * The channel_announcement which should be sent. + */ public msg: ChannelAnnouncement; + /** + * The followup channel_update which should be sent. + */ public update_msg: ChannelUpdate; /* @internal */ public constructor(ptr: number) { @@ -637,7 +786,11 @@ export class MessageSendEvent_BroadcastChannelAnnouncement extends MessageSendEv this.update_msg = update_msg_hu_conv; } } +/** A MessageSendEvent of type BroadcastNodeAnnouncement */ export class MessageSendEvent_BroadcastNodeAnnouncement extends MessageSendEvent { + /** + * The node_announcement which should be sent. + */ public msg: NodeAnnouncement; /* @internal */ public constructor(ptr: number) { @@ -648,7 +801,11 @@ export class MessageSendEvent_BroadcastNodeAnnouncement extends MessageSendEvent this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type BroadcastChannelUpdate */ export class MessageSendEvent_BroadcastChannelUpdate extends MessageSendEvent { + /** + * The channel_update which should be sent. + */ public msg: ChannelUpdate; /* @internal */ public constructor(ptr: number) { @@ -659,8 +816,15 @@ export class MessageSendEvent_BroadcastChannelUpdate extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type SendChannelUpdate */ export class MessageSendEvent_SendChannelUpdate extends MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ public node_id: Uint8Array; + /** + * The channel_update which should be sent. + */ public msg: ChannelUpdate; /* @internal */ public constructor(ptr: number) { @@ -674,8 +838,15 @@ export class MessageSendEvent_SendChannelUpdate extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type HandleError */ export class MessageSendEvent_HandleError extends MessageSendEvent { + /** + * The node_id of the node which should receive this message + */ public node_id: Uint8Array; + /** + * The action which should be taken. + */ public action: ErrorAction; /* @internal */ public constructor(ptr: number) { @@ -689,8 +860,15 @@ export class MessageSendEvent_HandleError extends MessageSendEvent { this.action = action_hu_conv; } } +/** A MessageSendEvent of type SendChannelRangeQuery */ export class MessageSendEvent_SendChannelRangeQuery extends MessageSendEvent { + /** + * The node_id of this message recipient + */ public node_id: Uint8Array; + /** + * The query_channel_range which should be sent. + */ public msg: QueryChannelRange; /* @internal */ public constructor(ptr: number) { @@ -704,8 +882,15 @@ export class MessageSendEvent_SendChannelRangeQuery extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type SendShortIdsQuery */ export class MessageSendEvent_SendShortIdsQuery extends MessageSendEvent { + /** + * The node_id of this message recipient + */ public node_id: Uint8Array; + /** + * The query_short_channel_ids which should be sent. + */ public msg: QueryShortChannelIds; /* @internal */ public constructor(ptr: number) { @@ -719,8 +904,15 @@ export class MessageSendEvent_SendShortIdsQuery extends MessageSendEvent { this.msg = msg_hu_conv; } } +/** A MessageSendEvent of type SendReplyChannelRange */ export class MessageSendEvent_SendReplyChannelRange extends MessageSendEvent { + /** + * The node_id of this message recipient + */ public node_id: Uint8Array; + /** + * The reply_channel_range which should be sent. + */ public msg: ReplyChannelRange; /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/MessageSendEventsProvider.mts b/ts/structs/MessageSendEventsProvider.mts index 799026b6..fdb6d020 100644 --- a/ts/structs/MessageSendEventsProvider.mts +++ b/ts/structs/MessageSendEventsProvider.mts @@ -283,7 +283,11 @@ import * as bindings from '../bindings.mjs' +/** An implementation of MessageSendEventsProvider */ export interface MessageSendEventsProviderInterface { + /**Gets the list of pending events which were generated by previous actions, clearing the list + * in the process. + */ get_and_clear_pending_msg_events(): MessageSendEvent[]; } @@ -291,6 +295,9 @@ class LDKMessageSendEventsProviderHolder { held: MessageSendEventsProvider; } +/** + * A trait indicating an object may generate message send events + */ export class MessageSendEventsProvider extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKMessageSendEventsProvider; @@ -301,7 +308,8 @@ export class MessageSendEventsProvider extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: MessageSendEventsProviderInterface): MessageSendEventsProvider { + /** Creates a new instance of MessageSendEventsProvider from a given implementation */ + public static new_impl(arg: MessageSendEventsProviderInterface): MessageSendEventsProvider { const impl_holder: LDKMessageSendEventsProviderHolder = new LDKMessageSendEventsProviderHolder(); let structImplementation = { get_and_clear_pending_msg_events (): number { @@ -316,6 +324,11 @@ export class MessageSendEventsProvider extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Gets the list of pending events which were generated by previous actions, clearing the list + * in the process. + */ public get_and_clear_pending_msg_events(): MessageSendEvent[] { const ret: number = bindings.MessageSendEventsProvider_get_and_clear_pending_msg_events(this.ptr); const ret_conv_18_len: number = bindings.getArrayLength(ret); @@ -326,6 +339,7 @@ export class MessageSendEventsProvider extends CommonBase { CommonBase.add_ref_from(ret_conv_18_hu_conv, this); ret_conv_18_arr[s] = ret_conv_18_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_18_arr; } diff --git a/ts/structs/MonitorEvent.mts b/ts/structs/MonitorEvent.mts index 14bbf6bb..03ee0c53 100644 --- a/ts/structs/MonitorEvent.mts +++ b/ts/structs/MonitorEvent.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An event to be processed by the ChannelManager. + */ export class MonitorEvent extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.MonitorEvent_free); } /* @internal */ @@ -300,6 +303,9 @@ export class MonitorEvent extends CommonBase { return ret; } + /** + * Creates a copy of the MonitorEvent + */ public clone(): MonitorEvent { const ret: number = bindings.MonitorEvent_clone(this.ptr); const ret_hu_conv: MonitorEvent = MonitorEvent.constr_from_ptr(ret); @@ -307,6 +313,9 @@ export class MonitorEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new HTLCEvent-variant MonitorEvent + */ public static constructor_htlcevent(a: HTLCUpdate): MonitorEvent { const ret: number = bindings.MonitorEvent_htlcevent(a == null ? 0 : CommonBase.get_ptr_of(a) & ~1); const ret_hu_conv: MonitorEvent = MonitorEvent.constr_from_ptr(ret); @@ -314,6 +323,9 @@ export class MonitorEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent + */ public static constructor_commitment_tx_confirmed(a: OutPoint): MonitorEvent { const ret: number = bindings.MonitorEvent_commitment_tx_confirmed(a == null ? 0 : CommonBase.get_ptr_of(a) & ~1); const ret_hu_conv: MonitorEvent = MonitorEvent.constr_from_ptr(ret); @@ -321,6 +333,9 @@ export class MonitorEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new UpdateCompleted-variant MonitorEvent + */ public static constructor_update_completed(funding_txo: OutPoint, monitor_update_id: bigint): MonitorEvent { const ret: number = bindings.MonitorEvent_update_completed(funding_txo == null ? 0 : CommonBase.get_ptr_of(funding_txo) & ~1, monitor_update_id); const ret_hu_conv: MonitorEvent = MonitorEvent.constr_from_ptr(ret); @@ -328,6 +343,9 @@ export class MonitorEvent extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new UpdateFailed-variant MonitorEvent + */ public static constructor_update_failed(a: OutPoint): MonitorEvent { const ret: number = bindings.MonitorEvent_update_failed(a == null ? 0 : CommonBase.get_ptr_of(a) & ~1); const ret_hu_conv: MonitorEvent = MonitorEvent.constr_from_ptr(ret); @@ -335,6 +353,9 @@ export class MonitorEvent extends CommonBase { return ret_hu_conv; } + /** + * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read + */ public write(): Uint8Array { const ret: number = bindings.MonitorEvent_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); @@ -342,6 +363,7 @@ export class MonitorEvent extends CommonBase { } } +/** A MonitorEvent of type HTLCEvent */ export class MonitorEvent_HTLCEvent extends MonitorEvent { public htlc_event: HTLCUpdate; /* @internal */ @@ -353,6 +375,7 @@ export class MonitorEvent_HTLCEvent extends MonitorEvent { this.htlc_event = htlc_event_hu_conv; } } +/** A MonitorEvent of type CommitmentTxConfirmed */ export class MonitorEvent_CommitmentTxConfirmed extends MonitorEvent { public commitment_tx_confirmed: OutPoint; /* @internal */ @@ -364,8 +387,19 @@ export class MonitorEvent_CommitmentTxConfirmed extends MonitorEvent { this.commitment_tx_confirmed = commitment_tx_confirmed_hu_conv; } } +/** A MonitorEvent of type UpdateCompleted */ export class MonitorEvent_UpdateCompleted extends MonitorEvent { + /** + * The funding outpoint of the [`ChannelMonitor`] that was updated + */ public funding_txo: OutPoint; + /** + * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or + * [`ChannelMonitor::get_latest_update_id`]. + * + * Note that this should only be set to a given update's ID if all previous updates for the + * same [`ChannelMonitor`] have been applied and persisted. + */ public monitor_update_id: bigint; /* @internal */ public constructor(ptr: number) { @@ -377,6 +411,7 @@ export class MonitorEvent_UpdateCompleted extends MonitorEvent { this.monitor_update_id = bindings.LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(ptr); } } +/** A MonitorEvent of type UpdateFailed */ export class MonitorEvent_UpdateFailed extends MonitorEvent { public update_failed: OutPoint; /* @internal */ diff --git a/ts/structs/MonitorUpdateId.mts b/ts/structs/MonitorUpdateId.mts index 9ce999c4..030a25b9 100644 --- a/ts/structs/MonitorUpdateId.mts +++ b/ts/structs/MonitorUpdateId.mts @@ -281,6 +281,9 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An opaque identifier describing a specific [`Persist`] method call. + */ export class MonitorUpdateId extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { @@ -292,6 +295,9 @@ export class MonitorUpdateId extends CommonBase { return ret; } + /** + * Creates a copy of the MonitorUpdateId + */ public clone(): MonitorUpdateId { const ret: number = bindings.MonitorUpdateId_clone(this.ptr); const ret_hu_conv: MonitorUpdateId = new MonitorUpdateId(null, ret); @@ -299,11 +305,19 @@ export class MonitorUpdateId extends CommonBase { return ret_hu_conv; } + /** + * Checks if two MonitorUpdateIds contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.MonitorUpdateId_hash(this.ptr); return ret; } + /** + * Checks if two MonitorUpdateIds contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: MonitorUpdateId): boolean { const ret: boolean = bindings.MonitorUpdateId_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); diff --git a/ts/structs/MultiThreadedLockableScore.mts b/ts/structs/MultiThreadedLockableScore.mts index 34d3ba90..e767848a 100644 --- a/ts/structs/MultiThreadedLockableScore.mts +++ b/ts/structs/MultiThreadedLockableScore.mts @@ -281,12 +281,18 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A concrete implementation of [`LockableScore`] which supports multi-threading. + */ export class MultiThreadedLockableScore extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.MultiThreadedLockableScore_free); } + /** + * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`]. + */ public static constructor_new(score: Score): MultiThreadedLockableScore { const ret: number = bindings.MultiThreadedLockableScore_new(score == null ? 0 : CommonBase.get_ptr_of(score)); const ret_hu_conv: MultiThreadedLockableScore = new MultiThreadedLockableScore(null, ret); diff --git a/ts/structs/NetAddress.mts b/ts/structs/NetAddress.mts index 3fa792b4..2b8e1b53 100644 --- a/ts/structs/NetAddress.mts +++ b/ts/structs/NetAddress.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An address which can be used to connect to a remote peer + */ export class NetAddress extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.NetAddress_free); } /* @internal */ @@ -300,6 +303,9 @@ export class NetAddress extends CommonBase { return ret; } + /** + * Creates a copy of the NetAddress + */ public clone(): NetAddress { const ret: number = bindings.NetAddress_clone(this.ptr); const ret_hu_conv: NetAddress = NetAddress.constr_from_ptr(ret); @@ -307,6 +313,9 @@ export class NetAddress extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new IPv4-variant NetAddress + */ public static constructor_ipv4(addr: Uint8Array, port: number): NetAddress { const ret: number = bindings.NetAddress_ipv4(bindings.encodeUint8Array(bindings.check_arr_len(addr, 4)), port); const ret_hu_conv: NetAddress = NetAddress.constr_from_ptr(ret); @@ -314,6 +323,9 @@ export class NetAddress extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new IPv6-variant NetAddress + */ public static constructor_ipv6(addr: Uint8Array, port: number): NetAddress { const ret: number = bindings.NetAddress_ipv6(bindings.encodeUint8Array(bindings.check_arr_len(addr, 16)), port); const ret_hu_conv: NetAddress = NetAddress.constr_from_ptr(ret); @@ -321,6 +333,9 @@ export class NetAddress extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new OnionV2-variant NetAddress + */ public static constructor_onion_v2(a: Uint8Array): NetAddress { const ret: number = bindings.NetAddress_onion_v2(bindings.encodeUint8Array(bindings.check_arr_len(a, 12))); const ret_hu_conv: NetAddress = NetAddress.constr_from_ptr(ret); @@ -328,6 +343,9 @@ export class NetAddress extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new OnionV3-variant NetAddress + */ public static constructor_onion_v3(ed25519_pubkey: Uint8Array, checksum: number, version: number, port: number): NetAddress { const ret: number = bindings.NetAddress_onion_v3(bindings.encodeUint8Array(bindings.check_arr_len(ed25519_pubkey, 32)), checksum, version, port); const ret_hu_conv: NetAddress = NetAddress.constr_from_ptr(ret); @@ -335,12 +353,18 @@ export class NetAddress extends CommonBase { return ret_hu_conv; } + /** + * Serialize the NetAddress object into a byte array which can be read by NetAddress_read + */ public write(): Uint8Array { const ret: number = bindings.NetAddress_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a NetAddress from a byte array, created by NetAddress_write + */ public static constructor_read(ser: Uint8Array): Result_NetAddressDecodeErrorZ { const ret: number = bindings.NetAddress_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_NetAddressDecodeErrorZ = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret); @@ -348,8 +372,15 @@ export class NetAddress extends CommonBase { } } +/** A NetAddress of type IPv4 */ export class NetAddress_IPv4 extends NetAddress { + /** + * The 4-byte IPv4 address + */ public addr: Uint8Array; + /** + * The port on which the node is listening + */ public port: number; /* @internal */ public constructor(ptr: number) { @@ -360,8 +391,15 @@ export class NetAddress_IPv4 extends NetAddress { this.port = bindings.LDKNetAddress_IPv4_get_port(ptr); } } +/** A NetAddress of type IPv6 */ export class NetAddress_IPv6 extends NetAddress { + /** + * The 16-byte IPv6 address + */ public addr: Uint8Array; + /** + * The port on which the node is listening + */ public port: number; /* @internal */ public constructor(ptr: number) { @@ -372,6 +410,7 @@ export class NetAddress_IPv6 extends NetAddress { this.port = bindings.LDKNetAddress_IPv6_get_port(ptr); } } +/** A NetAddress of type OnionV2 */ export class NetAddress_OnionV2 extends NetAddress { public onion_v2: Uint8Array; /* @internal */ @@ -382,10 +421,23 @@ export class NetAddress_OnionV2 extends NetAddress { this.onion_v2 = onion_v2_conv; } } +/** A NetAddress of type OnionV3 */ export class NetAddress_OnionV3 extends NetAddress { + /** + * The ed25519 long-term public key of the peer + */ public ed25519_pubkey: Uint8Array; + /** + * The checksum of the pubkey and version, as included in the onion address + */ public checksum: number; + /** + * The version byte, as defined by the Tor Onion v3 spec. + */ public version: number; + /** + * The port on which the node is listening + */ public port: number; /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/NetGraphMsgHandler.mts b/ts/structs/NetGraphMsgHandler.mts index 5ca801b6..e5fff47e 100644 --- a/ts/structs/NetGraphMsgHandler.mts +++ b/ts/structs/NetGraphMsgHandler.mts @@ -281,12 +281,26 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Receives and validates network updates from peers, + * stores authentic and relevant data as a network graph. + * This network graph is then used for routing payments. + * Provides interface to help with initial routing sync by + * serving historical announcements. + * + * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the + * [`NetworkGraph`]. + */ export class NetGraphMsgHandler extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.NetGraphMsgHandler_free); } + /** + * Constructs a new EventHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is + */ public as_EventHandler(): EventHandler { const ret: number = bindings.NetGraphMsgHandler_as_EventHandler(this.ptr); const ret_hu_conv: EventHandler = new EventHandler(null, ret); @@ -294,6 +308,13 @@ export class NetGraphMsgHandler extends CommonBase { return ret_hu_conv; } + /** + * Creates a new tracker of the actual state of the network of channels and nodes, + * assuming an existing Network Graph. + * Chain monitor is used to make sure announced channels exist on-chain, + * channel data is correct, and that the announcement is signed with + * channel owners' keys. + */ public static constructor_new(network_graph: NetworkGraph, chain_access: Option_AccessZ, logger: Logger): NetGraphMsgHandler { const ret: number = bindings.NetGraphMsgHandler_new(network_graph == null ? 0 : CommonBase.get_ptr_of(network_graph) & ~1, CommonBase.get_ptr_of(chain_access), logger == null ? 0 : CommonBase.get_ptr_of(logger)); const ret_hu_conv: NetGraphMsgHandler = new NetGraphMsgHandler(null, ret); @@ -304,11 +325,20 @@ export class NetGraphMsgHandler extends CommonBase { return ret_hu_conv; } + /** + * Adds a provider used to check new announcements. Does not affect + * existing announcements unless they are updated. + * Add, update or remove the provider would replace the current one. + */ public add_chain_access(chain_access: Option_AccessZ): void { bindings.NetGraphMsgHandler_add_chain_access(this.ptr, CommonBase.get_ptr_of(chain_access)); CommonBase.add_ref_from(this, chain_access); } + /** + * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is + */ public as_RoutingMessageHandler(): RoutingMessageHandler { const ret: number = bindings.NetGraphMsgHandler_as_RoutingMessageHandler(this.ptr); const ret_hu_conv: RoutingMessageHandler = new RoutingMessageHandler(null, ret); @@ -316,6 +346,10 @@ export class NetGraphMsgHandler extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is + */ public as_MessageSendEventsProvider(): MessageSendEventsProvider { const ret: number = bindings.NetGraphMsgHandler_as_MessageSendEventsProvider(this.ptr); const ret_hu_conv: MessageSendEventsProvider = new MessageSendEventsProvider(null, ret); diff --git a/ts/structs/NetworkGraph.mts b/ts/structs/NetworkGraph.mts index c18f254a..ecd06fc1 100644 --- a/ts/structs/NetworkGraph.mts +++ b/ts/structs/NetworkGraph.mts @@ -281,6 +281,9 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Represents the network as nodes and channels between them + */ export class NetworkGraph extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { @@ -292,6 +295,9 @@ export class NetworkGraph extends CommonBase { return ret; } + /** + * Creates a copy of the NetworkGraph + */ public clone(): NetworkGraph { const ret: number = bindings.NetworkGraph_clone(this.ptr); const ret_hu_conv: NetworkGraph = new NetworkGraph(null, ret); @@ -299,18 +305,27 @@ export class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read + */ public write(): Uint8Array { const ret: number = bindings.NetworkGraph_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a NetworkGraph from a byte array, created by NetworkGraph_write + */ public static constructor_read(ser: Uint8Array): Result_NetworkGraphDecodeErrorZ { const ret: number = bindings.NetworkGraph_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_NetworkGraphDecodeErrorZ = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new, empty, network graph. + */ public static constructor_new(genesis_hash: Uint8Array): NetworkGraph { const ret: number = bindings.NetworkGraph_new(bindings.encodeUint8Array(bindings.check_arr_len(genesis_hash, 32))); const ret_hu_conv: NetworkGraph = new NetworkGraph(null, ret); @@ -318,6 +333,9 @@ export class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * Returns a read-only view of the network graph. + */ public read_only(): ReadOnlyNetworkGraph { const ret: number = bindings.NetworkGraph_read_only(this.ptr); const ret_hu_conv: ReadOnlyNetworkGraph = new ReadOnlyNetworkGraph(null, ret); @@ -325,6 +343,14 @@ export class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * For an already known node (from channel announcements), update its stored properties from a + * given node announcement. + * + * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's + * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept + * routing messages from a source using a protocol other than the lightning P2P protocol. + */ public update_node_from_announcement(msg: NodeAnnouncement): Result_NoneLightningErrorZ { const ret: number = bindings.NetworkGraph_update_node_from_announcement(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); @@ -332,6 +358,12 @@ export class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * For an already known node (from channel announcements), update its stored properties from a + * given node announcement without verifying the associated signatures. Because we aren't + * given the associated signatures here we cannot relay the node announcement to any of our + * peers. + */ public update_node_from_unsigned_announcement(msg: UnsignedNodeAnnouncement): Result_NoneLightningErrorZ { const ret: number = bindings.NetworkGraph_update_node_from_unsigned_announcement(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); @@ -339,6 +371,16 @@ export class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * Store or update channel info from a channel announcement. + * + * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's + * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept + * routing messages from a source using a protocol other than the lightning P2P protocol. + * + * If a `chain::Access` object is provided via `chain_access`, it will be called to verify + * the corresponding UTXO exists on chain and is correctly-formatted. + */ public update_channel_from_announcement(msg: ChannelAnnouncement, chain_access: Option_AccessZ): Result_NoneLightningErrorZ { const ret: number = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1, CommonBase.get_ptr_of(chain_access)); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); @@ -347,6 +389,14 @@ export class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * Store or update channel info from a channel announcement without verifying the associated + * signatures. Because we aren't given the associated signatures here we cannot relay the + * channel announcement to any of our peers. + * + * If a `chain::Access` object is provided via `chain_access`, it will be called to verify + * the corresponding UTXO exists on chain and is correctly-formatted. + */ public update_channel_from_unsigned_announcement(msg: UnsignedChannelAnnouncement, chain_access: Option_AccessZ): Result_NoneLightningErrorZ { const ret: number = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1, CommonBase.get_ptr_of(chain_access)); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); @@ -355,18 +405,50 @@ export class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * Close a channel if a corresponding HTLC fail was sent. + * If permanent, removes a channel from the local storage. + * May cause the removal of nodes too, if this was their last channel. + * If not permanent, makes channels unavailable for routing. + */ public close_channel_from_update(short_channel_id: bigint, is_permanent: boolean): void { bindings.NetworkGraph_close_channel_from_update(this.ptr, short_channel_id, is_permanent); } + /** + * Marks a node in the graph as failed. + */ public fail_node(_node_id: Uint8Array, is_permanent: boolean): void { bindings.NetworkGraph_fail_node(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(_node_id, 33)), is_permanent); } + /** + * Removes information about channels that we haven't heard any updates about in some time. + * This can be used regularly to prune the network graph of channels that likely no longer + * exist. + * + * While there is no formal requirement that nodes regularly re-broadcast their channel + * updates every two weeks, the non-normative section of BOLT 7 currently suggests that + * pruning occur for updates which are at least two weeks old, which we implement here. + * + * This function takes the current unix time as an argument. For users with the `std` feature + * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable. + */ public remove_stale_channels_with_time(current_time_unix: bigint): void { bindings.NetworkGraph_remove_stale_channels_with_time(this.ptr, current_time_unix); } + /** + * For an already known (from announcement) channel, update info about one of the directions + * of the channel. + * + * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's + * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept + * routing messages from a source using a protocol other than the lightning P2P protocol. + * + * If built with `no-std`, any updates with a timestamp more than two weeks in the past or + * materially in the future will be rejected. + */ public update_channel(msg: ChannelUpdate): Result_NoneLightningErrorZ { const ret: number = bindings.NetworkGraph_update_channel(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); @@ -374,6 +456,14 @@ export class NetworkGraph extends CommonBase { return ret_hu_conv; } + /** + * For an already known (from announcement) channel, update info about one of the directions + * of the channel without verifying the associated signatures. Because we aren't given the + * associated signatures here we cannot relay the channel update to any of our peers. + * + * If built with `no-std`, any updates with a timestamp more than two weeks in the past or + * materially in the future will be rejected. + */ public update_channel_unsigned(msg: UnsignedChannelUpdate): Result_NoneLightningErrorZ { const ret: number = bindings.NetworkGraph_update_channel_unsigned(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/NetworkUpdate.mts b/ts/structs/NetworkUpdate.mts index 58a2c999..e4a83924 100644 --- a/ts/structs/NetworkUpdate.mts +++ b/ts/structs/NetworkUpdate.mts @@ -280,6 +280,12 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion + * return packet by a node along the route. See [BOLT #4] for details. + * + * [BOLT #4]: https://github.com/lightningnetwork/lightning-rfc/blob/master/04-onion-routing.md + */ export class NetworkUpdate extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.NetworkUpdate_free); } /* @internal */ @@ -299,6 +305,9 @@ export class NetworkUpdate extends CommonBase { return ret; } + /** + * Creates a copy of the NetworkUpdate + */ public clone(): NetworkUpdate { const ret: number = bindings.NetworkUpdate_clone(this.ptr); const ret_hu_conv: NetworkUpdate = NetworkUpdate.constr_from_ptr(ret); @@ -306,6 +315,9 @@ export class NetworkUpdate extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate + */ public static constructor_channel_update_message(msg: ChannelUpdate): NetworkUpdate { const ret: number = bindings.NetworkUpdate_channel_update_message(msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: NetworkUpdate = NetworkUpdate.constr_from_ptr(ret); @@ -313,6 +325,9 @@ export class NetworkUpdate extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new ChannelClosed-variant NetworkUpdate + */ public static constructor_channel_closed(short_channel_id: bigint, is_permanent: boolean): NetworkUpdate { const ret: number = bindings.NetworkUpdate_channel_closed(short_channel_id, is_permanent); const ret_hu_conv: NetworkUpdate = NetworkUpdate.constr_from_ptr(ret); @@ -320,6 +335,9 @@ export class NetworkUpdate extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new NodeFailure-variant NetworkUpdate + */ public static constructor_node_failure(node_id: Uint8Array, is_permanent: boolean): NetworkUpdate { const ret: number = bindings.NetworkUpdate_node_failure(bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), is_permanent); const ret_hu_conv: NetworkUpdate = NetworkUpdate.constr_from_ptr(ret); @@ -327,6 +345,9 @@ export class NetworkUpdate extends CommonBase { return ret_hu_conv; } + /** + * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read + */ public write(): Uint8Array { const ret: number = bindings.NetworkUpdate_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); @@ -334,7 +355,11 @@ export class NetworkUpdate extends CommonBase { } } +/** A NetworkUpdate of type ChannelUpdateMessage */ export class NetworkUpdate_ChannelUpdateMessage extends NetworkUpdate { + /** + * The update to apply via [`NetworkGraph::update_channel`]. + */ public msg: ChannelUpdate; /* @internal */ public constructor(ptr: number) { @@ -345,8 +370,16 @@ export class NetworkUpdate_ChannelUpdateMessage extends NetworkUpdate { this.msg = msg_hu_conv; } } +/** A NetworkUpdate of type ChannelClosed */ export class NetworkUpdate_ChannelClosed extends NetworkUpdate { + /** + * The short channel id of the closed channel. + */ public short_channel_id: bigint; + /** + * Whether the channel should be permanently removed or temporarily disabled until a new + * `channel_update` message is received. + */ public is_permanent: boolean; /* @internal */ public constructor(ptr: number) { @@ -355,8 +388,16 @@ export class NetworkUpdate_ChannelClosed extends NetworkUpdate { this.is_permanent = bindings.LDKNetworkUpdate_ChannelClosed_get_is_permanent(ptr); } } +/** A NetworkUpdate of type NodeFailure */ export class NetworkUpdate_NodeFailure extends NetworkUpdate { + /** + * The node id of the failed node. + */ public node_id: Uint8Array; + /** + * Whether the node should be permanently removed from consideration or can be restored + * when a new `channel_update` message is received. + */ public is_permanent: boolean; /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/NodeAnnouncement.mts b/ts/structs/NodeAnnouncement.mts index 5a5a2a99..f4371dfe 100644 --- a/ts/structs/NodeAnnouncement.mts +++ b/ts/structs/NodeAnnouncement.mts @@ -281,22 +281,34 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A node_announcement message to be sent or received from a peer + */ export class NodeAnnouncement extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.NodeAnnouncement_free); } + /** + * The signature by the node key + */ public get_signature(): Uint8Array { const ret: number = bindings.NodeAnnouncement_get_signature(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The signature by the node key + */ public set_signature(val: Uint8Array): void { bindings.NodeAnnouncement_set_signature(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 64))); } + /** + * The actual content of the announcement + */ public get_contents(): UnsignedNodeAnnouncement { const ret: number = bindings.NodeAnnouncement_get_contents(this.ptr); const ret_hu_conv: UnsignedNodeAnnouncement = new UnsignedNodeAnnouncement(null, ret); @@ -304,10 +316,16 @@ export class NodeAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * The actual content of the announcement + */ public set_contents(val: UnsignedNodeAnnouncement): void { bindings.NodeAnnouncement_set_contents(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new NodeAnnouncement given each field + */ public static constructor_new(signature_arg: Uint8Array, contents_arg: UnsignedNodeAnnouncement): NodeAnnouncement { const ret: number = bindings.NodeAnnouncement_new(bindings.encodeUint8Array(bindings.check_arr_len(signature_arg, 64)), contents_arg == null ? 0 : CommonBase.get_ptr_of(contents_arg) & ~1); const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret); @@ -320,6 +338,9 @@ export class NodeAnnouncement extends CommonBase { return ret; } + /** + * Creates a copy of the NodeAnnouncement + */ public clone(): NodeAnnouncement { const ret: number = bindings.NodeAnnouncement_clone(this.ptr); const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret); @@ -327,12 +348,18 @@ export class NodeAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read + */ public write(): Uint8Array { const ret: number = bindings.NodeAnnouncement_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write + */ public static constructor_read(ser: Uint8Array): Result_NodeAnnouncementDecodeErrorZ { const ret: number = bindings.NodeAnnouncement_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_NodeAnnouncementDecodeErrorZ = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/NodeAnnouncementInfo.mts b/ts/structs/NodeAnnouncementInfo.mts index f6746dbb..d31ddd44 100644 --- a/ts/structs/NodeAnnouncementInfo.mts +++ b/ts/structs/NodeAnnouncementInfo.mts @@ -281,12 +281,18 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Information received in the latest node_announcement from this node. + */ export class NodeAnnouncementInfo extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.NodeAnnouncementInfo_free); } + /** + * Protocol features the node announced support for + */ public get_features(): NodeFeatures { const ret: number = bindings.NodeAnnouncementInfo_get_features(this.ptr); const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); @@ -294,43 +300,81 @@ export class NodeAnnouncementInfo extends CommonBase { return ret_hu_conv; } + /** + * Protocol features the node announced support for + */ public set_features(val: NodeFeatures): void { bindings.NodeAnnouncementInfo_set_features(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * When the last known update to the node state was issued. + * Value is opaque, as set in the announcement. + */ public get_last_update(): number { const ret: number = bindings.NodeAnnouncementInfo_get_last_update(this.ptr); return ret; } + /** + * When the last known update to the node state was issued. + * Value is opaque, as set in the announcement. + */ public set_last_update(val: number): void { bindings.NodeAnnouncementInfo_set_last_update(this.ptr, val); } + /** + * Color assigned to the node + */ public get_rgb(): Uint8Array { const ret: number = bindings.NodeAnnouncementInfo_get_rgb(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Color assigned to the node + */ public set_rgb(val: Uint8Array): void { bindings.NodeAnnouncementInfo_set_rgb(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 3))); } + /** + * Moniker assigned to the node. + * May be invalid or malicious (eg control chars), + * should not be exposed to the user. + */ public get_alias(): Uint8Array { const ret: number = bindings.NodeAnnouncementInfo_get_alias(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Moniker assigned to the node. + * May be invalid or malicious (eg control chars), + * should not be exposed to the user. + */ public set_alias(val: Uint8Array): void { bindings.NodeAnnouncementInfo_set_alias(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Internet-level addresses via which one can connect to the node + */ public set_addresses(val: NetAddress[]): void { bindings.NodeAnnouncementInfo_set_addresses(this.ptr, bindings.encodeUint32Array(val != null ? val.map(val_conv_12 => CommonBase.get_ptr_of(val_conv_12)) : null)); } + /** + * An initial announcement of the node + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_announcement_message(): NodeAnnouncement { const ret: number = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr); const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret); @@ -338,10 +382,21 @@ export class NodeAnnouncementInfo extends CommonBase { return ret_hu_conv; } + /** + * An initial announcement of the node + * Mostly redundant with the data we store in fields explicitly. + * Everything else is useful only for sending out for initial routing sync. + * Not stored if contains excess data to prevent DoS. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_announcement_message(val: NodeAnnouncement): void { bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new NodeAnnouncementInfo given each field + */ public static constructor_new(features_arg: NodeFeatures, last_update_arg: number, rgb_arg: Uint8Array, alias_arg: Uint8Array, addresses_arg: NetAddress[], announcement_message_arg: NodeAnnouncement): NodeAnnouncementInfo { const ret: number = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : CommonBase.get_ptr_of(features_arg) & ~1, last_update_arg, bindings.encodeUint8Array(bindings.check_arr_len(rgb_arg, 3)), bindings.encodeUint8Array(bindings.check_arr_len(alias_arg, 32)), bindings.encodeUint32Array(addresses_arg != null ? addresses_arg.map(addresses_arg_conv_12 => CommonBase.get_ptr_of(addresses_arg_conv_12)) : null), announcement_message_arg == null ? 0 : CommonBase.get_ptr_of(announcement_message_arg) & ~1); const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret); @@ -354,6 +409,9 @@ export class NodeAnnouncementInfo extends CommonBase { return ret; } + /** + * Creates a copy of the NodeAnnouncementInfo + */ public clone(): NodeAnnouncementInfo { const ret: number = bindings.NodeAnnouncementInfo_clone(this.ptr); const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret); @@ -361,12 +419,18 @@ export class NodeAnnouncementInfo extends CommonBase { return ret_hu_conv; } + /** + * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read + */ public write(): Uint8Array { const ret: number = bindings.NodeAnnouncementInfo_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write + */ public static constructor_read(ser: Uint8Array): Result_NodeAnnouncementInfoDecodeErrorZ { const ret: number = bindings.NodeAnnouncementInfo_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_NodeAnnouncementInfoDecodeErrorZ = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/NodeFeatures.mts b/ts/structs/NodeFeatures.mts index 46e7ef9a..1797a2aa 100644 --- a/ts/structs/NodeFeatures.mts +++ b/ts/structs/NodeFeatures.mts @@ -281,12 +281,20 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Features used within a `node_announcement` message. + */ export class NodeFeatures extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.NodeFeatures_free); } + /** + * Checks if two NodeFeaturess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: NodeFeatures): boolean { const ret: boolean = bindings.NodeFeatures_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); @@ -298,6 +306,9 @@ export class NodeFeatures extends CommonBase { return ret; } + /** + * Creates a copy of the NodeFeatures + */ public clone(): NodeFeatures { const ret: number = bindings.NodeFeatures_clone(this.ptr); const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); @@ -305,6 +316,9 @@ export class NodeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Create a blank Features with no features set + */ public static constructor_empty(): NodeFeatures { const ret: number = bindings.NodeFeatures_empty(); const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); @@ -312,6 +326,9 @@ export class NodeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Creates a Features with the bits set which are known by the implementation + */ public static constructor_known(): NodeFeatures { const ret: number = bindings.NodeFeatures_known(); const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); @@ -319,17 +336,27 @@ export class NodeFeatures extends CommonBase { return ret_hu_conv; } + /** + * Returns true if this `Features` object contains unknown feature flags which are set as + * \"required\". + */ public requires_unknown_bits(): boolean { const ret: boolean = bindings.NodeFeatures_requires_unknown_bits(this.ptr); return ret; } + /** + * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read + */ public write(): Uint8Array { const ret: number = bindings.NodeFeatures_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a NodeFeatures from a byte array, created by NodeFeatures_write + */ public static constructor_read(ser: Uint8Array): Result_NodeFeaturesDecodeErrorZ { const ret: number = bindings.NodeFeatures_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_NodeFeaturesDecodeErrorZ = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/NodeId.mts b/ts/structs/NodeId.mts index 9b65a95e..0148cab3 100644 --- a/ts/structs/NodeId.mts +++ b/ts/structs/NodeId.mts @@ -281,6 +281,9 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Represents the compressed public key of a node + */ export class NodeId extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { @@ -292,6 +295,9 @@ export class NodeId extends CommonBase { return ret; } + /** + * Creates a copy of the NodeId + */ public clone(): NodeId { const ret: number = bindings.NodeId_clone(this.ptr); const ret_hu_conv: NodeId = new NodeId(null, ret); @@ -299,6 +305,9 @@ export class NodeId extends CommonBase { return ret_hu_conv; } + /** + * Create a new NodeId from a public key + */ public static constructor_from_pubkey(pubkey: Uint8Array): NodeId { const ret: number = bindings.NodeId_from_pubkey(bindings.encodeUint8Array(bindings.check_arr_len(pubkey, 33))); const ret_hu_conv: NodeId = new NodeId(null, ret); @@ -306,23 +315,35 @@ export class NodeId extends CommonBase { return ret_hu_conv; } + /** + * Get the public key slice from this NodeId + */ public as_slice(): Uint8Array { const ret: number = bindings.NodeId_as_slice(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Checks if two NodeIds contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.NodeId_hash(this.ptr); return ret; } + /** + * Serialize the NodeId object into a byte array which can be read by NodeId_read + */ public write(): Uint8Array { const ret: number = bindings.NodeId_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a NodeId from a byte array, created by NodeId_write + */ public static constructor_read(ser: Uint8Array): Result_NodeIdDecodeErrorZ { const ret: number = bindings.NodeId_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_NodeIdDecodeErrorZ = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/NodeInfo.mts b/ts/structs/NodeInfo.mts index d1caef07..cecc1e67 100644 --- a/ts/structs/NodeInfo.mts +++ b/ts/structs/NodeInfo.mts @@ -281,16 +281,29 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Details about a node in the network, known from the network announcement. + */ export class NodeInfo extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.NodeInfo_free); } + /** + * All valid channels a node has announced + */ public set_channels(val: bigint[]): void { bindings.NodeInfo_set_channels(this.ptr, bindings.encodeUint64Array(val)); } + /** + * Lowest fees enabling routing via any of the enabled, known channels to a node. + * The two fields (flat and proportional fee) are independent, + * meaning they don't have to refer to the same channel. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_lowest_inbound_channel_fees(): RoutingFees { const ret: number = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr); const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); @@ -298,10 +311,24 @@ export class NodeInfo extends CommonBase { return ret_hu_conv; } + /** + * Lowest fees enabling routing via any of the enabled, known channels to a node. + * The two fields (flat and proportional fee) are independent, + * meaning they don't have to refer to the same channel. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_lowest_inbound_channel_fees(val: RoutingFees): void { bindings.NodeInfo_set_lowest_inbound_channel_fees(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * More information about a node from node_announcement. + * Optional because we store a Node entry after learning about it from + * a channel announcement, but before receiving a node announcement. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_announcement_info(): NodeAnnouncementInfo { const ret: number = bindings.NodeInfo_get_announcement_info(this.ptr); const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret); @@ -309,10 +336,20 @@ export class NodeInfo extends CommonBase { return ret_hu_conv; } + /** + * More information about a node from node_announcement. + * Optional because we store a Node entry after learning about it from + * a channel announcement, but before receiving a node announcement. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_announcement_info(val: NodeAnnouncementInfo): void { bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new NodeInfo given each field + */ public static constructor_new(channels_arg: bigint[], lowest_inbound_channel_fees_arg: RoutingFees, announcement_info_arg: NodeAnnouncementInfo): NodeInfo { const ret: number = bindings.NodeInfo_new(bindings.encodeUint64Array(channels_arg), lowest_inbound_channel_fees_arg == null ? 0 : CommonBase.get_ptr_of(lowest_inbound_channel_fees_arg) & ~1, announcement_info_arg == null ? 0 : CommonBase.get_ptr_of(announcement_info_arg) & ~1); const ret_hu_conv: NodeInfo = new NodeInfo(null, ret); @@ -325,6 +362,9 @@ export class NodeInfo extends CommonBase { return ret; } + /** + * Creates a copy of the NodeInfo + */ public clone(): NodeInfo { const ret: number = bindings.NodeInfo_clone(this.ptr); const ret_hu_conv: NodeInfo = new NodeInfo(null, ret); @@ -332,12 +372,18 @@ export class NodeInfo extends CommonBase { return ret_hu_conv; } + /** + * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read + */ public write(): Uint8Array { const ret: number = bindings.NodeInfo_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a NodeInfo from a byte array, created by NodeInfo_write + */ public static constructor_read(ser: Uint8Array): Result_NodeInfoDecodeErrorZ { const ret: number = bindings.NodeInfo_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_NodeInfoDecodeErrorZ = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/OpenChannel.mts b/ts/structs/OpenChannel.mts index a6030b4c..9a7ce266 100644 --- a/ts/structs/OpenChannel.mts +++ b/ts/structs/OpenChannel.mts @@ -281,182 +281,300 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An open_channel message to be sent or received from a peer + */ export class OpenChannel extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.OpenChannel_free); } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public get_chain_hash(): Uint8Array { const ret: number = bindings.OpenChannel_get_chain_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public set_chain_hash(val: Uint8Array): void { bindings.OpenChannel_set_chain_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * A temporary channel ID, until the funding outpoint is announced + */ public get_temporary_channel_id(): Uint8Array { const ret: number = bindings.OpenChannel_get_temporary_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * A temporary channel ID, until the funding outpoint is announced + */ public set_temporary_channel_id(val: Uint8Array): void { bindings.OpenChannel_set_temporary_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The channel value + */ public get_funding_satoshis(): bigint { const ret: bigint = bindings.OpenChannel_get_funding_satoshis(this.ptr); return ret; } + /** + * The channel value + */ public set_funding_satoshis(val: bigint): void { bindings.OpenChannel_set_funding_satoshis(this.ptr, val); } + /** + * The amount to push to the counterparty as part of the open, in milli-satoshi + */ public get_push_msat(): bigint { const ret: bigint = bindings.OpenChannel_get_push_msat(this.ptr); return ret; } + /** + * The amount to push to the counterparty as part of the open, in milli-satoshi + */ public set_push_msat(val: bigint): void { bindings.OpenChannel_set_push_msat(this.ptr, val); } + /** + * The threshold below which outputs on transactions broadcast by sender will be omitted + */ public get_dust_limit_satoshis(): bigint { const ret: bigint = bindings.OpenChannel_get_dust_limit_satoshis(this.ptr); return ret; } + /** + * The threshold below which outputs on transactions broadcast by sender will be omitted + */ public set_dust_limit_satoshis(val: bigint): void { bindings.OpenChannel_set_dust_limit_satoshis(this.ptr, val); } + /** + * The maximum inbound HTLC value in flight towards sender, in milli-satoshi + */ public get_max_htlc_value_in_flight_msat(): bigint { const ret: bigint = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this.ptr); return ret; } + /** + * The maximum inbound HTLC value in flight towards sender, in milli-satoshi + */ public set_max_htlc_value_in_flight_msat(val: bigint): void { bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this.ptr, val); } + /** + * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel + */ public get_channel_reserve_satoshis(): bigint { const ret: bigint = bindings.OpenChannel_get_channel_reserve_satoshis(this.ptr); return ret; } + /** + * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel + */ public set_channel_reserve_satoshis(val: bigint): void { bindings.OpenChannel_set_channel_reserve_satoshis(this.ptr, val); } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public get_htlc_minimum_msat(): bigint { const ret: bigint = bindings.OpenChannel_get_htlc_minimum_msat(this.ptr); return ret; } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public set_htlc_minimum_msat(val: bigint): void { bindings.OpenChannel_set_htlc_minimum_msat(this.ptr, val); } + /** + * The feerate per 1000-weight of sender generated transactions, until updated by update_fee + */ public get_feerate_per_kw(): number { const ret: number = bindings.OpenChannel_get_feerate_per_kw(this.ptr); return ret; } + /** + * The feerate per 1000-weight of sender generated transactions, until updated by update_fee + */ public set_feerate_per_kw(val: number): void { bindings.OpenChannel_set_feerate_per_kw(this.ptr, val); } + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction + */ public get_to_self_delay(): number { const ret: number = bindings.OpenChannel_get_to_self_delay(this.ptr); return ret; } + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction + */ public set_to_self_delay(val: number): void { bindings.OpenChannel_set_to_self_delay(this.ptr, val); } + /** + * The maximum number of inbound HTLCs towards sender + */ public get_max_accepted_htlcs(): number { const ret: number = bindings.OpenChannel_get_max_accepted_htlcs(this.ptr); return ret; } + /** + * The maximum number of inbound HTLCs towards sender + */ public set_max_accepted_htlcs(val: number): void { bindings.OpenChannel_set_max_accepted_htlcs(this.ptr, val); } + /** + * The sender's key controlling the funding transaction + */ public get_funding_pubkey(): Uint8Array { const ret: number = bindings.OpenChannel_get_funding_pubkey(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The sender's key controlling the funding transaction + */ public set_funding_pubkey(val: Uint8Array): void { bindings.OpenChannel_set_funding_pubkey(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ public get_revocation_basepoint(): Uint8Array { const ret: number = bindings.OpenChannel_get_revocation_basepoint(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ public set_revocation_basepoint(val: Uint8Array): void { bindings.OpenChannel_set_revocation_basepoint(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * A payment key to sender for transactions broadcast by counterparty + */ public get_payment_point(): Uint8Array { const ret: number = bindings.OpenChannel_get_payment_point(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * A payment key to sender for transactions broadcast by counterparty + */ public set_payment_point(val: Uint8Array): void { bindings.OpenChannel_set_payment_point(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Used to derive a payment key to sender for transactions broadcast by sender + */ public get_delayed_payment_basepoint(): Uint8Array { const ret: number = bindings.OpenChannel_get_delayed_payment_basepoint(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Used to derive a payment key to sender for transactions broadcast by sender + */ public set_delayed_payment_basepoint(val: Uint8Array): void { bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Used to derive an HTLC payment key to sender + */ public get_htlc_basepoint(): Uint8Array { const ret: number = bindings.OpenChannel_get_htlc_basepoint(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Used to derive an HTLC payment key to sender + */ public set_htlc_basepoint(val: Uint8Array): void { bindings.OpenChannel_set_htlc_basepoint(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The first to-be-broadcast-by-sender transaction's per commitment point + */ public get_first_per_commitment_point(): Uint8Array { const ret: number = bindings.OpenChannel_get_first_per_commitment_point(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The first to-be-broadcast-by-sender transaction's per commitment point + */ public set_first_per_commitment_point(val: Uint8Array): void { bindings.OpenChannel_set_first_per_commitment_point(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Channel flags + */ public get_channel_flags(): number { const ret: number = bindings.OpenChannel_get_channel_flags(this.ptr); return ret; } + /** + * Channel flags + */ public set_channel_flags(val: number): void { bindings.OpenChannel_set_channel_flags(this.ptr, val); } + /** + * The channel type that this channel will represent. If none is set, we derive the channel + * type from the intersection of our feature bits with our counterparty's feature bits from + * the Init message. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_channel_type(): ChannelTypeFeatures { const ret: number = bindings.OpenChannel_get_channel_type(this.ptr); const ret_hu_conv: ChannelTypeFeatures = new ChannelTypeFeatures(null, ret); @@ -464,6 +582,13 @@ export class OpenChannel extends CommonBase { return ret_hu_conv; } + /** + * The channel type that this channel will represent. If none is set, we derive the channel + * type from the intersection of our feature bits with our counterparty's feature bits from + * the Init message. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_channel_type(val: ChannelTypeFeatures): void { bindings.OpenChannel_set_channel_type(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } @@ -473,6 +598,9 @@ export class OpenChannel extends CommonBase { return ret; } + /** + * Creates a copy of the OpenChannel + */ public clone(): OpenChannel { const ret: number = bindings.OpenChannel_clone(this.ptr); const ret_hu_conv: OpenChannel = new OpenChannel(null, ret); @@ -480,12 +608,18 @@ export class OpenChannel extends CommonBase { return ret_hu_conv; } + /** + * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read + */ public write(): Uint8Array { const ret: number = bindings.OpenChannel_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a OpenChannel from a byte array, created by OpenChannel_write + */ public static constructor_read(ser: Uint8Array): Result_OpenChannelDecodeErrorZ { const ret: number = bindings.OpenChannel_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_OpenChannelDecodeErrorZ = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Option_AccessZ.mts b/ts/structs/Option_AccessZ.mts index 8c1866bc..e9502674 100644 --- a/ts/structs/Option_AccessZ.mts +++ b/ts/structs/Option_AccessZ.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a crate::lightning::chain::Access or not + */ export class Option_AccessZ extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_AccessZ_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_AccessZ extends CommonBase { } } + /** + * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access + */ public static constructor_some(o: Access): Option_AccessZ { const ret: number = bindings.COption_AccessZ_some(o == null ? 0 : CommonBase.get_ptr_of(o)); const ret_hu_conv: Option_AccessZ = Option_AccessZ.constr_from_ptr(ret); @@ -301,6 +307,9 @@ export class Option_AccessZ extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_AccessZ containing nothing + */ public static constructor_none(): Option_AccessZ { const ret: number = bindings.COption_AccessZ_none(); const ret_hu_conv: Option_AccessZ = Option_AccessZ.constr_from_ptr(ret); @@ -309,6 +318,7 @@ export class Option_AccessZ extends CommonBase { } } +/** A Option_AccessZ of type Some */ export class Option_AccessZ_Some extends Option_AccessZ { public some: Access; /* @internal */ @@ -320,6 +330,7 @@ export class Option_AccessZ_Some extends Option_AccessZ { this.some = ret_hu_conv; } } +/** A Option_AccessZ of type None */ export class Option_AccessZ_None extends Option_AccessZ { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/Option_C2Tuple_usizeTransactionZZ.mts b/ts/structs/Option_C2Tuple_usizeTransactionZZ.mts index 4f1e89fa..c8133675 100644 --- a/ts/structs/Option_C2Tuple_usizeTransactionZZ.mts +++ b/ts/structs/Option_C2Tuple_usizeTransactionZZ.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not + */ export class Option_C2Tuple_usizeTransactionZZ extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_C2Tuple_usizeTransactionZZ_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_C2Tuple_usizeTransactionZZ extends CommonBase { } } + /** + * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ + */ public static constructor_some(o: TwoTuple_usizeTransactionZ): Option_C2Tuple_usizeTransactionZZ { const ret: number = bindings.COption_C2Tuple_usizeTransactionZZ_some(o != null ? CommonBase.get_ptr_of(o) : 0); const ret_hu_conv: Option_C2Tuple_usizeTransactionZZ = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); @@ -300,6 +306,9 @@ export class Option_C2Tuple_usizeTransactionZZ extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing + */ public static constructor_none(): Option_C2Tuple_usizeTransactionZZ { const ret: number = bindings.COption_C2Tuple_usizeTransactionZZ_none(); const ret_hu_conv: Option_C2Tuple_usizeTransactionZZ = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); @@ -312,6 +321,10 @@ export class Option_C2Tuple_usizeTransactionZZ extends CommonBase { return ret; } + /** + * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Option_C2Tuple_usizeTransactionZZ { const ret: number = bindings.COption_C2Tuple_usizeTransactionZZ_clone(this.ptr); const ret_hu_conv: Option_C2Tuple_usizeTransactionZZ = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret); @@ -320,6 +333,7 @@ export class Option_C2Tuple_usizeTransactionZZ extends CommonBase { } } +/** A Option_C2Tuple_usizeTransactionZZ of type Some */ export class Option_C2Tuple_usizeTransactionZZ_Some extends Option_C2Tuple_usizeTransactionZZ { public some: TwoTuple_usizeTransactionZ; /* @internal */ @@ -331,6 +345,7 @@ export class Option_C2Tuple_usizeTransactionZZ_Some extends Option_C2Tuple_usize this.some = some_hu_conv; } } +/** A Option_C2Tuple_usizeTransactionZZ of type None */ export class Option_C2Tuple_usizeTransactionZZ_None extends Option_C2Tuple_usizeTransactionZZ { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/Option_CVec_NetAddressZZ.mts b/ts/structs/Option_CVec_NetAddressZZ.mts index 4a39ac94..c983acd7 100644 --- a/ts/structs/Option_CVec_NetAddressZZ.mts +++ b/ts/structs/Option_CVec_NetAddressZZ.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not + */ export class Option_CVec_NetAddressZZ extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_CVec_NetAddressZZ_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_CVec_NetAddressZZ extends CommonBase { } } + /** + * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ + */ public static constructor_some(o: NetAddress[]): Option_CVec_NetAddressZZ { const ret: number = bindings.COption_CVec_NetAddressZZ_some(bindings.encodeUint32Array(o != null ? o.map(o_conv_12 => CommonBase.get_ptr_of(o_conv_12)) : null)); const ret_hu_conv: Option_CVec_NetAddressZZ = Option_CVec_NetAddressZZ.constr_from_ptr(ret); @@ -300,6 +306,9 @@ export class Option_CVec_NetAddressZZ extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_CVec_NetAddressZZ containing nothing + */ public static constructor_none(): Option_CVec_NetAddressZZ { const ret: number = bindings.COption_CVec_NetAddressZZ_none(); const ret_hu_conv: Option_CVec_NetAddressZZ = Option_CVec_NetAddressZZ.constr_from_ptr(ret); @@ -312,6 +321,10 @@ export class Option_CVec_NetAddressZZ extends CommonBase { return ret; } + /** + * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Option_CVec_NetAddressZZ { const ret: number = bindings.COption_CVec_NetAddressZZ_clone(this.ptr); const ret_hu_conv: Option_CVec_NetAddressZZ = Option_CVec_NetAddressZZ.constr_from_ptr(ret); @@ -320,6 +333,7 @@ export class Option_CVec_NetAddressZZ extends CommonBase { } } +/** A Option_CVec_NetAddressZZ of type Some */ export class Option_CVec_NetAddressZZ_Some extends Option_CVec_NetAddressZZ { public some: NetAddress[]; /* @internal */ @@ -334,9 +348,11 @@ export class Option_CVec_NetAddressZZ_Some extends Option_CVec_NetAddressZZ { CommonBase.add_ref_from(some_conv_12_hu_conv, this); some_conv_12_arr[m] = some_conv_12_hu_conv; } + bindings.freeWasmMemory(some) this.some = some_conv_12_arr; } } +/** A Option_CVec_NetAddressZZ of type None */ export class Option_CVec_NetAddressZZ_None extends Option_CVec_NetAddressZZ { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/Option_ClosureReasonZ.mts b/ts/structs/Option_ClosureReasonZ.mts index 8087bfcd..fabbce14 100644 --- a/ts/structs/Option_ClosureReasonZ.mts +++ b/ts/structs/Option_ClosureReasonZ.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a crate::lightning::util::events::ClosureReason or not + */ export class Option_ClosureReasonZ extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_ClosureReasonZ_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_ClosureReasonZ extends CommonBase { } } + /** + * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason + */ public static constructor_some(o: ClosureReason): Option_ClosureReasonZ { const ret: number = bindings.COption_ClosureReasonZ_some(CommonBase.get_ptr_of(o)); const ret_hu_conv: Option_ClosureReasonZ = Option_ClosureReasonZ.constr_from_ptr(ret); @@ -300,6 +306,9 @@ export class Option_ClosureReasonZ extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_ClosureReasonZ containing nothing + */ public static constructor_none(): Option_ClosureReasonZ { const ret: number = bindings.COption_ClosureReasonZ_none(); const ret_hu_conv: Option_ClosureReasonZ = Option_ClosureReasonZ.constr_from_ptr(ret); @@ -312,6 +321,10 @@ export class Option_ClosureReasonZ extends CommonBase { return ret; } + /** + * Creates a new COption_ClosureReasonZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Option_ClosureReasonZ { const ret: number = bindings.COption_ClosureReasonZ_clone(this.ptr); const ret_hu_conv: Option_ClosureReasonZ = Option_ClosureReasonZ.constr_from_ptr(ret); @@ -320,6 +333,7 @@ export class Option_ClosureReasonZ extends CommonBase { } } +/** A Option_ClosureReasonZ of type Some */ export class Option_ClosureReasonZ_Some extends Option_ClosureReasonZ { public some: ClosureReason; /* @internal */ @@ -331,6 +345,7 @@ export class Option_ClosureReasonZ_Some extends Option_ClosureReasonZ { this.some = some_hu_conv; } } +/** A Option_ClosureReasonZ of type None */ export class Option_ClosureReasonZ_None extends Option_ClosureReasonZ { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/Option_EventZ.mts b/ts/structs/Option_EventZ.mts index 0924e65a..33db4237 100644 --- a/ts/structs/Option_EventZ.mts +++ b/ts/structs/Option_EventZ.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a crate::lightning::util::events::Event or not + */ export class Option_EventZ extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_EventZ_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_EventZ extends CommonBase { } } + /** + * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event + */ public static constructor_some(o: Event): Option_EventZ { const ret: number = bindings.COption_EventZ_some(CommonBase.get_ptr_of(o)); const ret_hu_conv: Option_EventZ = Option_EventZ.constr_from_ptr(ret); @@ -300,6 +306,9 @@ export class Option_EventZ extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_EventZ containing nothing + */ public static constructor_none(): Option_EventZ { const ret: number = bindings.COption_EventZ_none(); const ret_hu_conv: Option_EventZ = Option_EventZ.constr_from_ptr(ret); @@ -312,6 +321,10 @@ export class Option_EventZ extends CommonBase { return ret; } + /** + * Creates a new COption_EventZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Option_EventZ { const ret: number = bindings.COption_EventZ_clone(this.ptr); const ret_hu_conv: Option_EventZ = Option_EventZ.constr_from_ptr(ret); @@ -320,6 +333,7 @@ export class Option_EventZ extends CommonBase { } } +/** A Option_EventZ of type Some */ export class Option_EventZ_Some extends Option_EventZ { public some: Event; /* @internal */ @@ -331,6 +345,7 @@ export class Option_EventZ_Some extends Option_EventZ { this.some = some_hu_conv; } } +/** A Option_EventZ of type None */ export class Option_EventZ_None extends Option_EventZ { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/Option_FilterZ.mts b/ts/structs/Option_FilterZ.mts index 51cd2b5c..90c5c6f2 100644 --- a/ts/structs/Option_FilterZ.mts +++ b/ts/structs/Option_FilterZ.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a crate::lightning::chain::Filter or not + */ export class Option_FilterZ extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_FilterZ_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_FilterZ extends CommonBase { } } + /** + * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter + */ public static constructor_some(o: Filter): Option_FilterZ { const ret: number = bindings.COption_FilterZ_some(o == null ? 0 : CommonBase.get_ptr_of(o)); const ret_hu_conv: Option_FilterZ = Option_FilterZ.constr_from_ptr(ret); @@ -301,6 +307,9 @@ export class Option_FilterZ extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_FilterZ containing nothing + */ public static constructor_none(): Option_FilterZ { const ret: number = bindings.COption_FilterZ_none(); const ret_hu_conv: Option_FilterZ = Option_FilterZ.constr_from_ptr(ret); @@ -309,6 +318,7 @@ export class Option_FilterZ extends CommonBase { } } +/** A Option_FilterZ of type Some */ export class Option_FilterZ_Some extends Option_FilterZ { public some: Filter; /* @internal */ @@ -320,6 +330,7 @@ export class Option_FilterZ_Some extends Option_FilterZ { this.some = ret_hu_conv; } } +/** A Option_FilterZ of type None */ export class Option_FilterZ_None extends Option_FilterZ { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/Option_MonitorEventZ.mts b/ts/structs/Option_MonitorEventZ.mts index 2f1246ea..1b0c7f8b 100644 --- a/ts/structs/Option_MonitorEventZ.mts +++ b/ts/structs/Option_MonitorEventZ.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not + */ export class Option_MonitorEventZ extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_MonitorEventZ_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_MonitorEventZ extends CommonBase { } } + /** + * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent + */ public static constructor_some(o: MonitorEvent): Option_MonitorEventZ { const ret: number = bindings.COption_MonitorEventZ_some(CommonBase.get_ptr_of(o)); const ret_hu_conv: Option_MonitorEventZ = Option_MonitorEventZ.constr_from_ptr(ret); @@ -300,6 +306,9 @@ export class Option_MonitorEventZ extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_MonitorEventZ containing nothing + */ public static constructor_none(): Option_MonitorEventZ { const ret: number = bindings.COption_MonitorEventZ_none(); const ret_hu_conv: Option_MonitorEventZ = Option_MonitorEventZ.constr_from_ptr(ret); @@ -312,6 +321,10 @@ export class Option_MonitorEventZ extends CommonBase { return ret; } + /** + * Creates a new COption_MonitorEventZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Option_MonitorEventZ { const ret: number = bindings.COption_MonitorEventZ_clone(this.ptr); const ret_hu_conv: Option_MonitorEventZ = Option_MonitorEventZ.constr_from_ptr(ret); @@ -320,6 +333,7 @@ export class Option_MonitorEventZ extends CommonBase { } } +/** A Option_MonitorEventZ of type Some */ export class Option_MonitorEventZ_Some extends Option_MonitorEventZ { public some: MonitorEvent; /* @internal */ @@ -331,6 +345,7 @@ export class Option_MonitorEventZ_Some extends Option_MonitorEventZ { this.some = some_hu_conv; } } +/** A Option_MonitorEventZ of type None */ export class Option_MonitorEventZ_None extends Option_MonitorEventZ { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/Option_NetworkUpdateZ.mts b/ts/structs/Option_NetworkUpdateZ.mts index 5ae42320..41835282 100644 --- a/ts/structs/Option_NetworkUpdateZ.mts +++ b/ts/structs/Option_NetworkUpdateZ.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a crate::lightning::routing::network_graph::NetworkUpdate or not + */ export class Option_NetworkUpdateZ extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_NetworkUpdateZ_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_NetworkUpdateZ extends CommonBase { } } + /** + * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::network_graph::NetworkUpdate + */ public static constructor_some(o: NetworkUpdate): Option_NetworkUpdateZ { const ret: number = bindings.COption_NetworkUpdateZ_some(CommonBase.get_ptr_of(o)); const ret_hu_conv: Option_NetworkUpdateZ = Option_NetworkUpdateZ.constr_from_ptr(ret); @@ -300,6 +306,9 @@ export class Option_NetworkUpdateZ extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_NetworkUpdateZ containing nothing + */ public static constructor_none(): Option_NetworkUpdateZ { const ret: number = bindings.COption_NetworkUpdateZ_none(); const ret_hu_conv: Option_NetworkUpdateZ = Option_NetworkUpdateZ.constr_from_ptr(ret); @@ -312,6 +321,10 @@ export class Option_NetworkUpdateZ extends CommonBase { return ret; } + /** + * Creates a new COption_NetworkUpdateZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Option_NetworkUpdateZ { const ret: number = bindings.COption_NetworkUpdateZ_clone(this.ptr); const ret_hu_conv: Option_NetworkUpdateZ = Option_NetworkUpdateZ.constr_from_ptr(ret); @@ -320,6 +333,7 @@ export class Option_NetworkUpdateZ extends CommonBase { } } +/** A Option_NetworkUpdateZ of type Some */ export class Option_NetworkUpdateZ_Some extends Option_NetworkUpdateZ { public some: NetworkUpdate; /* @internal */ @@ -331,6 +345,7 @@ export class Option_NetworkUpdateZ_Some extends Option_NetworkUpdateZ { this.some = some_hu_conv; } } +/** A Option_NetworkUpdateZ of type None */ export class Option_NetworkUpdateZ_None extends Option_NetworkUpdateZ { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/Option_TypeZ.mts b/ts/structs/Option_TypeZ.mts index 4396abd6..c464418c 100644 --- a/ts/structs/Option_TypeZ.mts +++ b/ts/structs/Option_TypeZ.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a crate::lightning::ln::wire::Type or not + */ export class Option_TypeZ extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_TypeZ_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_TypeZ extends CommonBase { } } + /** + * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type + */ public static constructor_some(o: Type): Option_TypeZ { const ret: number = bindings.COption_TypeZ_some(o == null ? 0 : CommonBase.get_ptr_of(o)); const ret_hu_conv: Option_TypeZ = Option_TypeZ.constr_from_ptr(ret); @@ -301,6 +307,9 @@ export class Option_TypeZ extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_TypeZ containing nothing + */ public static constructor_none(): Option_TypeZ { const ret: number = bindings.COption_TypeZ_none(); const ret_hu_conv: Option_TypeZ = Option_TypeZ.constr_from_ptr(ret); @@ -313,6 +322,10 @@ export class Option_TypeZ extends CommonBase { return ret; } + /** + * Creates a new COption_TypeZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Option_TypeZ { const ret: number = bindings.COption_TypeZ_clone(this.ptr); const ret_hu_conv: Option_TypeZ = Option_TypeZ.constr_from_ptr(ret); @@ -321,6 +334,7 @@ export class Option_TypeZ extends CommonBase { } } +/** A Option_TypeZ of type Some */ export class Option_TypeZ_Some extends Option_TypeZ { public some: Type; /* @internal */ @@ -332,6 +346,7 @@ export class Option_TypeZ_Some extends Option_TypeZ { this.some = ret_hu_conv; } } +/** A Option_TypeZ of type None */ export class Option_TypeZ_None extends Option_TypeZ { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/Option_u16Z.mts b/ts/structs/Option_u16Z.mts index d4e45335..5cf9c73d 100644 --- a/ts/structs/Option_u16Z.mts +++ b/ts/structs/Option_u16Z.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a u16 or not + */ export class Option_u16Z extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_u16Z_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_u16Z extends CommonBase { } } + /** + * Constructs a new COption_u16Z containing a u16 + */ public static constructor_some(o: number): Option_u16Z { const ret: number = bindings.COption_u16Z_some(o); const ret_hu_conv: Option_u16Z = Option_u16Z.constr_from_ptr(ret); @@ -300,6 +306,9 @@ export class Option_u16Z extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_u16Z containing nothing + */ public static constructor_none(): Option_u16Z { const ret: number = bindings.COption_u16Z_none(); const ret_hu_conv: Option_u16Z = Option_u16Z.constr_from_ptr(ret); @@ -312,6 +321,10 @@ export class Option_u16Z extends CommonBase { return ret; } + /** + * Creates a new COption_u16Z which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Option_u16Z { const ret: number = bindings.COption_u16Z_clone(this.ptr); const ret_hu_conv: Option_u16Z = Option_u16Z.constr_from_ptr(ret); @@ -320,6 +333,7 @@ export class Option_u16Z extends CommonBase { } } +/** A Option_u16Z of type Some */ export class Option_u16Z_Some extends Option_u16Z { public some: number; /* @internal */ @@ -328,6 +342,7 @@ export class Option_u16Z_Some extends Option_u16Z { this.some = bindings.LDKCOption_u16Z_Some_get_some(ptr); } } +/** A Option_u16Z of type None */ export class Option_u16Z_None extends Option_u16Z { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/Option_u32Z.mts b/ts/structs/Option_u32Z.mts index db75d1f6..3d3be603 100644 --- a/ts/structs/Option_u32Z.mts +++ b/ts/structs/Option_u32Z.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a u32 or not + */ export class Option_u32Z extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_u32Z_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_u32Z extends CommonBase { } } + /** + * Constructs a new COption_u32Z containing a u32 + */ public static constructor_some(o: number): Option_u32Z { const ret: number = bindings.COption_u32Z_some(o); const ret_hu_conv: Option_u32Z = Option_u32Z.constr_from_ptr(ret); @@ -300,6 +306,9 @@ export class Option_u32Z extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_u32Z containing nothing + */ public static constructor_none(): Option_u32Z { const ret: number = bindings.COption_u32Z_none(); const ret_hu_conv: Option_u32Z = Option_u32Z.constr_from_ptr(ret); @@ -312,6 +321,10 @@ export class Option_u32Z extends CommonBase { return ret; } + /** + * Creates a new COption_u32Z which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Option_u32Z { const ret: number = bindings.COption_u32Z_clone(this.ptr); const ret_hu_conv: Option_u32Z = Option_u32Z.constr_from_ptr(ret); @@ -320,6 +333,7 @@ export class Option_u32Z extends CommonBase { } } +/** A Option_u32Z of type Some */ export class Option_u32Z_Some extends Option_u32Z { public some: number; /* @internal */ @@ -328,6 +342,7 @@ export class Option_u32Z_Some extends Option_u32Z { this.some = bindings.LDKCOption_u32Z_Some_get_some(ptr); } } +/** A Option_u32Z of type None */ export class Option_u32Z_None extends Option_u32Z { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/Option_u64Z.mts b/ts/structs/Option_u64Z.mts index 366ddba1..0d92417a 100644 --- a/ts/structs/Option_u64Z.mts +++ b/ts/structs/Option_u64Z.mts @@ -280,6 +280,9 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An enum which can either contain a u64 or not + */ export class Option_u64Z extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.COption_u64Z_free); } /* @internal */ @@ -293,6 +296,9 @@ export class Option_u64Z extends CommonBase { } } + /** + * Constructs a new COption_u64Z containing a u64 + */ public static constructor_some(o: bigint): Option_u64Z { const ret: number = bindings.COption_u64Z_some(o); const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret); @@ -300,6 +306,9 @@ export class Option_u64Z extends CommonBase { return ret_hu_conv; } + /** + * Constructs a new COption_u64Z containing nothing + */ public static constructor_none(): Option_u64Z { const ret: number = bindings.COption_u64Z_none(); const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret); @@ -312,6 +321,10 @@ export class Option_u64Z extends CommonBase { return ret; } + /** + * Creates a new COption_u64Z which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Option_u64Z { const ret: number = bindings.COption_u64Z_clone(this.ptr); const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret); @@ -320,6 +333,7 @@ export class Option_u64Z extends CommonBase { } } +/** A Option_u64Z of type Some */ export class Option_u64Z_Some extends Option_u64Z { public some: bigint; /* @internal */ @@ -328,6 +342,7 @@ export class Option_u64Z_Some extends Option_u64Z { this.some = bindings.LDKCOption_u64Z_Some_get_some(ptr); } } +/** A Option_u64Z of type None */ export class Option_u64Z_None extends Option_u64Z { /* @internal */ public constructor(ptr: number) { diff --git a/ts/structs/OutPoint.mts b/ts/structs/OutPoint.mts index 2274b645..2a649854 100644 --- a/ts/structs/OutPoint.mts +++ b/ts/structs/OutPoint.mts @@ -281,31 +281,52 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A reference to a transaction output. + * + * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32 + * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way. + */ export class OutPoint extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.OutPoint_free); } + /** + * The referenced transaction's txid. + */ public get_txid(): Uint8Array { const ret: number = bindings.OutPoint_get_txid(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The referenced transaction's txid. + */ public set_txid(val: Uint8Array): void { bindings.OutPoint_set_txid(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The index of the referenced output in its transaction's vout. + */ public get_index(): number { const ret: number = bindings.OutPoint_get_index(this.ptr); return ret; } + /** + * The index of the referenced output in its transaction's vout. + */ public set_index(val: number): void { bindings.OutPoint_set_index(this.ptr, val); } + /** + * Constructs a new OutPoint given each field + */ public static constructor_new(txid_arg: Uint8Array, index_arg: number): OutPoint { const ret: number = bindings.OutPoint_new(bindings.encodeUint8Array(bindings.check_arr_len(txid_arg, 32)), index_arg); const ret_hu_conv: OutPoint = new OutPoint(null, ret); @@ -318,6 +339,9 @@ export class OutPoint extends CommonBase { return ret; } + /** + * Creates a copy of the OutPoint + */ public clone(): OutPoint { const ret: number = bindings.OutPoint_clone(this.ptr); const ret_hu_conv: OutPoint = new OutPoint(null, ret); @@ -325,29 +349,46 @@ export class OutPoint extends CommonBase { return ret_hu_conv; } + /** + * Checks if two OutPoints contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: OutPoint): boolean { const ret: boolean = bindings.OutPoint_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); return ret; } + /** + * Checks if two OutPoints contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.OutPoint_hash(this.ptr); return ret; } + /** + * Convert an `OutPoint` to a lightning channel id. + */ public to_channel_id(): Uint8Array { const ret: number = bindings.OutPoint_to_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Serialize the OutPoint object into a byte array which can be read by OutPoint_read + */ public write(): Uint8Array { const ret: number = bindings.OutPoint_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a OutPoint from a byte array, created by OutPoint_write + */ public static constructor_read(ser: Uint8Array): Result_OutPointDecodeErrorZ { const ret: number = bindings.OutPoint_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_OutPointDecodeErrorZ = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Payee.mts b/ts/structs/Payee.mts index 06afdec5..7a19a86f 100644 --- a/ts/structs/Payee.mts +++ b/ts/structs/Payee.mts @@ -281,22 +281,41 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * The recipient of a payment. + */ export class Payee extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.Payee_free); } + /** + * The node id of the payee. + */ public get_pubkey(): Uint8Array { const ret: number = bindings.Payee_get_pubkey(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The node id of the payee. + */ public set_pubkey(val: Uint8Array): void { bindings.Payee_set_pubkey(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Features supported by the payee. + * + * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice + * does not contain any features. + * + * [`for_keysend`]: Self::for_keysend + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_features(): InvoiceFeatures { const ret: number = bindings.Payee_get_features(this.ptr); const ret_hu_conv: InvoiceFeatures = new InvoiceFeatures(null, ret); @@ -304,10 +323,23 @@ export class Payee extends CommonBase { return ret_hu_conv; } + /** + * Features supported by the payee. + * + * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice + * does not contain any features. + * + * [`for_keysend`]: Self::for_keysend + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_features(val: InvoiceFeatures): void { bindings.Payee_set_features(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Hints for routing to the payee, containing channels connecting the payee to public nodes. + */ public get_route_hints(): RouteHint[] { const ret: number = bindings.Payee_get_route_hints(this.ptr); const ret_conv_11_len: number = bindings.getArrayLength(ret); @@ -318,13 +350,20 @@ export class Payee extends CommonBase { CommonBase.add_ref_from(ret_conv_11_hu_conv, this); ret_conv_11_arr[l] = ret_conv_11_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_11_arr; } + /** + * Hints for routing to the payee, containing channels connecting the payee to public nodes. + */ public set_route_hints(val: RouteHint[]): void { bindings.Payee_set_route_hints(this.ptr, bindings.encodeUint32Array(val != null ? val.map(val_conv_11 => val_conv_11 == null ? 0 : CommonBase.get_ptr_of(val_conv_11) & ~1) : null)); } + /** + * Expiration of a payment to the payee, in seconds relative to the UNIX epoch. + */ public get_expiry_time(): Option_u64Z { const ret: number = bindings.Payee_get_expiry_time(this.ptr); const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret); @@ -332,10 +371,16 @@ export class Payee extends CommonBase { return ret_hu_conv; } + /** + * Expiration of a payment to the payee, in seconds relative to the UNIX epoch. + */ public set_expiry_time(val: Option_u64Z): void { bindings.Payee_set_expiry_time(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * Constructs a new Payee given each field + */ public static constructor_new(pubkey_arg: Uint8Array, features_arg: InvoiceFeatures, route_hints_arg: RouteHint[], expiry_time_arg: Option_u64Z): Payee { const ret: number = bindings.Payee_new(bindings.encodeUint8Array(bindings.check_arr_len(pubkey_arg, 33)), features_arg == null ? 0 : CommonBase.get_ptr_of(features_arg) & ~1, bindings.encodeUint32Array(route_hints_arg != null ? route_hints_arg.map(route_hints_arg_conv_11 => route_hints_arg_conv_11 == null ? 0 : CommonBase.get_ptr_of(route_hints_arg_conv_11) & ~1) : null), CommonBase.get_ptr_of(expiry_time_arg)); const ret_hu_conv: Payee = new Payee(null, ret); @@ -348,6 +393,9 @@ export class Payee extends CommonBase { return ret; } + /** + * Creates a copy of the Payee + */ public clone(): Payee { const ret: number = bindings.Payee_clone(this.ptr); const ret_hu_conv: Payee = new Payee(null, ret); @@ -355,29 +403,46 @@ export class Payee extends CommonBase { return ret_hu_conv; } + /** + * Checks if two Payees contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.Payee_hash(this.ptr); return ret; } + /** + * Checks if two Payees contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: Payee): boolean { const ret: boolean = bindings.Payee_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); return ret; } + /** + * Serialize the Payee object into a byte array which can be read by Payee_read + */ public write(): Uint8Array { const ret: number = bindings.Payee_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a Payee from a byte array, created by Payee_write + */ public static constructor_read(ser: Uint8Array): Result_PayeeDecodeErrorZ { const ret: number = bindings.Payee_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_PayeeDecodeErrorZ = Result_PayeeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a payee with the node id of the given `pubkey`. + */ public static constructor_from_node_id(pubkey: Uint8Array): Payee { const ret: number = bindings.Payee_from_node_id(bindings.encodeUint8Array(bindings.check_arr_len(pubkey, 33))); const ret_hu_conv: Payee = new Payee(null, ret); @@ -385,6 +450,9 @@ export class Payee extends CommonBase { return ret_hu_conv; } + /** + * Creates a payee with the node id of the given `pubkey` to use for keysend payments. + */ public static constructor_for_keysend(pubkey: Uint8Array): Payee { const ret: number = bindings.Payee_for_keysend(bindings.encodeUint8Array(bindings.check_arr_len(pubkey, 33))); const ret_hu_conv: Payee = new Payee(null, ret); diff --git a/ts/structs/PaymentPurpose.mts b/ts/structs/PaymentPurpose.mts index 0c1060bb..3d5565e0 100644 --- a/ts/structs/PaymentPurpose.mts +++ b/ts/structs/PaymentPurpose.mts @@ -280,6 +280,10 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Some information provided on receipt of payment depends on whether the payment received is a + * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice. + */ export class PaymentPurpose extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.PaymentPurpose_free); } /* @internal */ @@ -298,6 +302,9 @@ export class PaymentPurpose extends CommonBase { return ret; } + /** + * Creates a copy of the PaymentPurpose + */ public clone(): PaymentPurpose { const ret: number = bindings.PaymentPurpose_clone(this.ptr); const ret_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(ret); @@ -305,6 +312,9 @@ export class PaymentPurpose extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new InvoicePayment-variant PaymentPurpose + */ public static constructor_invoice_payment(payment_preimage: Uint8Array, payment_secret: Uint8Array): PaymentPurpose { const ret: number = bindings.PaymentPurpose_invoice_payment(bindings.encodeUint8Array(bindings.check_arr_len(payment_preimage, 32)), bindings.encodeUint8Array(bindings.check_arr_len(payment_secret, 32))); const ret_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(ret); @@ -312,6 +322,9 @@ export class PaymentPurpose extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose + */ public static constructor_spontaneous_payment(a: Uint8Array): PaymentPurpose { const ret: number = bindings.PaymentPurpose_spontaneous_payment(bindings.encodeUint8Array(bindings.check_arr_len(a, 32))); const ret_hu_conv: PaymentPurpose = PaymentPurpose.constr_from_ptr(ret); @@ -320,8 +333,31 @@ export class PaymentPurpose extends CommonBase { } } +/** A PaymentPurpose of type InvoicePayment */ export class PaymentPurpose_InvoicePayment extends PaymentPurpose { + /** + * The preimage to the payment_hash, if the payment hash (and secret) were fetched via + * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to + * [`ChannelManager::claim_funds`]. + * + * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment + * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public payment_preimage: Uint8Array; + /** + * The \"payment secret\". This authenticates the sender to the recipient, preventing a + * number of deanonymization attacks during the routing process. + * It is provided here for your reference, however its accuracy is enforced directly by + * [`ChannelManager`] using the values you previously provided to + * [`ChannelManager::create_inbound_payment`] or + * [`ChannelManager::create_inbound_payment_for_hash`]. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment + * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash + */ public payment_secret: Uint8Array; /* @internal */ public constructor(ptr: number) { @@ -334,6 +370,7 @@ export class PaymentPurpose_InvoicePayment extends PaymentPurpose { this.payment_secret = payment_secret_conv; } } +/** A PaymentPurpose of type SpontaneousPayment */ export class PaymentPurpose_SpontaneousPayment extends PaymentPurpose { public spontaneous_payment: Uint8Array; /* @internal */ diff --git a/ts/structs/PaymentSendFailure.mts b/ts/structs/PaymentSendFailure.mts index 10804bdd..0238b57c 100644 --- a/ts/structs/PaymentSendFailure.mts +++ b/ts/structs/PaymentSendFailure.mts @@ -280,6 +280,11 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * If a payment fails to send, it can be in one of several states. This enum is returned as the + * Err() type describing which state the payment is in, see the description of individual enum + * states for more. + */ export class PaymentSendFailure extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.PaymentSendFailure_free); } /* @internal */ @@ -300,6 +305,9 @@ export class PaymentSendFailure extends CommonBase { return ret; } + /** + * Creates a copy of the PaymentSendFailure + */ public clone(): PaymentSendFailure { const ret: number = bindings.PaymentSendFailure_clone(this.ptr); const ret_hu_conv: PaymentSendFailure = PaymentSendFailure.constr_from_ptr(ret); @@ -307,6 +315,9 @@ export class PaymentSendFailure extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new ParameterError-variant PaymentSendFailure + */ public static constructor_parameter_error(a: APIError): PaymentSendFailure { const ret: number = bindings.PaymentSendFailure_parameter_error(CommonBase.get_ptr_of(a)); const ret_hu_conv: PaymentSendFailure = PaymentSendFailure.constr_from_ptr(ret); @@ -314,6 +325,9 @@ export class PaymentSendFailure extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new PathParameterError-variant PaymentSendFailure + */ public static constructor_path_parameter_error(a: Result_NoneAPIErrorZ[]): PaymentSendFailure { const ret: number = bindings.PaymentSendFailure_path_parameter_error(bindings.encodeUint32Array(a != null ? a.map(a_conv_22 => a_conv_22 != null ? CommonBase.get_ptr_of(a_conv_22) : 0) : null)); const ret_hu_conv: PaymentSendFailure = PaymentSendFailure.constr_from_ptr(ret); @@ -321,6 +335,9 @@ export class PaymentSendFailure extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure + */ public static constructor_all_failed_retry_safe(a: APIError[]): PaymentSendFailure { const ret: number = bindings.PaymentSendFailure_all_failed_retry_safe(bindings.encodeUint32Array(a != null ? a.map(a_conv_10 => CommonBase.get_ptr_of(a_conv_10)) : null)); const ret_hu_conv: PaymentSendFailure = PaymentSendFailure.constr_from_ptr(ret); @@ -328,6 +345,9 @@ export class PaymentSendFailure extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new PartialFailure-variant PaymentSendFailure + */ public static constructor_partial_failure(results: Result_NoneAPIErrorZ[], failed_paths_retry: RouteParameters, payment_id: Uint8Array): PaymentSendFailure { const ret: number = bindings.PaymentSendFailure_partial_failure(bindings.encodeUint32Array(results != null ? results.map(results_conv_22 => results_conv_22 != null ? CommonBase.get_ptr_of(results_conv_22) : 0) : null), failed_paths_retry == null ? 0 : CommonBase.get_ptr_of(failed_paths_retry) & ~1, bindings.encodeUint8Array(bindings.check_arr_len(payment_id, 32))); const ret_hu_conv: PaymentSendFailure = PaymentSendFailure.constr_from_ptr(ret); @@ -336,6 +356,7 @@ export class PaymentSendFailure extends CommonBase { } } +/** A PaymentSendFailure of type ParameterError */ export class PaymentSendFailure_ParameterError extends PaymentSendFailure { public parameter_error: APIError; /* @internal */ @@ -347,6 +368,7 @@ export class PaymentSendFailure_ParameterError extends PaymentSendFailure { this.parameter_error = parameter_error_hu_conv; } } +/** A PaymentSendFailure of type PathParameterError */ export class PaymentSendFailure_PathParameterError extends PaymentSendFailure { public path_parameter_error: Result_NoneAPIErrorZ[]; /* @internal */ @@ -360,9 +382,11 @@ export class PaymentSendFailure_PathParameterError extends PaymentSendFailure { const path_parameter_error_conv_22_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(path_parameter_error_conv_22); path_parameter_error_conv_22_arr[w] = path_parameter_error_conv_22_hu_conv; } + bindings.freeWasmMemory(path_parameter_error) this.path_parameter_error = path_parameter_error_conv_22_arr; } } +/** A PaymentSendFailure of type AllFailedRetrySafe */ export class PaymentSendFailure_AllFailedRetrySafe extends PaymentSendFailure { public all_failed_retry_safe: APIError[]; /* @internal */ @@ -377,12 +401,27 @@ export class PaymentSendFailure_AllFailedRetrySafe extends PaymentSendFailure { CommonBase.add_ref_from(all_failed_retry_safe_conv_10_hu_conv, this); all_failed_retry_safe_conv_10_arr[k] = all_failed_retry_safe_conv_10_hu_conv; } + bindings.freeWasmMemory(all_failed_retry_safe) this.all_failed_retry_safe = all_failed_retry_safe_conv_10_arr; } } +/** A PaymentSendFailure of type PartialFailure */ export class PaymentSendFailure_PartialFailure extends PaymentSendFailure { + /** + * The errors themselves, in the same order as the route hops. + */ public results: Result_NoneAPIErrorZ[]; + /** + * If some paths failed without irrevocably committing to the new HTLC(s), this will + * contain a [`RouteParameters`] object which can be used to calculate a new route that + * will pay all remaining unpaid balance. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public failed_paths_retry: RouteParameters; + /** + * The payment id for the payment, which is now at least partially pending. + */ public payment_id: Uint8Array; /* @internal */ public constructor(ptr: number) { @@ -395,6 +434,7 @@ export class PaymentSendFailure_PartialFailure extends PaymentSendFailure { const results_conv_22_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(results_conv_22); results_conv_22_arr[w] = results_conv_22_hu_conv; } + bindings.freeWasmMemory(results) this.results = results_conv_22_arr; const failed_paths_retry: number = bindings.LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry(ptr); const failed_paths_retry_hu_conv: RouteParameters = new RouteParameters(null, failed_paths_retry); diff --git a/ts/structs/PeerHandleError.mts b/ts/structs/PeerHandleError.mts index 84b9a2b9..30049f6d 100644 --- a/ts/structs/PeerHandleError.mts +++ b/ts/structs/PeerHandleError.mts @@ -281,21 +281,37 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Error for PeerManager errors. If you get one of these, you must disconnect the socket and + * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the + * descriptor. + */ export class PeerHandleError extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.PeerHandleError_free); } + /** + * Used to indicate that we probably can't make any future connections to this peer, implying + * we should go ahead and force-close any channels we have with it. + */ public get_no_connection_possible(): boolean { const ret: boolean = bindings.PeerHandleError_get_no_connection_possible(this.ptr); return ret; } + /** + * Used to indicate that we probably can't make any future connections to this peer, implying + * we should go ahead and force-close any channels we have with it. + */ public set_no_connection_possible(val: boolean): void { bindings.PeerHandleError_set_no_connection_possible(this.ptr, val); } + /** + * Constructs a new PeerHandleError given each field + */ public static constructor_new(no_connection_possible_arg: boolean): PeerHandleError { const ret: number = bindings.PeerHandleError_new(no_connection_possible_arg); const ret_hu_conv: PeerHandleError = new PeerHandleError(null, ret); @@ -308,6 +324,9 @@ export class PeerHandleError extends CommonBase { return ret; } + /** + * Creates a copy of the PeerHandleError + */ public clone(): PeerHandleError { const ret: number = bindings.PeerHandleError_clone(this.ptr); const ret_hu_conv: PeerHandleError = new PeerHandleError(null, ret); diff --git a/ts/structs/PeerManager.mts b/ts/structs/PeerManager.mts index 353f9f66..fdcd5c2e 100644 --- a/ts/structs/PeerManager.mts +++ b/ts/structs/PeerManager.mts @@ -281,12 +281,38 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls + * socket events into messages which it passes on to its [`MessageHandler`]. + * + * Locks are taken internally, so you must never assume that reentrancy from a + * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock. + * + * Calls to [`read_event`] will decode relevant messages and pass them to the + * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of + * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any + * [`PeerManager`] functions related to the same connection must occur only in serial, making new + * calls only after previous ones have returned. + * + * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager + * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but + * essentially you should default to using a SimpleRefPeerManager, and use a + * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when + * you're using lightning-net-tokio. + * + * [`read_event`]: PeerManager::read_event + */ export class PeerManager extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.PeerManager_free); } + /** + * Constructs a new PeerManager with the given message handlers and node_id secret key + * ephemeral_random_data is used to derive per-connection ephemeral keys and must be + * cryptographically secure random bytes. + */ public static constructor_new(message_handler_chan_handler_arg: ChannelMessageHandler, message_handler_route_handler_arg: RoutingMessageHandler, our_node_secret: Uint8Array, ephemeral_random_data: Uint8Array, logger: Logger, custom_message_handler: CustomMessageHandler): PeerManager { const ret: number = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg == null ? 0 : CommonBase.get_ptr_of(message_handler_chan_handler_arg), message_handler_route_handler_arg == null ? 0 : CommonBase.get_ptr_of(message_handler_route_handler_arg)), bindings.encodeUint8Array(bindings.check_arr_len(our_node_secret, 32)), bindings.encodeUint8Array(bindings.check_arr_len(ephemeral_random_data, 32)), logger == null ? 0 : CommonBase.get_ptr_of(logger), custom_message_handler == null ? 0 : CommonBase.get_ptr_of(custom_message_handler)); const ret_hu_conv: PeerManager = new PeerManager(null, ret); @@ -298,6 +324,13 @@ export class PeerManager extends CommonBase { return ret_hu_conv; } + /** + * Get the list of node ids for peers which have completed the initial handshake. + * + * For outbound connections, this will be the same as the their_node_id parameter passed in to + * new_outbound_connection, however entries will only appear once the initial handshake has + * completed and we are sure the remote peer has the private key for the given node_id. + */ public get_peer_node_ids(): Uint8Array[] { const ret: number = bindings.PeerManager_get_peer_node_ids(this.ptr); const ret_conv_12_len: number = bindings.getArrayLength(ret); @@ -307,9 +340,22 @@ export class PeerManager extends CommonBase { const ret_conv_12_conv: Uint8Array = bindings.decodeUint8Array(ret_conv_12); ret_conv_12_arr[m] = ret_conv_12_conv; } + bindings.freeWasmMemory(ret) return ret_conv_12_arr; } + /** + * Indicates a new outbound connection has been established to a node with the given node_id. + * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new + * descriptor but must disconnect the connection immediately. + * + * Returns a small number of bytes to send to the remote node (currently always 50). + * + * Panics if descriptor is duplicative with some other descriptor which has not yet been + * [`socket_disconnected()`]. + * + * [`socket_disconnected()`]: PeerManager::socket_disconnected + */ public new_outbound_connection(their_node_id: Uint8Array, descriptor: SocketDescriptor): Result_CVec_u8ZPeerHandleErrorZ { const ret: number = bindings.PeerManager_new_outbound_connection(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), descriptor == null ? 0 : CommonBase.get_ptr_of(descriptor)); const ret_hu_conv: Result_CVec_u8ZPeerHandleErrorZ = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); @@ -317,6 +363,19 @@ export class PeerManager extends CommonBase { return ret_hu_conv; } + /** + * Indicates a new inbound connection has been established. + * + * May refuse the connection by returning an Err, but will never write bytes to the remote end + * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT + * call socket_disconnected for the new descriptor but must disconnect the connection + * immediately. + * + * Panics if descriptor is duplicative with some other descriptor which has not yet been + * [`socket_disconnected()`]. + * + * [`socket_disconnected()`]: PeerManager::socket_disconnected + */ public new_inbound_connection(descriptor: SocketDescriptor): Result_NonePeerHandleErrorZ { const ret: number = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0 : CommonBase.get_ptr_of(descriptor)); const ret_hu_conv: Result_NonePeerHandleErrorZ = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); @@ -324,34 +383,111 @@ export class PeerManager extends CommonBase { return ret_hu_conv; } + /** + * Indicates that there is room to write data to the given socket descriptor. + * + * May return an Err to indicate that the connection should be closed. + * + * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before + * returning. Thus, be very careful with reentrancy issues! The invariants around calling + * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be + * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't + * sufficient! + * + * [`send_data`]: SocketDescriptor::send_data + * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail + */ public write_buffer_space_avail(descriptor: SocketDescriptor): Result_NonePeerHandleErrorZ { const ret: number = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0 : CommonBase.get_ptr_of(descriptor)); const ret_hu_conv: Result_NonePeerHandleErrorZ = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Indicates that data was read from the given socket descriptor. + * + * May return an Err to indicate that the connection should be closed. + * + * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity. + * Thus, however, you should call [`process_events`] after any `read_event` to generate + * [`send_data`] calls to handle responses. + * + * If `Ok(true)` is returned, further read_events should not be triggered until a + * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the + * send buffer). + * + * [`send_data`]: SocketDescriptor::send_data + * [`process_events`]: PeerManager::process_events + */ public read_event(peer_descriptor: SocketDescriptor, data: Uint8Array): Result_boolPeerHandleErrorZ { const ret: number = bindings.PeerManager_read_event(this.ptr, peer_descriptor == null ? 0 : CommonBase.get_ptr_of(peer_descriptor), bindings.encodeUint8Array(data)); const ret_hu_conv: Result_boolPeerHandleErrorZ = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks for any events generated by our handlers and processes them. Includes sending most + * response messages as well as messages generated by calls to handler functions directly (eg + * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]). + * + * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy + * issues! + * + * You don't have to call this function explicitly if you are using [`lightning-net-tokio`] + * or one of the other clients provided in our language bindings. + * + * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment + * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards + * [`send_data`]: SocketDescriptor::send_data + */ public process_events(): void { bindings.PeerManager_process_events(this.ptr); } + /** + * Indicates that the given socket descriptor's connection is now closed. + */ public socket_disconnected(descriptor: SocketDescriptor): void { bindings.PeerManager_socket_disconnected(this.ptr, descriptor == null ? 0 : CommonBase.get_ptr_of(descriptor)); } + /** + * Disconnect a peer given its node id. + * + * Set `no_connection_possible` to true to prevent any further connection with this peer, + * force-closing any channels we have with it. + * + * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the + * peer. Thus, be very careful about reentrancy issues. + * + * [`disconnect_socket`]: SocketDescriptor::disconnect_socket + */ public disconnect_by_node_id(node_id: Uint8Array, no_connection_possible: boolean): void { bindings.PeerManager_disconnect_by_node_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(node_id, 33)), no_connection_possible); } + /** + * Disconnects all currently-connected peers. This is useful on platforms where there may be + * an indication that TCP sockets have stalled even if we weren't around to time them out + * using regular ping/pongs. + */ public disconnect_all_peers(): void { bindings.PeerManager_disconnect_all_peers(this.ptr); } + /** + * Send pings to each peer and disconnect those which did not respond to the last round of + * pings. + * + * This may be called on any timescale you want, however, roughly once every five to ten + * seconds is preferred. The call rate determines both how often we send a ping to our peers + * and how much time they have to respond before we disconnect them. + * + * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy + * issues! + * + * [`send_data`]: SocketDescriptor::send_data + */ public timer_tick_occurred(): void { bindings.PeerManager_timer_tick_occurred(this.ptr); } diff --git a/ts/structs/Persist.mts b/ts/structs/Persist.mts index 98ffb79d..fada1d5d 100644 --- a/ts/structs/Persist.mts +++ b/ts/structs/Persist.mts @@ -283,8 +283,61 @@ import * as bindings from '../bindings.mjs' +/** An implementation of Persist */ export interface PersistInterface { + /**Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is + * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup. + * + * The data can be stored any way you want, but the identifier provided by LDK is the + * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint + * and the stored channel data). Note that you **must** persist every new monitor to disk. + * + * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], + * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`]. + * + * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor` + * and [`ChannelMonitorUpdateErr`] for requirements when returning errors. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + * [`Writeable::write`]: crate::util::ser::Writeable::write + */ persist_new_channel(channel_id: OutPoint, data: ChannelMonitor, update_id: MonitorUpdateId): Result_NoneChannelMonitorUpdateErrZ; + /**Update one channel's data. The provided [`ChannelMonitor`] has already applied the given + * update. + * + * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the + * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more + * details. + * + * During blockchain synchronization operations, this may be called with no + * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted. + * Note that after the full [`ChannelMonitor`] is persisted any previous + * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be + * applied to the persisted [`ChannelMonitor`] as they were already applied. + * + * If an implementer chooses to persist the updates only, they need to make + * sure that all the updates are applied to the `ChannelMonitors` *before + * the set of channel monitors is given to the `ChannelManager` + * deserialization routine. See [`ChannelMonitor::update_monitor`] for + * applying a monitor update to a monitor. If full `ChannelMonitors` are + * persisted, then there is no need to persist individual updates. + * + * Note that there could be a performance tradeoff between persisting complete + * channel monitors on every update vs. persisting only updates and applying + * them in batches. The size of each monitor grows `O(number of state updates)` + * whereas updates are small and `O(1)`. + * + * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], + * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`]. + * + * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`, + * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and + * [`ChannelMonitorUpdateErr`] for requirements when returning errors. + * + * [`Writeable::write`]: crate::util::ser::Writeable::write + * + * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None + */ update_persisted_channel(channel_id: OutPoint, update: ChannelMonitorUpdate, data: ChannelMonitor, update_id: MonitorUpdateId): Result_NoneChannelMonitorUpdateErrZ; } @@ -292,6 +345,27 @@ class LDKPersistHolder { held: Persist; } +/** + * `Persist` defines behavior for persisting channel monitors: this could mean + * writing once to disk, and/or uploading to one or more backup services. + * + * Each method can return three possible values: + * If persistence (including any relevant `fsync()` calls) happens immediately, the + * implementation should return `Ok(())`, indicating normal channel operation should continue. + * If persistence happens asynchronously, implementations should first ensure the + * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return + * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the + * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be + * called with the corresponding [`MonitorUpdateId`]. + * + * Note that unlike the direct [`chain::Watch`] interface, + * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs. + * + * If persistence fails for some reason, implementations should return + * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be + * closed without broadcasting the latest state. See + * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details. + */ export class Persist extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKPersist; @@ -302,7 +376,8 @@ export class Persist extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: PersistInterface): Persist { + /** Creates a new instance of Persist from a given implementation */ + public static new_impl(arg: PersistInterface): Persist { const impl_holder: LDKPersistHolder = new LDKPersistHolder(); let structImplementation = { persist_new_channel (channel_id: number, data: number, update_id: number): number { @@ -333,6 +408,24 @@ export class Persist extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is + * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup. + * + * The data can be stored any way you want, but the identifier provided by LDK is the + * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint + * and the stored channel data). Note that you **must** persist every new monitor to disk. + * + * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], + * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`]. + * + * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor` + * and [`ChannelMonitorUpdateErr`] for requirements when returning errors. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + * [`Writeable::write`]: crate::util::ser::Writeable::write + */ public persist_new_channel(channel_id: OutPoint, data: ChannelMonitor, update_id: MonitorUpdateId): Result_NoneChannelMonitorUpdateErrZ { const ret: number = bindings.Persist_persist_new_channel(this.ptr, channel_id == null ? 0 : CommonBase.get_ptr_of(channel_id) & ~1, data == null ? 0 : CommonBase.get_ptr_of(data) & ~1, update_id == null ? 0 : CommonBase.get_ptr_of(update_id) & ~1); const ret_hu_conv: Result_NoneChannelMonitorUpdateErrZ = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); @@ -340,6 +433,43 @@ export class Persist extends CommonBase { return ret_hu_conv; } + /** + * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given + * update. + * + * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the + * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more + * details. + * + * During blockchain synchronization operations, this may be called with no + * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted. + * Note that after the full [`ChannelMonitor`] is persisted any previous + * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be + * applied to the persisted [`ChannelMonitor`] as they were already applied. + * + * If an implementer chooses to persist the updates only, they need to make + * sure that all the updates are applied to the `ChannelMonitors` *before + * the set of channel monitors is given to the `ChannelManager` + * deserialization routine. See [`ChannelMonitor::update_monitor`] for + * applying a monitor update to a monitor. If full `ChannelMonitors` are + * persisted, then there is no need to persist individual updates. + * + * Note that there could be a performance tradeoff between persisting complete + * channel monitors on every update vs. persisting only updates and applying + * them in batches. The size of each monitor grows `O(number of state updates)` + * whereas updates are small and `O(1)`. + * + * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`], + * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`]. + * + * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`, + * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and + * [`ChannelMonitorUpdateErr`] for requirements when returning errors. + * + * [`Writeable::write`]: crate::util::ser::Writeable::write + * + * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public update_persisted_channel(channel_id: OutPoint, update: ChannelMonitorUpdate, data: ChannelMonitor, update_id: MonitorUpdateId): Result_NoneChannelMonitorUpdateErrZ { const ret: number = bindings.Persist_update_persisted_channel(this.ptr, channel_id == null ? 0 : CommonBase.get_ptr_of(channel_id) & ~1, update == null ? 0 : CommonBase.get_ptr_of(update) & ~1, data == null ? 0 : CommonBase.get_ptr_of(data) & ~1, update_id == null ? 0 : CommonBase.get_ptr_of(update_id) & ~1); const ret_hu_conv: Result_NoneChannelMonitorUpdateErrZ = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); diff --git a/ts/structs/Ping.mts b/ts/structs/Ping.mts index ef0ed24a..eafb0b59 100644 --- a/ts/structs/Ping.mts +++ b/ts/structs/Ping.mts @@ -281,30 +281,50 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A ping message to be sent or received from a peer + */ export class Ping extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.Ping_free); } + /** + * The desired response length + */ public get_ponglen(): number { const ret: number = bindings.Ping_get_ponglen(this.ptr); return ret; } + /** + * The desired response length + */ public set_ponglen(val: number): void { bindings.Ping_set_ponglen(this.ptr, val); } + /** + * The ping packet size. + * This field is not sent on the wire. byteslen zeros are sent. + */ public get_byteslen(): number { const ret: number = bindings.Ping_get_byteslen(this.ptr); return ret; } + /** + * The ping packet size. + * This field is not sent on the wire. byteslen zeros are sent. + */ public set_byteslen(val: number): void { bindings.Ping_set_byteslen(this.ptr, val); } + /** + * Constructs a new Ping given each field + */ public static constructor_new(ponglen_arg: number, byteslen_arg: number): Ping { const ret: number = bindings.Ping_new(ponglen_arg, byteslen_arg); const ret_hu_conv: Ping = new Ping(null, ret); @@ -317,6 +337,9 @@ export class Ping extends CommonBase { return ret; } + /** + * Creates a copy of the Ping + */ public clone(): Ping { const ret: number = bindings.Ping_clone(this.ptr); const ret_hu_conv: Ping = new Ping(null, ret); @@ -324,12 +347,18 @@ export class Ping extends CommonBase { return ret_hu_conv; } + /** + * Serialize the Ping object into a byte array which can be read by Ping_read + */ public write(): Uint8Array { const ret: number = bindings.Ping_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a Ping from a byte array, created by Ping_write + */ public static constructor_read(ser: Uint8Array): Result_PingDecodeErrorZ { const ret: number = bindings.Ping_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_PingDecodeErrorZ = Result_PingDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Pong.mts b/ts/structs/Pong.mts index 79e3babd..34a8d79e 100644 --- a/ts/structs/Pong.mts +++ b/ts/structs/Pong.mts @@ -281,21 +281,35 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A pong message to be sent or received from a peer + */ export class Pong extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.Pong_free); } + /** + * The pong packet size. + * This field is not sent on the wire. byteslen zeros are sent. + */ public get_byteslen(): number { const ret: number = bindings.Pong_get_byteslen(this.ptr); return ret; } + /** + * The pong packet size. + * This field is not sent on the wire. byteslen zeros are sent. + */ public set_byteslen(val: number): void { bindings.Pong_set_byteslen(this.ptr, val); } + /** + * Constructs a new Pong given each field + */ public static constructor_new(byteslen_arg: number): Pong { const ret: number = bindings.Pong_new(byteslen_arg); const ret_hu_conv: Pong = new Pong(null, ret); @@ -308,6 +322,9 @@ export class Pong extends CommonBase { return ret; } + /** + * Creates a copy of the Pong + */ public clone(): Pong { const ret: number = bindings.Pong_clone(this.ptr); const ret_hu_conv: Pong = new Pong(null, ret); @@ -315,12 +332,18 @@ export class Pong extends CommonBase { return ret_hu_conv; } + /** + * Serialize the Pong object into a byte array which can be read by Pong_read + */ public write(): Uint8Array { const ret: number = bindings.Pong_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a Pong from a byte array, created by Pong_write + */ public static constructor_read(ser: Uint8Array): Result_PongDecodeErrorZ { const ret: number = bindings.Pong_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_PongDecodeErrorZ = Result_PongDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/QueryChannelRange.mts b/ts/structs/QueryChannelRange.mts index e069f694..4f03dcce 100644 --- a/ts/structs/QueryChannelRange.mts +++ b/ts/structs/QueryChannelRange.mts @@ -281,40 +281,67 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A query_channel_range message is used to query a peer for channel + * UTXOs in a range of blocks. The recipient of a query makes a best + * effort to reply to the query using one or more reply_channel_range + * messages. + */ export class QueryChannelRange extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.QueryChannelRange_free); } + /** + * The genesis hash of the blockchain being queried + */ public get_chain_hash(): Uint8Array { const ret: number = bindings.QueryChannelRange_get_chain_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The genesis hash of the blockchain being queried + */ public set_chain_hash(val: Uint8Array): void { bindings.QueryChannelRange_set_chain_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The height of the first block for the channel UTXOs being queried + */ public get_first_blocknum(): number { const ret: number = bindings.QueryChannelRange_get_first_blocknum(this.ptr); return ret; } + /** + * The height of the first block for the channel UTXOs being queried + */ public set_first_blocknum(val: number): void { bindings.QueryChannelRange_set_first_blocknum(this.ptr, val); } + /** + * The number of blocks to include in the query results + */ public get_number_of_blocks(): number { const ret: number = bindings.QueryChannelRange_get_number_of_blocks(this.ptr); return ret; } + /** + * The number of blocks to include in the query results + */ public set_number_of_blocks(val: number): void { bindings.QueryChannelRange_set_number_of_blocks(this.ptr, val); } + /** + * Constructs a new QueryChannelRange given each field + */ public static constructor_new(chain_hash_arg: Uint8Array, first_blocknum_arg: number, number_of_blocks_arg: number): QueryChannelRange { const ret: number = bindings.QueryChannelRange_new(bindings.encodeUint8Array(bindings.check_arr_len(chain_hash_arg, 32)), first_blocknum_arg, number_of_blocks_arg); const ret_hu_conv: QueryChannelRange = new QueryChannelRange(null, ret); @@ -327,6 +354,9 @@ export class QueryChannelRange extends CommonBase { return ret; } + /** + * Creates a copy of the QueryChannelRange + */ public clone(): QueryChannelRange { const ret: number = bindings.QueryChannelRange_clone(this.ptr); const ret_hu_conv: QueryChannelRange = new QueryChannelRange(null, ret); @@ -334,17 +364,26 @@ export class QueryChannelRange extends CommonBase { return ret_hu_conv; } + /** + * \n\t * Calculates the overflow safe ending block height for the query.\n\t * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`\n\t + */ public end_blocknum(): number { const ret: number = bindings.QueryChannelRange_end_blocknum(this.ptr); return ret; } + /** + * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read + */ public write(): Uint8Array { const ret: number = bindings.QueryChannelRange_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write + */ public static constructor_read(ser: Uint8Array): Result_QueryChannelRangeDecodeErrorZ { const ret: number = bindings.QueryChannelRange_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_QueryChannelRangeDecodeErrorZ = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/QueryShortChannelIds.mts b/ts/structs/QueryShortChannelIds.mts index 45c16570..b7ec2286 100644 --- a/ts/structs/QueryShortChannelIds.mts +++ b/ts/structs/QueryShortChannelIds.mts @@ -281,26 +281,48 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A query_short_channel_ids message is used to query a peer for + * routing gossip messages related to one or more short_channel_ids. + * The query recipient will reply with the latest, if available, + * channel_announcement, channel_update and node_announcement messages + * it maintains for the requested short_channel_ids followed by a + * reply_short_channel_ids_end message. The short_channel_ids sent in + * this query are encoded. We only support encoding_type=0 uncompressed + * serialization and do not support encoding_type=1 zlib serialization. + */ export class QueryShortChannelIds extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.QueryShortChannelIds_free); } + /** + * The genesis hash of the blockchain being queried + */ public get_chain_hash(): Uint8Array { const ret: number = bindings.QueryShortChannelIds_get_chain_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The genesis hash of the blockchain being queried + */ public set_chain_hash(val: Uint8Array): void { bindings.QueryShortChannelIds_set_chain_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The short_channel_ids that are being queried + */ public set_short_channel_ids(val: bigint[]): void { bindings.QueryShortChannelIds_set_short_channel_ids(this.ptr, bindings.encodeUint64Array(val)); } + /** + * Constructs a new QueryShortChannelIds given each field + */ public static constructor_new(chain_hash_arg: Uint8Array, short_channel_ids_arg: bigint[]): QueryShortChannelIds { const ret: number = bindings.QueryShortChannelIds_new(bindings.encodeUint8Array(bindings.check_arr_len(chain_hash_arg, 32)), bindings.encodeUint64Array(short_channel_ids_arg)); const ret_hu_conv: QueryShortChannelIds = new QueryShortChannelIds(null, ret); @@ -313,6 +335,9 @@ export class QueryShortChannelIds extends CommonBase { return ret; } + /** + * Creates a copy of the QueryShortChannelIds + */ public clone(): QueryShortChannelIds { const ret: number = bindings.QueryShortChannelIds_clone(this.ptr); const ret_hu_conv: QueryShortChannelIds = new QueryShortChannelIds(null, ret); @@ -320,12 +345,18 @@ export class QueryShortChannelIds extends CommonBase { return ret_hu_conv; } + /** + * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write + */ public static constructor_read(ser: Uint8Array): Result_QueryShortChannelIdsDecodeErrorZ { const ret: number = bindings.QueryShortChannelIds_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_QueryShortChannelIdsDecodeErrorZ = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read + */ public write(): Uint8Array { const ret: number = bindings.QueryShortChannelIds_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); diff --git a/ts/structs/ReadOnlyNetworkGraph.mts b/ts/structs/ReadOnlyNetworkGraph.mts index 314c9a8f..193c883d 100644 --- a/ts/structs/ReadOnlyNetworkGraph.mts +++ b/ts/structs/ReadOnlyNetworkGraph.mts @@ -281,12 +281,20 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A read-only view of [`NetworkGraph`]. + */ export class ReadOnlyNetworkGraph extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ReadOnlyNetworkGraph_free); } + /** + * Get network addresses by node id. + * Returns None if the requested node is completely unknown, + * or if node announcement for the node was never received. + */ public get_addresses(pubkey: Uint8Array): Option_CVec_NetAddressZZ { const ret: number = bindings.ReadOnlyNetworkGraph_get_addresses(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(pubkey, 33))); const ret_hu_conv: Option_CVec_NetAddressZZ = Option_CVec_NetAddressZZ.constr_from_ptr(ret); diff --git a/ts/structs/Record.mts b/ts/structs/Record.mts index d0e8e840..ed70969c 100644 --- a/ts/structs/Record.mts +++ b/ts/structs/Record.mts @@ -281,56 +281,90 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Record, unit of logging output with Metadata to enable filtering + * Module_path, file, line to inform on log's source + */ export class Record extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.Record_free); } + /** + * The verbosity level of the message. + */ public get_level(): Level { const ret: Level = bindings.Record_get_level(this.ptr); return ret; } + /** + * The verbosity level of the message. + */ public set_level(val: Level): void { bindings.Record_set_level(this.ptr, val); } + /** + * The message body. + */ public get_args(): string { const ret: number = bindings.Record_get_args(this.ptr); const ret_conv: string = bindings.decodeString(ret); return ret_conv; } + /** + * The message body. + */ public set_args(val: string): void { bindings.Record_set_args(this.ptr, bindings.encodeString(val)); } + /** + * The module path of the message. + */ public get_module_path(): string { const ret: number = bindings.Record_get_module_path(this.ptr); const ret_conv: string = bindings.decodeString(ret); return ret_conv; } + /** + * The module path of the message. + */ public set_module_path(val: string): void { bindings.Record_set_module_path(this.ptr, bindings.encodeString(val)); } + /** + * The source file containing the message. + */ public get_file(): string { const ret: number = bindings.Record_get_file(this.ptr); const ret_conv: string = bindings.decodeString(ret); return ret_conv; } + /** + * The source file containing the message. + */ public set_file(val: string): void { bindings.Record_set_file(this.ptr, bindings.encodeString(val)); } + /** + * The line containing the message. + */ public get_line(): number { const ret: number = bindings.Record_get_line(this.ptr); return ret; } + /** + * The line containing the message. + */ public set_line(val: number): void { bindings.Record_set_line(this.ptr, val); } @@ -340,6 +374,9 @@ export class Record extends CommonBase { return ret; } + /** + * Creates a copy of the Record + */ public clone(): Record { const ret: number = bindings.Record_clone(this.ptr); const ret_hu_conv: Record = new Record(null, ret); diff --git a/ts/structs/ReplyChannelRange.mts b/ts/structs/ReplyChannelRange.mts index 18ad70d2..9815fbcb 100644 --- a/ts/structs/ReplyChannelRange.mts +++ b/ts/structs/ReplyChannelRange.mts @@ -281,53 +281,92 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A reply_channel_range message is a reply to a query_channel_range + * message. Multiple reply_channel_range messages can be sent in reply + * to a single query_channel_range message. The query recipient makes a + * best effort to respond based on their local network view which may + * not be a perfect view of the network. The short_channel_ids in the + * reply are encoded. We only support encoding_type=0 uncompressed + * serialization and do not support encoding_type=1 zlib serialization. + */ export class ReplyChannelRange extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ReplyChannelRange_free); } + /** + * The genesis hash of the blockchain being queried + */ public get_chain_hash(): Uint8Array { const ret: number = bindings.ReplyChannelRange_get_chain_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The genesis hash of the blockchain being queried + */ public set_chain_hash(val: Uint8Array): void { bindings.ReplyChannelRange_set_chain_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The height of the first block in the range of the reply + */ public get_first_blocknum(): number { const ret: number = bindings.ReplyChannelRange_get_first_blocknum(this.ptr); return ret; } + /** + * The height of the first block in the range of the reply + */ public set_first_blocknum(val: number): void { bindings.ReplyChannelRange_set_first_blocknum(this.ptr, val); } + /** + * The number of blocks included in the range of the reply + */ public get_number_of_blocks(): number { const ret: number = bindings.ReplyChannelRange_get_number_of_blocks(this.ptr); return ret; } + /** + * The number of blocks included in the range of the reply + */ public set_number_of_blocks(val: number): void { bindings.ReplyChannelRange_set_number_of_blocks(this.ptr, val); } + /** + * True when this is the final reply for a query + */ public get_sync_complete(): boolean { const ret: boolean = bindings.ReplyChannelRange_get_sync_complete(this.ptr); return ret; } + /** + * True when this is the final reply for a query + */ public set_sync_complete(val: boolean): void { bindings.ReplyChannelRange_set_sync_complete(this.ptr, val); } + /** + * The short_channel_ids in the channel range + */ public set_short_channel_ids(val: bigint[]): void { bindings.ReplyChannelRange_set_short_channel_ids(this.ptr, bindings.encodeUint64Array(val)); } + /** + * Constructs a new ReplyChannelRange given each field + */ public static constructor_new(chain_hash_arg: Uint8Array, first_blocknum_arg: number, number_of_blocks_arg: number, sync_complete_arg: boolean, short_channel_ids_arg: bigint[]): ReplyChannelRange { const ret: number = bindings.ReplyChannelRange_new(bindings.encodeUint8Array(bindings.check_arr_len(chain_hash_arg, 32)), first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, bindings.encodeUint64Array(short_channel_ids_arg)); const ret_hu_conv: ReplyChannelRange = new ReplyChannelRange(null, ret); @@ -340,6 +379,9 @@ export class ReplyChannelRange extends CommonBase { return ret; } + /** + * Creates a copy of the ReplyChannelRange + */ public clone(): ReplyChannelRange { const ret: number = bindings.ReplyChannelRange_clone(this.ptr); const ret_hu_conv: ReplyChannelRange = new ReplyChannelRange(null, ret); @@ -347,12 +389,18 @@ export class ReplyChannelRange extends CommonBase { return ret_hu_conv; } + /** + * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write + */ public static constructor_read(ser: Uint8Array): Result_ReplyChannelRangeDecodeErrorZ { const ret: number = bindings.ReplyChannelRange_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ReplyChannelRangeDecodeErrorZ = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read + */ public write(): Uint8Array { const ret: number = bindings.ReplyChannelRange_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); diff --git a/ts/structs/ReplyShortChannelIdsEnd.mts b/ts/structs/ReplyShortChannelIdsEnd.mts index 0e2dc3d8..41b98288 100644 --- a/ts/structs/ReplyShortChannelIdsEnd.mts +++ b/ts/structs/ReplyShortChannelIdsEnd.mts @@ -281,31 +281,54 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A reply_short_channel_ids_end message is sent as a reply to a + * query_short_channel_ids message. The query recipient makes a best + * effort to respond based on their local network view which may not be + * a perfect view of the network. + */ export class ReplyShortChannelIdsEnd extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ReplyShortChannelIdsEnd_free); } + /** + * The genesis hash of the blockchain that was queried + */ public get_chain_hash(): Uint8Array { const ret: number = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The genesis hash of the blockchain that was queried + */ public set_chain_hash(val: Uint8Array): void { bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Indicates if the query recipient maintains up-to-date channel + * information for the chain_hash + */ public get_full_information(): boolean { const ret: boolean = bindings.ReplyShortChannelIdsEnd_get_full_information(this.ptr); return ret; } + /** + * Indicates if the query recipient maintains up-to-date channel + * information for the chain_hash + */ public set_full_information(val: boolean): void { bindings.ReplyShortChannelIdsEnd_set_full_information(this.ptr, val); } + /** + * Constructs a new ReplyShortChannelIdsEnd given each field + */ public static constructor_new(chain_hash_arg: Uint8Array, full_information_arg: boolean): ReplyShortChannelIdsEnd { const ret: number = bindings.ReplyShortChannelIdsEnd_new(bindings.encodeUint8Array(bindings.check_arr_len(chain_hash_arg, 32)), full_information_arg); const ret_hu_conv: ReplyShortChannelIdsEnd = new ReplyShortChannelIdsEnd(null, ret); @@ -318,6 +341,9 @@ export class ReplyShortChannelIdsEnd extends CommonBase { return ret; } + /** + * Creates a copy of the ReplyShortChannelIdsEnd + */ public clone(): ReplyShortChannelIdsEnd { const ret: number = bindings.ReplyShortChannelIdsEnd_clone(this.ptr); const ret_hu_conv: ReplyShortChannelIdsEnd = new ReplyShortChannelIdsEnd(null, ret); @@ -325,12 +351,18 @@ export class ReplyShortChannelIdsEnd extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read + */ public write(): Uint8Array { const ret: number = bindings.ReplyShortChannelIdsEnd_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write + */ public static constructor_read(ser: Uint8Array): Result_ReplyShortChannelIdsEndDecodeErrorZ { const ret: number = bindings.ReplyShortChannelIdsEnd_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ReplyShortChannelIdsEndDecodeErrorZ = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_AcceptChannelDecodeErrorZ.mts b/ts/structs/Result_AcceptChannelDecodeErrorZ.mts index 6e3b0851..f6814600 100644 --- a/ts/structs/Result_AcceptChannelDecodeErrorZ.mts +++ b/ts/structs/Result_AcceptChannelDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_AcceptChannelDecodeErrorZ extends CommonBase { return new Result_AcceptChannelDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state. + */ public static constructor_ok(o: AcceptChannel): Result_AcceptChannelDecodeErrorZ { const ret: number = bindings.CResult_AcceptChannelDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_AcceptChannelDecodeErrorZ = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_AcceptChannelDecodeErrorZ { const ret: number = bindings.CResult_AcceptChannelDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_AcceptChannelDecodeErrorZ = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_AcceptChannelDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_AcceptChannelDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_AcceptChannelDecodeErrorZ { const ret: number = bindings.CResult_AcceptChannelDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_AcceptChannelDecodeErrorZ = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.mts b/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.mts index 51035a00..31eff1cc 100644 --- a/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.mts +++ b/ts/structs/Result_AnnouncementSignaturesDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { return new Result_AnnouncementSignaturesDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state. + */ public static constructor_ok(o: AnnouncementSignatures): Result_AnnouncementSignaturesDecodeErrorZ { const ret: number = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_AnnouncementSignaturesDecodeErrorZ = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_AnnouncementSignaturesDecodeErrorZ { const ret: number = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_AnnouncementSignaturesDecodeErrorZ = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_AnnouncementSignaturesDecodeErrorZ { const ret: number = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_AnnouncementSignaturesDecodeErrorZ = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.mts b/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.mts index 50bd0d9d..cd0f2f75 100644 --- a/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.mts +++ b/ts/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { return new Result_BuiltCommitmentTransactionDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state. + */ public static constructor_ok(o: BuiltCommitmentTransaction): Result_BuiltCommitmentTransactionDecodeErrorZ { const ret: number = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_BuiltCommitmentTransactionDecodeErrorZ = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_BuiltCommitmentTransactionDecodeErrorZ { const ret: number = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_BuiltCommitmentTransactionDecodeErrorZ = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_BuiltCommitmentTransactionDecodeErrorZ { const ret: number = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_BuiltCommitmentTransactionDecodeErrorZ = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.mts b/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.mts index d2c9a04e..d3a175b2 100644 --- a/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.mts +++ b/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB return new Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state. + */ public static constructor_ok(o: TwoTuple_BlockHashChannelManagerZ): Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { const ret: number = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o != null ? CommonBase.get_ptr_of(o) : 0); const ret_hu_conv: Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { const ret: number = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.mts b/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.mts index 1f65f757..3f911ebf 100644 --- a/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.mts +++ b/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB return new Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state. + */ public static constructor_ok(o: TwoTuple_BlockHashChannelMonitorZ): Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { const ret: number = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o != null ? CommonBase.get_ptr_of(o) : 0); const ret_hu_conv: Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { const ret: number = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB return ret; } + /** + * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { const ret: number = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.mts b/ts/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.mts index cc362b5a..3be24148 100644 --- a/ts/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.mts +++ b/ts/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.mts @@ -294,18 +294,27 @@ export class Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ extends Com return new Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_Err(null, ptr); } } + /** + * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state. + */ public static constructor_ok(o: TwoTuple_PaymentHashPaymentIdZ): Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ { const ret: number = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o != null ? CommonBase.get_ptr_of(o) : 0); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state. + */ public static constructor_err(e: PaymentSendFailure): Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ { const ret: number = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(CommonBase.get_ptr_of(e)); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ extends Com return ret; } + /** + * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ { const ret: number = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(this.ptr); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.mts b/ts/structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.mts index 46ec7f88..15076dce 100644 --- a/ts/structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.mts +++ b/ts/structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.mts @@ -294,18 +294,27 @@ export class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ extends CommonBas return new Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state. + */ public static constructor_ok(o: TwoTuple_PaymentHashPaymentSecretZ): Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ { const ret: number = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o != null ? CommonBase.get_ptr_of(o) : 0); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state. + */ public static constructor_err(e: APIError): Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ { const ret: number = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(CommonBase.get_ptr_of(e)); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ extends CommonBas return ret; } + /** + * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ { const ret: number = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(this.ptr); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ = Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.mts b/ts/structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.mts index 1066e8ce..3693146b 100644 --- a/ts/structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.mts +++ b/ts/structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.mts @@ -294,18 +294,27 @@ export class Result_C2Tuple_PaymentHashPaymentSecretZNoneZ extends CommonBase { return new Result_C2Tuple_PaymentHashPaymentSecretZNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state. + */ public static constructor_ok(o: TwoTuple_PaymentHashPaymentSecretZ): Result_C2Tuple_PaymentHashPaymentSecretZNoneZ { const ret: number = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o != null ? CommonBase.get_ptr_of(o) : 0); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentSecretZNoneZ = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state. + */ public static constructor_err(): Result_C2Tuple_PaymentHashPaymentSecretZNoneZ { const ret: number = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentSecretZNoneZ = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_C2Tuple_PaymentHashPaymentSecretZNoneZ extends CommonBase { return ret; } + /** + * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_C2Tuple_PaymentHashPaymentSecretZNoneZ { const ret: number = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(this.ptr); const ret_hu_conv: Result_C2Tuple_PaymentHashPaymentSecretZNoneZ = Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mts b/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mts index a7a8f09e..cce4b9f6 100644 --- a/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mts +++ b/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mts @@ -294,18 +294,27 @@ export class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { return new Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state. + */ public static constructor_ok(o: TwoTuple_SignatureCVec_SignatureZZ): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ { const ret: number = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o != null ? CommonBase.get_ptr_of(o) : 0); const ret_hu_conv: Result_C2Tuple_SignatureCVec_SignatureZZNoneZ = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state. + */ public static constructor_err(): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ { const ret: number = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); const ret_hu_conv: Result_C2Tuple_SignatureCVec_SignatureZZNoneZ = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { return ret; } + /** + * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ { const ret: number = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(this.ptr); const ret_hu_conv: Result_C2Tuple_SignatureCVec_SignatureZZNoneZ = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_COption_ClosureReasonZDecodeErrorZ.mts b/ts/structs/Result_COption_ClosureReasonZDecodeErrorZ.mts index 9cd0f7b3..e6ed2974 100644 --- a/ts/structs/Result_COption_ClosureReasonZDecodeErrorZ.mts +++ b/ts/structs/Result_COption_ClosureReasonZDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_COption_ClosureReasonZDecodeErrorZ extends CommonBase { return new Result_COption_ClosureReasonZDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state. + */ public static constructor_ok(o: Option_ClosureReasonZ): Result_COption_ClosureReasonZDecodeErrorZ { const ret: number = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_ok(CommonBase.get_ptr_of(o)); const ret_hu_conv: Result_COption_ClosureReasonZDecodeErrorZ = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_COption_ClosureReasonZDecodeErrorZ { const ret: number = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_COption_ClosureReasonZDecodeErrorZ = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_COption_ClosureReasonZDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_COption_ClosureReasonZDecodeErrorZ { const ret: number = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_COption_ClosureReasonZDecodeErrorZ = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_COption_EventZDecodeErrorZ.mts b/ts/structs/Result_COption_EventZDecodeErrorZ.mts index 69ba7535..61a9846d 100644 --- a/ts/structs/Result_COption_EventZDecodeErrorZ.mts +++ b/ts/structs/Result_COption_EventZDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_COption_EventZDecodeErrorZ extends CommonBase { return new Result_COption_EventZDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_COption_EventZDecodeErrorZ in the success state. + */ public static constructor_ok(o: Option_EventZ): Result_COption_EventZDecodeErrorZ { const ret: number = bindings.CResult_COption_EventZDecodeErrorZ_ok(CommonBase.get_ptr_of(o)); const ret_hu_conv: Result_COption_EventZDecodeErrorZ = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_COption_EventZDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_COption_EventZDecodeErrorZ { const ret: number = bindings.CResult_COption_EventZDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_COption_EventZDecodeErrorZ = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_COption_EventZDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_COption_EventZDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_COption_EventZDecodeErrorZ { const ret: number = bindings.CResult_COption_EventZDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_COption_EventZDecodeErrorZ = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_COption_MonitorEventZDecodeErrorZ.mts b/ts/structs/Result_COption_MonitorEventZDecodeErrorZ.mts index 901bba8b..54b64f06 100644 --- a/ts/structs/Result_COption_MonitorEventZDecodeErrorZ.mts +++ b/ts/structs/Result_COption_MonitorEventZDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_COption_MonitorEventZDecodeErrorZ extends CommonBase { return new Result_COption_MonitorEventZDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state. + */ public static constructor_ok(o: Option_MonitorEventZ): Result_COption_MonitorEventZDecodeErrorZ { const ret: number = bindings.CResult_COption_MonitorEventZDecodeErrorZ_ok(CommonBase.get_ptr_of(o)); const ret_hu_conv: Result_COption_MonitorEventZDecodeErrorZ = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_COption_MonitorEventZDecodeErrorZ { const ret: number = bindings.CResult_COption_MonitorEventZDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_COption_MonitorEventZDecodeErrorZ = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_COption_MonitorEventZDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_COption_MonitorEventZDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_COption_MonitorEventZDecodeErrorZ { const ret: number = bindings.CResult_COption_MonitorEventZDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_COption_MonitorEventZDecodeErrorZ = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_COption_NetworkUpdateZDecodeErrorZ.mts b/ts/structs/Result_COption_NetworkUpdateZDecodeErrorZ.mts index 07ca4867..cc769415 100644 --- a/ts/structs/Result_COption_NetworkUpdateZDecodeErrorZ.mts +++ b/ts/structs/Result_COption_NetworkUpdateZDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_COption_NetworkUpdateZDecodeErrorZ extends CommonBase { return new Result_COption_NetworkUpdateZDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state. + */ public static constructor_ok(o: Option_NetworkUpdateZ): Result_COption_NetworkUpdateZDecodeErrorZ { const ret: number = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_ok(CommonBase.get_ptr_of(o)); const ret_hu_conv: Result_COption_NetworkUpdateZDecodeErrorZ = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_COption_NetworkUpdateZDecodeErrorZ { const ret: number = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_COption_NetworkUpdateZDecodeErrorZ = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_COption_NetworkUpdateZDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_COption_NetworkUpdateZDecodeErrorZ { const ret: number = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_COption_NetworkUpdateZDecodeErrorZ = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_COption_TypeZDecodeErrorZ.mts b/ts/structs/Result_COption_TypeZDecodeErrorZ.mts index ae0b6316..0bc5b243 100644 --- a/ts/structs/Result_COption_TypeZDecodeErrorZ.mts +++ b/ts/structs/Result_COption_TypeZDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_COption_TypeZDecodeErrorZ extends CommonBase { return new Result_COption_TypeZDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state. + */ public static constructor_ok(o: Option_TypeZ): Result_COption_TypeZDecodeErrorZ { const ret: number = bindings.CResult_COption_TypeZDecodeErrorZ_ok(CommonBase.get_ptr_of(o)); const ret_hu_conv: Result_COption_TypeZDecodeErrorZ = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_COption_TypeZDecodeErrorZ { const ret: number = bindings.CResult_COption_TypeZDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_COption_TypeZDecodeErrorZ = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_COption_TypeZDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_COption_TypeZDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_COption_TypeZDecodeErrorZ { const ret: number = bindings.CResult_COption_TypeZDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_COption_TypeZDecodeErrorZ = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_CVec_CVec_u8ZZNoneZ.mts b/ts/structs/Result_CVec_CVec_u8ZZNoneZ.mts index 5596dfe3..e9614460 100644 --- a/ts/structs/Result_CVec_CVec_u8ZZNoneZ.mts +++ b/ts/structs/Result_CVec_CVec_u8ZZNoneZ.mts @@ -294,18 +294,27 @@ export class Result_CVec_CVec_u8ZZNoneZ extends CommonBase { return new Result_CVec_CVec_u8ZZNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state. + */ public static constructor_ok(o: Uint8Array[]): Result_CVec_CVec_u8ZZNoneZ { const ret: number = bindings.CResult_CVec_CVec_u8ZZNoneZ_ok(bindings.encodeUint32Array(o != null ? o.map(o_conv_12 => bindings.encodeUint8Array(o_conv_12)) : null)); const ret_hu_conv: Result_CVec_CVec_u8ZZNoneZ = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state. + */ public static constructor_err(): Result_CVec_CVec_u8ZZNoneZ { const ret: number = bindings.CResult_CVec_CVec_u8ZZNoneZ_err(); const ret_hu_conv: Result_CVec_CVec_u8ZZNoneZ = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_CVec_CVec_u8ZZNoneZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_CVec_CVec_u8ZZNoneZ extends CommonBase { return ret; } + /** + * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_CVec_CVec_u8ZZNoneZ { const ret: number = bindings.CResult_CVec_CVec_u8ZZNoneZ_clone(this.ptr); const ret_hu_conv: Result_CVec_CVec_u8ZZNoneZ = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret); @@ -337,6 +350,7 @@ export class Result_CVec_CVec_u8ZZNoneZ_OK extends Result_CVec_CVec_u8ZZNoneZ { const res_conv_12_conv: Uint8Array = bindings.decodeUint8Array(res_conv_12); res_conv_12_arr[m] = res_conv_12_conv; } + bindings.freeWasmMemory(res) this.res = res_conv_12_arr; } } diff --git a/ts/structs/Result_CVec_SignatureZNoneZ.mts b/ts/structs/Result_CVec_SignatureZNoneZ.mts index ff6962d5..0924349d 100644 --- a/ts/structs/Result_CVec_SignatureZNoneZ.mts +++ b/ts/structs/Result_CVec_SignatureZNoneZ.mts @@ -294,18 +294,27 @@ export class Result_CVec_SignatureZNoneZ extends CommonBase { return new Result_CVec_SignatureZNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_CVec_SignatureZNoneZ in the success state. + */ public static constructor_ok(o: Uint8Array[]): Result_CVec_SignatureZNoneZ { const ret: number = bindings.CResult_CVec_SignatureZNoneZ_ok(bindings.encodeUint32Array(o != null ? o.map(o_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(o_conv_12, 64))) : null)); const ret_hu_conv: Result_CVec_SignatureZNoneZ = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_CVec_SignatureZNoneZ in the error state. + */ public static constructor_err(): Result_CVec_SignatureZNoneZ { const ret: number = bindings.CResult_CVec_SignatureZNoneZ_err(); const ret_hu_conv: Result_CVec_SignatureZNoneZ = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_CVec_SignatureZNoneZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_CVec_SignatureZNoneZ extends CommonBase { return ret; } + /** + * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_CVec_SignatureZNoneZ { const ret: number = bindings.CResult_CVec_SignatureZNoneZ_clone(this.ptr); const ret_hu_conv: Result_CVec_SignatureZNoneZ = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); @@ -337,6 +350,7 @@ export class Result_CVec_SignatureZNoneZ_OK extends Result_CVec_SignatureZNoneZ const res_conv_12_conv: Uint8Array = bindings.decodeUint8Array(res_conv_12); res_conv_12_arr[m] = res_conv_12_conv; } + bindings.freeWasmMemory(res) this.res = res_conv_12_arr; } } diff --git a/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.mts b/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.mts index a396df0d..3d39bab7 100644 --- a/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.mts +++ b/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.mts @@ -294,18 +294,27 @@ export class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { return new Result_CVec_u8ZPeerHandleErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state. + */ public static constructor_ok(o: Uint8Array): Result_CVec_u8ZPeerHandleErrorZ { const ret: number = bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(bindings.encodeUint8Array(o)); const ret_hu_conv: Result_CVec_u8ZPeerHandleErrorZ = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state. + */ public static constructor_err(e: PeerHandleError): Result_CVec_u8ZPeerHandleErrorZ { const ret: number = bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_CVec_u8ZPeerHandleErrorZ = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_CVec_u8ZPeerHandleErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_CVec_u8ZPeerHandleErrorZ { const ret: number = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone(this.ptr); const ret_hu_conv: Result_CVec_u8ZPeerHandleErrorZ = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.mts b/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.mts index 1ae42156..bf05c842 100644 --- a/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.mts +++ b/ts/structs/Result_ChannelAnnouncementDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { return new Result_ChannelAnnouncementDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state. + */ public static constructor_ok(o: ChannelAnnouncement): Result_ChannelAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ChannelAnnouncementDecodeErrorZ = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ChannelAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ChannelAnnouncementDecodeErrorZ = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ChannelAnnouncementDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ChannelAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_ChannelAnnouncementDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ChannelAnnouncementDecodeErrorZ = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelConfigDecodeErrorZ.mts b/ts/structs/Result_ChannelConfigDecodeErrorZ.mts index e2fed177..0cf6c572 100644 --- a/ts/structs/Result_ChannelConfigDecodeErrorZ.mts +++ b/ts/structs/Result_ChannelConfigDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ChannelConfigDecodeErrorZ extends CommonBase { return new Result_ChannelConfigDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state. + */ public static constructor_ok(o: ChannelConfig): Result_ChannelConfigDecodeErrorZ { const ret: number = bindings.CResult_ChannelConfigDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ChannelConfigDecodeErrorZ = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ChannelConfigDecodeErrorZ { const ret: number = bindings.CResult_ChannelConfigDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ChannelConfigDecodeErrorZ = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ChannelConfigDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ChannelConfigDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ChannelConfigDecodeErrorZ { const ret: number = bindings.CResult_ChannelConfigDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ChannelConfigDecodeErrorZ = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelFeaturesDecodeErrorZ.mts b/ts/structs/Result_ChannelFeaturesDecodeErrorZ.mts index 40b871d0..cfcae42e 100644 --- a/ts/structs/Result_ChannelFeaturesDecodeErrorZ.mts +++ b/ts/structs/Result_ChannelFeaturesDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { return new Result_ChannelFeaturesDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state. + */ public static constructor_ok(o: ChannelFeatures): Result_ChannelFeaturesDecodeErrorZ { const ret: number = bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ChannelFeaturesDecodeErrorZ = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ChannelFeaturesDecodeErrorZ { const ret: number = bindings.CResult_ChannelFeaturesDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ChannelFeaturesDecodeErrorZ = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ChannelFeaturesDecodeErrorZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_ChannelInfoDecodeErrorZ.mts b/ts/structs/Result_ChannelInfoDecodeErrorZ.mts index 5645ea22..4e1e4267 100644 --- a/ts/structs/Result_ChannelInfoDecodeErrorZ.mts +++ b/ts/structs/Result_ChannelInfoDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ChannelInfoDecodeErrorZ extends CommonBase { return new Result_ChannelInfoDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state. + */ public static constructor_ok(o: ChannelInfo): Result_ChannelInfoDecodeErrorZ { const ret: number = bindings.CResult_ChannelInfoDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ChannelInfoDecodeErrorZ = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ChannelInfoDecodeErrorZ { const ret: number = bindings.CResult_ChannelInfoDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ChannelInfoDecodeErrorZ = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ChannelInfoDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ChannelInfoDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ChannelInfoDecodeErrorZ { const ret: number = bindings.CResult_ChannelInfoDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ChannelInfoDecodeErrorZ = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.mts b/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.mts index dd7ecd14..881cb1f8 100644 --- a/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.mts +++ b/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { return new Result_ChannelMonitorUpdateDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state. + */ public static constructor_ok(o: ChannelMonitorUpdate): Result_ChannelMonitorUpdateDecodeErrorZ { const ret: number = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ChannelMonitorUpdateDecodeErrorZ = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ChannelMonitorUpdateDecodeErrorZ { const ret: number = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ChannelMonitorUpdateDecodeErrorZ = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ChannelMonitorUpdateDecodeErrorZ { const ret: number = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ChannelMonitorUpdateDecodeErrorZ = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.mts b/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.mts index e83e5003..07e5ee2c 100644 --- a/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.mts +++ b/ts/structs/Result_ChannelPublicKeysDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { return new Result_ChannelPublicKeysDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state. + */ public static constructor_ok(o: ChannelPublicKeys): Result_ChannelPublicKeysDecodeErrorZ { const ret: number = bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ChannelPublicKeysDecodeErrorZ = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ChannelPublicKeysDecodeErrorZ { const ret: number = bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ChannelPublicKeysDecodeErrorZ = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ChannelPublicKeysDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ChannelPublicKeysDecodeErrorZ { const ret: number = bindings.CResult_ChannelPublicKeysDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ChannelPublicKeysDecodeErrorZ = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelReestablishDecodeErrorZ.mts b/ts/structs/Result_ChannelReestablishDecodeErrorZ.mts index 6a391610..ff4efd9c 100644 --- a/ts/structs/Result_ChannelReestablishDecodeErrorZ.mts +++ b/ts/structs/Result_ChannelReestablishDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ChannelReestablishDecodeErrorZ extends CommonBase { return new Result_ChannelReestablishDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state. + */ public static constructor_ok(o: ChannelReestablish): Result_ChannelReestablishDecodeErrorZ { const ret: number = bindings.CResult_ChannelReestablishDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ChannelReestablishDecodeErrorZ = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ChannelReestablishDecodeErrorZ { const ret: number = bindings.CResult_ChannelReestablishDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ChannelReestablishDecodeErrorZ = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ChannelReestablishDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ChannelReestablishDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ChannelReestablishDecodeErrorZ { const ret: number = bindings.CResult_ChannelReestablishDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ChannelReestablishDecodeErrorZ = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.mts b/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.mts index f6f4ca38..f6cabddc 100644 --- a/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.mts +++ b/ts/structs/Result_ChannelTransactionParametersDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase return new Result_ChannelTransactionParametersDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state. + */ public static constructor_ok(o: ChannelTransactionParameters): Result_ChannelTransactionParametersDecodeErrorZ { const ret: number = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ChannelTransactionParametersDecodeErrorZ = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ChannelTransactionParametersDecodeErrorZ { const ret: number = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ChannelTransactionParametersDecodeErrorZ = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase return ret; } + /** + * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ChannelTransactionParametersDecodeErrorZ { const ret: number = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ChannelTransactionParametersDecodeErrorZ = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ChannelTypeFeaturesDecodeErrorZ.mts b/ts/structs/Result_ChannelTypeFeaturesDecodeErrorZ.mts index 628586d6..7e7df96c 100644 --- a/ts/structs/Result_ChannelTypeFeaturesDecodeErrorZ.mts +++ b/ts/structs/Result_ChannelTypeFeaturesDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ChannelTypeFeaturesDecodeErrorZ extends CommonBase { return new Result_ChannelTypeFeaturesDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state. + */ public static constructor_ok(o: ChannelTypeFeatures): Result_ChannelTypeFeaturesDecodeErrorZ { const ret: number = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ChannelTypeFeaturesDecodeErrorZ = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ChannelTypeFeaturesDecodeErrorZ { const ret: number = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ChannelTypeFeaturesDecodeErrorZ = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_ChannelUpdateDecodeErrorZ.mts b/ts/structs/Result_ChannelUpdateDecodeErrorZ.mts index 151b8b7c..c1157b12 100644 --- a/ts/structs/Result_ChannelUpdateDecodeErrorZ.mts +++ b/ts/structs/Result_ChannelUpdateDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ChannelUpdateDecodeErrorZ extends CommonBase { return new Result_ChannelUpdateDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state. + */ public static constructor_ok(o: ChannelUpdate): Result_ChannelUpdateDecodeErrorZ { const ret: number = bindings.CResult_ChannelUpdateDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ChannelUpdateDecodeErrorZ = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ChannelUpdateDecodeErrorZ { const ret: number = bindings.CResult_ChannelUpdateDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ChannelUpdateDecodeErrorZ = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ChannelUpdateDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ChannelUpdateDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ChannelUpdateDecodeErrorZ { const ret: number = bindings.CResult_ChannelUpdateDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ChannelUpdateDecodeErrorZ = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ClosingSignedDecodeErrorZ.mts b/ts/structs/Result_ClosingSignedDecodeErrorZ.mts index 27def74f..c352344e 100644 --- a/ts/structs/Result_ClosingSignedDecodeErrorZ.mts +++ b/ts/structs/Result_ClosingSignedDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ClosingSignedDecodeErrorZ extends CommonBase { return new Result_ClosingSignedDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state. + */ public static constructor_ok(o: ClosingSigned): Result_ClosingSignedDecodeErrorZ { const ret: number = bindings.CResult_ClosingSignedDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ClosingSignedDecodeErrorZ = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ClosingSignedDecodeErrorZ { const ret: number = bindings.CResult_ClosingSignedDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ClosingSignedDecodeErrorZ = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ClosingSignedDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ClosingSignedDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ClosingSignedDecodeErrorZ { const ret: number = bindings.CResult_ClosingSignedDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ClosingSignedDecodeErrorZ = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mts b/ts/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mts index 6b7f52e7..bd3976ff 100644 --- a/ts/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mts +++ b/ts/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { return new Result_ClosingSignedFeeRangeDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state. + */ public static constructor_ok(o: ClosingSignedFeeRange): Result_ClosingSignedFeeRangeDecodeErrorZ { const ret: number = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ClosingSignedFeeRangeDecodeErrorZ = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ClosingSignedFeeRangeDecodeErrorZ { const ret: number = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ClosingSignedFeeRangeDecodeErrorZ = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ClosingSignedFeeRangeDecodeErrorZ { const ret: number = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ClosingSignedFeeRangeDecodeErrorZ = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_CommitmentSignedDecodeErrorZ.mts b/ts/structs/Result_CommitmentSignedDecodeErrorZ.mts index eba397e5..83482292 100644 --- a/ts/structs/Result_CommitmentSignedDecodeErrorZ.mts +++ b/ts/structs/Result_CommitmentSignedDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_CommitmentSignedDecodeErrorZ extends CommonBase { return new Result_CommitmentSignedDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state. + */ public static constructor_ok(o: CommitmentSigned): Result_CommitmentSignedDecodeErrorZ { const ret: number = bindings.CResult_CommitmentSignedDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_CommitmentSignedDecodeErrorZ = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_CommitmentSignedDecodeErrorZ { const ret: number = bindings.CResult_CommitmentSignedDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_CommitmentSignedDecodeErrorZ = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_CommitmentSignedDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_CommitmentSignedDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_CommitmentSignedDecodeErrorZ { const ret: number = bindings.CResult_CommitmentSignedDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_CommitmentSignedDecodeErrorZ = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_CommitmentTransactionDecodeErrorZ.mts b/ts/structs/Result_CommitmentTransactionDecodeErrorZ.mts index 61a011c2..b85b297a 100644 --- a/ts/structs/Result_CommitmentTransactionDecodeErrorZ.mts +++ b/ts/structs/Result_CommitmentTransactionDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { return new Result_CommitmentTransactionDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state. + */ public static constructor_ok(o: CommitmentTransaction): Result_CommitmentTransactionDecodeErrorZ { const ret: number = bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_CommitmentTransactionDecodeErrorZ = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_CommitmentTransactionDecodeErrorZ { const ret: number = bindings.CResult_CommitmentTransactionDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_CommitmentTransactionDecodeErrorZ = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_CommitmentTransactionDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_CommitmentTransactionDecodeErrorZ { const ret: number = bindings.CResult_CommitmentTransactionDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_CommitmentTransactionDecodeErrorZ = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mts b/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mts index 29c5e6c4..7ff3c43b 100644 --- a/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mts +++ b/ts/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends return new Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state. + */ public static constructor_ok(o: CounterpartyChannelTransactionParameters): Result_CounterpartyChannelTransactionParametersDecodeErrorZ { const ret: number = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_CounterpartyChannelTransactionParametersDecodeErrorZ = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_CounterpartyChannelTransactionParametersDecodeErrorZ { const ret: number = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_CounterpartyChannelTransactionParametersDecodeErrorZ = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends return ret; } + /** + * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_CounterpartyChannelTransactionParametersDecodeErrorZ { const ret: number = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_CounterpartyChannelTransactionParametersDecodeErrorZ = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mts b/ts/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mts index 70985fc8..dcaff8bb 100644 --- a/ts/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mts +++ b/ts/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas return new Result_DelayedPaymentOutputDescriptorDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state. + */ public static constructor_ok(o: DelayedPaymentOutputDescriptor): Result_DelayedPaymentOutputDescriptorDecodeErrorZ { const ret: number = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_DelayedPaymentOutputDescriptorDecodeErrorZ = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_DelayedPaymentOutputDescriptorDecodeErrorZ { const ret: number = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_DelayedPaymentOutputDescriptorDecodeErrorZ = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas return ret; } + /** + * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_DelayedPaymentOutputDescriptorDecodeErrorZ { const ret: number = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_DelayedPaymentOutputDescriptorDecodeErrorZ = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.mts b/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.mts index 919a59cf..04cbb0d3 100644 --- a/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.mts +++ b/ts/structs/Result_DirectionalChannelInfoDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase { return new Result_DirectionalChannelInfoDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the success state. + */ public static constructor_ok(o: DirectionalChannelInfo): Result_DirectionalChannelInfoDecodeErrorZ { const ret: number = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_DirectionalChannelInfoDecodeErrorZ = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_DirectionalChannelInfoDecodeErrorZ { const ret: number = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_DirectionalChannelInfoDecodeErrorZ = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_DirectionalChannelInfoDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_DirectionalChannelInfoDecodeErrorZ { const ret: number = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_DirectionalChannelInfoDecodeErrorZ = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ErrorMessageDecodeErrorZ.mts b/ts/structs/Result_ErrorMessageDecodeErrorZ.mts index 6254b47b..a30d6b1c 100644 --- a/ts/structs/Result_ErrorMessageDecodeErrorZ.mts +++ b/ts/structs/Result_ErrorMessageDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ErrorMessageDecodeErrorZ extends CommonBase { return new Result_ErrorMessageDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state. + */ public static constructor_ok(o: ErrorMessage): Result_ErrorMessageDecodeErrorZ { const ret: number = bindings.CResult_ErrorMessageDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ErrorMessageDecodeErrorZ = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ErrorMessageDecodeErrorZ { const ret: number = bindings.CResult_ErrorMessageDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ErrorMessageDecodeErrorZ = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ErrorMessageDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ErrorMessageDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ErrorMessageDecodeErrorZ { const ret: number = bindings.CResult_ErrorMessageDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ErrorMessageDecodeErrorZ = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_FundingCreatedDecodeErrorZ.mts b/ts/structs/Result_FundingCreatedDecodeErrorZ.mts index 81552e55..712cb8ae 100644 --- a/ts/structs/Result_FundingCreatedDecodeErrorZ.mts +++ b/ts/structs/Result_FundingCreatedDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_FundingCreatedDecodeErrorZ extends CommonBase { return new Result_FundingCreatedDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state. + */ public static constructor_ok(o: FundingCreated): Result_FundingCreatedDecodeErrorZ { const ret: number = bindings.CResult_FundingCreatedDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_FundingCreatedDecodeErrorZ = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_FundingCreatedDecodeErrorZ { const ret: number = bindings.CResult_FundingCreatedDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_FundingCreatedDecodeErrorZ = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_FundingCreatedDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_FundingCreatedDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_FundingCreatedDecodeErrorZ { const ret: number = bindings.CResult_FundingCreatedDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_FundingCreatedDecodeErrorZ = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_FundingLockedDecodeErrorZ.mts b/ts/structs/Result_FundingLockedDecodeErrorZ.mts index bfd74479..6532bddd 100644 --- a/ts/structs/Result_FundingLockedDecodeErrorZ.mts +++ b/ts/structs/Result_FundingLockedDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_FundingLockedDecodeErrorZ extends CommonBase { return new Result_FundingLockedDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_FundingLockedDecodeErrorZ in the success state. + */ public static constructor_ok(o: FundingLocked): Result_FundingLockedDecodeErrorZ { const ret: number = bindings.CResult_FundingLockedDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_FundingLockedDecodeErrorZ = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_FundingLockedDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_FundingLockedDecodeErrorZ { const ret: number = bindings.CResult_FundingLockedDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_FundingLockedDecodeErrorZ = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_FundingLockedDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_FundingLockedDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_FundingLockedDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_FundingLockedDecodeErrorZ { const ret: number = bindings.CResult_FundingLockedDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_FundingLockedDecodeErrorZ = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_FundingSignedDecodeErrorZ.mts b/ts/structs/Result_FundingSignedDecodeErrorZ.mts index 0d87db7c..061f5682 100644 --- a/ts/structs/Result_FundingSignedDecodeErrorZ.mts +++ b/ts/structs/Result_FundingSignedDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_FundingSignedDecodeErrorZ extends CommonBase { return new Result_FundingSignedDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_FundingSignedDecodeErrorZ in the success state. + */ public static constructor_ok(o: FundingSigned): Result_FundingSignedDecodeErrorZ { const ret: number = bindings.CResult_FundingSignedDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_FundingSignedDecodeErrorZ = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_FundingSignedDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_FundingSignedDecodeErrorZ { const ret: number = bindings.CResult_FundingSignedDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_FundingSignedDecodeErrorZ = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_FundingSignedDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_FundingSignedDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_FundingSignedDecodeErrorZ { const ret: number = bindings.CResult_FundingSignedDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_FundingSignedDecodeErrorZ = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.mts b/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.mts index 150b61d3..ce58300a 100644 --- a/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.mts +++ b/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { return new Result_GossipTimestampFilterDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state. + */ public static constructor_ok(o: GossipTimestampFilter): Result_GossipTimestampFilterDecodeErrorZ { const ret: number = bindings.CResult_GossipTimestampFilterDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_GossipTimestampFilterDecodeErrorZ = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_GossipTimestampFilterDecodeErrorZ { const ret: number = bindings.CResult_GossipTimestampFilterDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_GossipTimestampFilterDecodeErrorZ = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_GossipTimestampFilterDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_GossipTimestampFilterDecodeErrorZ { const ret: number = bindings.CResult_GossipTimestampFilterDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_GossipTimestampFilterDecodeErrorZ = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mts b/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mts index c5cd91db..9fbabb46 100644 --- a/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mts +++ b/ts/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { return new Result_HTLCOutputInCommitmentDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state. + */ public static constructor_ok(o: HTLCOutputInCommitment): Result_HTLCOutputInCommitmentDecodeErrorZ { const ret: number = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_HTLCOutputInCommitmentDecodeErrorZ = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_HTLCOutputInCommitmentDecodeErrorZ { const ret: number = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_HTLCOutputInCommitmentDecodeErrorZ = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_HTLCOutputInCommitmentDecodeErrorZ { const ret: number = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_HTLCOutputInCommitmentDecodeErrorZ = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_HTLCUpdateDecodeErrorZ.mts b/ts/structs/Result_HTLCUpdateDecodeErrorZ.mts index 4bd01f75..e4b922a2 100644 --- a/ts/structs/Result_HTLCUpdateDecodeErrorZ.mts +++ b/ts/structs/Result_HTLCUpdateDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_HTLCUpdateDecodeErrorZ extends CommonBase { return new Result_HTLCUpdateDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state. + */ public static constructor_ok(o: HTLCUpdate): Result_HTLCUpdateDecodeErrorZ { const ret: number = bindings.CResult_HTLCUpdateDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_HTLCUpdateDecodeErrorZ = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_HTLCUpdateDecodeErrorZ { const ret: number = bindings.CResult_HTLCUpdateDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_HTLCUpdateDecodeErrorZ = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_HTLCUpdateDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_HTLCUpdateDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_HTLCUpdateDecodeErrorZ { const ret: number = bindings.CResult_HTLCUpdateDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_HTLCUpdateDecodeErrorZ = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.mts b/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.mts index 6bfec6b1..fe589fb5 100644 --- a/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.mts +++ b/ts/structs/Result_HolderCommitmentTransactionDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { return new Result_HolderCommitmentTransactionDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state. + */ public static constructor_ok(o: HolderCommitmentTransaction): Result_HolderCommitmentTransactionDecodeErrorZ { const ret: number = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_HolderCommitmentTransactionDecodeErrorZ = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_HolderCommitmentTransactionDecodeErrorZ { const ret: number = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_HolderCommitmentTransactionDecodeErrorZ = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_HolderCommitmentTransactionDecodeErrorZ { const ret: number = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_HolderCommitmentTransactionDecodeErrorZ = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_InMemorySignerDecodeErrorZ.mts b/ts/structs/Result_InMemorySignerDecodeErrorZ.mts index 569ebf13..899e9858 100644 --- a/ts/structs/Result_InMemorySignerDecodeErrorZ.mts +++ b/ts/structs/Result_InMemorySignerDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_InMemorySignerDecodeErrorZ extends CommonBase { return new Result_InMemorySignerDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state. + */ public static constructor_ok(o: InMemorySigner): Result_InMemorySignerDecodeErrorZ { const ret: number = bindings.CResult_InMemorySignerDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_InMemorySignerDecodeErrorZ = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_InMemorySignerDecodeErrorZ { const ret: number = bindings.CResult_InMemorySignerDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_InMemorySignerDecodeErrorZ = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_InMemorySignerDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_InMemorySignerDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_InMemorySignerDecodeErrorZ { const ret: number = bindings.CResult_InMemorySignerDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_InMemorySignerDecodeErrorZ = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_InitDecodeErrorZ.mts b/ts/structs/Result_InitDecodeErrorZ.mts index 3daa0aab..8a06fc83 100644 --- a/ts/structs/Result_InitDecodeErrorZ.mts +++ b/ts/structs/Result_InitDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_InitDecodeErrorZ extends CommonBase { return new Result_InitDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_InitDecodeErrorZ in the success state. + */ public static constructor_ok(o: Init): Result_InitDecodeErrorZ { const ret: number = bindings.CResult_InitDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_InitDecodeErrorZ = Result_InitDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_InitDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_InitDecodeErrorZ { const ret: number = bindings.CResult_InitDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_InitDecodeErrorZ = Result_InitDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_InitDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_InitDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_InitDecodeErrorZ { const ret: number = bindings.CResult_InitDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_InitDecodeErrorZ = Result_InitDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_InitFeaturesDecodeErrorZ.mts b/ts/structs/Result_InitFeaturesDecodeErrorZ.mts index 69655e0d..2451400f 100644 --- a/ts/structs/Result_InitFeaturesDecodeErrorZ.mts +++ b/ts/structs/Result_InitFeaturesDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_InitFeaturesDecodeErrorZ extends CommonBase { return new Result_InitFeaturesDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state. + */ public static constructor_ok(o: InitFeatures): Result_InitFeaturesDecodeErrorZ { const ret: number = bindings.CResult_InitFeaturesDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_InitFeaturesDecodeErrorZ = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_InitFeaturesDecodeErrorZ { const ret: number = bindings.CResult_InitFeaturesDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_InitFeaturesDecodeErrorZ = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_InitFeaturesDecodeErrorZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.mts b/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.mts index 87c4aafe..c9e1dcd0 100644 --- a/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.mts +++ b/ts/structs/Result_InvoiceFeaturesDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { return new Result_InvoiceFeaturesDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state. + */ public static constructor_ok(o: InvoiceFeatures): Result_InvoiceFeaturesDecodeErrorZ { const ret: number = bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_InvoiceFeaturesDecodeErrorZ = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_InvoiceFeaturesDecodeErrorZ { const ret: number = bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_InvoiceFeaturesDecodeErrorZ = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_InvoiceFeaturesDecodeErrorZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_LockedChannelMonitorNoneZ.mts b/ts/structs/Result_LockedChannelMonitorNoneZ.mts index e4803585..8479b260 100644 --- a/ts/structs/Result_LockedChannelMonitorNoneZ.mts +++ b/ts/structs/Result_LockedChannelMonitorNoneZ.mts @@ -294,6 +294,9 @@ export class Result_LockedChannelMonitorNoneZ extends CommonBase { return new Result_LockedChannelMonitorNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_LockedChannelMonitorNoneZ in the success state. + */ public static constructor_ok(o: LockedChannelMonitor): Result_LockedChannelMonitorNoneZ { const ret: number = bindings.CResult_LockedChannelMonitorNoneZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_LockedChannelMonitorNoneZ = Result_LockedChannelMonitorNoneZ.constr_from_ptr(ret); @@ -309,12 +312,18 @@ export class Result_LockedChannelMonitorNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new CResult_LockedChannelMonitorNoneZ in the error state. + */ public static constructor_err(): Result_LockedChannelMonitorNoneZ { const ret: number = bindings.CResult_LockedChannelMonitorNoneZ_err(); const ret_hu_conv: Result_LockedChannelMonitorNoneZ = Result_LockedChannelMonitorNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_LockedChannelMonitorNoneZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_NetAddressDecodeErrorZ.mts b/ts/structs/Result_NetAddressDecodeErrorZ.mts index e22669ed..8fe1d820 100644 --- a/ts/structs/Result_NetAddressDecodeErrorZ.mts +++ b/ts/structs/Result_NetAddressDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_NetAddressDecodeErrorZ extends CommonBase { return new Result_NetAddressDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_NetAddressDecodeErrorZ in the success state. + */ public static constructor_ok(o: NetAddress): Result_NetAddressDecodeErrorZ { const ret: number = bindings.CResult_NetAddressDecodeErrorZ_ok(CommonBase.get_ptr_of(o)); const ret_hu_conv: Result_NetAddressDecodeErrorZ = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NetAddressDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_NetAddressDecodeErrorZ { const ret: number = bindings.CResult_NetAddressDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_NetAddressDecodeErrorZ = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NetAddressDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NetAddressDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NetAddressDecodeErrorZ { const ret: number = bindings.CResult_NetAddressDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_NetAddressDecodeErrorZ = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NetworkGraphDecodeErrorZ.mts b/ts/structs/Result_NetworkGraphDecodeErrorZ.mts index ba661daf..07ac615c 100644 --- a/ts/structs/Result_NetworkGraphDecodeErrorZ.mts +++ b/ts/structs/Result_NetworkGraphDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_NetworkGraphDecodeErrorZ extends CommonBase { return new Result_NetworkGraphDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state. + */ public static constructor_ok(o: NetworkGraph): Result_NetworkGraphDecodeErrorZ { const ret: number = bindings.CResult_NetworkGraphDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_NetworkGraphDecodeErrorZ = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_NetworkGraphDecodeErrorZ { const ret: number = bindings.CResult_NetworkGraphDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_NetworkGraphDecodeErrorZ = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NetworkGraphDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NetworkGraphDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NetworkGraphDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NetworkGraphDecodeErrorZ { const ret: number = bindings.CResult_NetworkGraphDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_NetworkGraphDecodeErrorZ = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NodeAnnouncementDecodeErrorZ.mts b/ts/structs/Result_NodeAnnouncementDecodeErrorZ.mts index a99eb48b..41dcb012 100644 --- a/ts/structs/Result_NodeAnnouncementDecodeErrorZ.mts +++ b/ts/structs/Result_NodeAnnouncementDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { return new Result_NodeAnnouncementDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state. + */ public static constructor_ok(o: NodeAnnouncement): Result_NodeAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_NodeAnnouncementDecodeErrorZ = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_NodeAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_NodeAnnouncementDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_NodeAnnouncementDecodeErrorZ = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NodeAnnouncementDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NodeAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_NodeAnnouncementDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_NodeAnnouncementDecodeErrorZ = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.mts b/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.mts index af9833f8..e31a8dd9 100644 --- a/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.mts +++ b/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { return new Result_NodeAnnouncementInfoDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state. + */ public static constructor_ok(o: NodeAnnouncementInfo): Result_NodeAnnouncementInfoDecodeErrorZ { const ret: number = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_NodeAnnouncementInfoDecodeErrorZ = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_NodeAnnouncementInfoDecodeErrorZ { const ret: number = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_NodeAnnouncementInfoDecodeErrorZ = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NodeAnnouncementInfoDecodeErrorZ { const ret: number = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_NodeAnnouncementInfoDecodeErrorZ = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NodeFeaturesDecodeErrorZ.mts b/ts/structs/Result_NodeFeaturesDecodeErrorZ.mts index 2c9a9ad3..8d2b827f 100644 --- a/ts/structs/Result_NodeFeaturesDecodeErrorZ.mts +++ b/ts/structs/Result_NodeFeaturesDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_NodeFeaturesDecodeErrorZ extends CommonBase { return new Result_NodeFeaturesDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state. + */ public static constructor_ok(o: NodeFeatures): Result_NodeFeaturesDecodeErrorZ { const ret: number = bindings.CResult_NodeFeaturesDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_NodeFeaturesDecodeErrorZ = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_NodeFeaturesDecodeErrorZ { const ret: number = bindings.CResult_NodeFeaturesDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_NodeFeaturesDecodeErrorZ = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NodeFeaturesDecodeErrorZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_NodeIdDecodeErrorZ.mts b/ts/structs/Result_NodeIdDecodeErrorZ.mts index ec714866..20ee06b9 100644 --- a/ts/structs/Result_NodeIdDecodeErrorZ.mts +++ b/ts/structs/Result_NodeIdDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_NodeIdDecodeErrorZ extends CommonBase { return new Result_NodeIdDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_NodeIdDecodeErrorZ in the success state. + */ public static constructor_ok(o: NodeId): Result_NodeIdDecodeErrorZ { const ret: number = bindings.CResult_NodeIdDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_NodeIdDecodeErrorZ = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NodeIdDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_NodeIdDecodeErrorZ { const ret: number = bindings.CResult_NodeIdDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_NodeIdDecodeErrorZ = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NodeIdDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NodeIdDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NodeIdDecodeErrorZ { const ret: number = bindings.CResult_NodeIdDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_NodeIdDecodeErrorZ = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NodeInfoDecodeErrorZ.mts b/ts/structs/Result_NodeInfoDecodeErrorZ.mts index f7f2b99a..d49fbf0b 100644 --- a/ts/structs/Result_NodeInfoDecodeErrorZ.mts +++ b/ts/structs/Result_NodeInfoDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_NodeInfoDecodeErrorZ extends CommonBase { return new Result_NodeInfoDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_NodeInfoDecodeErrorZ in the success state. + */ public static constructor_ok(o: NodeInfo): Result_NodeInfoDecodeErrorZ { const ret: number = bindings.CResult_NodeInfoDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_NodeInfoDecodeErrorZ = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NodeInfoDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_NodeInfoDecodeErrorZ { const ret: number = bindings.CResult_NodeInfoDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_NodeInfoDecodeErrorZ = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NodeInfoDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NodeInfoDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NodeInfoDecodeErrorZ { const ret: number = bindings.CResult_NodeInfoDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_NodeInfoDecodeErrorZ = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NoneAPIErrorZ.mts b/ts/structs/Result_NoneAPIErrorZ.mts index 6a4063e1..08479aa2 100644 --- a/ts/structs/Result_NoneAPIErrorZ.mts +++ b/ts/structs/Result_NoneAPIErrorZ.mts @@ -294,18 +294,27 @@ export class Result_NoneAPIErrorZ extends CommonBase { return new Result_NoneAPIErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_NoneAPIErrorZ in the success state. + */ public static constructor_ok(): Result_NoneAPIErrorZ { const ret: number = bindings.CResult_NoneAPIErrorZ_ok(); const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NoneAPIErrorZ in the error state. + */ public static constructor_err(e: APIError): Result_NoneAPIErrorZ { const ret: number = bindings.CResult_NoneAPIErrorZ_err(CommonBase.get_ptr_of(e)); const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NoneAPIErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NoneAPIErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NoneAPIErrorZ { const ret: number = bindings.CResult_NoneAPIErrorZ_clone(this.ptr); const ret_hu_conv: Result_NoneAPIErrorZ = Result_NoneAPIErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NoneChannelMonitorUpdateErrZ.mts b/ts/structs/Result_NoneChannelMonitorUpdateErrZ.mts index c91c9836..07782f11 100644 --- a/ts/structs/Result_NoneChannelMonitorUpdateErrZ.mts +++ b/ts/structs/Result_NoneChannelMonitorUpdateErrZ.mts @@ -294,18 +294,27 @@ export class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { return new Result_NoneChannelMonitorUpdateErrZ_Err(null, ptr); } } + /** + * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state. + */ public static constructor_ok(): Result_NoneChannelMonitorUpdateErrZ { const ret: number = bindings.CResult_NoneChannelMonitorUpdateErrZ_ok(); const ret_hu_conv: Result_NoneChannelMonitorUpdateErrZ = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state. + */ public static constructor_err(e: ChannelMonitorUpdateErr): Result_NoneChannelMonitorUpdateErrZ { const ret: number = bindings.CResult_NoneChannelMonitorUpdateErrZ_err(e); const ret_hu_conv: Result_NoneChannelMonitorUpdateErrZ = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NoneChannelMonitorUpdateErrZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NoneChannelMonitorUpdateErrZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NoneChannelMonitorUpdateErrZ { const ret: number = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone(this.ptr); const ret_hu_conv: Result_NoneChannelMonitorUpdateErrZ = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NoneLightningErrorZ.mts b/ts/structs/Result_NoneLightningErrorZ.mts index 89322b41..7be26cc6 100644 --- a/ts/structs/Result_NoneLightningErrorZ.mts +++ b/ts/structs/Result_NoneLightningErrorZ.mts @@ -294,18 +294,27 @@ export class Result_NoneLightningErrorZ extends CommonBase { return new Result_NoneLightningErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_NoneLightningErrorZ in the success state. + */ public static constructor_ok(): Result_NoneLightningErrorZ { const ret: number = bindings.CResult_NoneLightningErrorZ_ok(); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NoneLightningErrorZ in the error state. + */ public static constructor_err(e: LightningError): Result_NoneLightningErrorZ { const ret: number = bindings.CResult_NoneLightningErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NoneLightningErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NoneLightningErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NoneLightningErrorZ { const ret: number = bindings.CResult_NoneLightningErrorZ_clone(this.ptr); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NoneNoneZ.mts b/ts/structs/Result_NoneNoneZ.mts index 042f4d32..0b9ea4a6 100644 --- a/ts/structs/Result_NoneNoneZ.mts +++ b/ts/structs/Result_NoneNoneZ.mts @@ -294,18 +294,27 @@ export class Result_NoneNoneZ extends CommonBase { return new Result_NoneNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_NoneNoneZ in the success state. + */ public static constructor_ok(): Result_NoneNoneZ { const ret: number = bindings.CResult_NoneNoneZ_ok(); const ret_hu_conv: Result_NoneNoneZ = Result_NoneNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NoneNoneZ in the error state. + */ public static constructor_err(): Result_NoneNoneZ { const ret: number = bindings.CResult_NoneNoneZ_err(); const ret_hu_conv: Result_NoneNoneZ = Result_NoneNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NoneNoneZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NoneNoneZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NoneNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NoneNoneZ { const ret: number = bindings.CResult_NoneNoneZ_clone(this.ptr); const ret_hu_conv: Result_NoneNoneZ = Result_NoneNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NonePaymentSendFailureZ.mts b/ts/structs/Result_NonePaymentSendFailureZ.mts index b4cbba5c..e95659c3 100644 --- a/ts/structs/Result_NonePaymentSendFailureZ.mts +++ b/ts/structs/Result_NonePaymentSendFailureZ.mts @@ -294,18 +294,27 @@ export class Result_NonePaymentSendFailureZ extends CommonBase { return new Result_NonePaymentSendFailureZ_Err(null, ptr); } } + /** + * Creates a new CResult_NonePaymentSendFailureZ in the success state. + */ public static constructor_ok(): Result_NonePaymentSendFailureZ { const ret: number = bindings.CResult_NonePaymentSendFailureZ_ok(); const ret_hu_conv: Result_NonePaymentSendFailureZ = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NonePaymentSendFailureZ in the error state. + */ public static constructor_err(e: PaymentSendFailure): Result_NonePaymentSendFailureZ { const ret: number = bindings.CResult_NonePaymentSendFailureZ_err(CommonBase.get_ptr_of(e)); const ret_hu_conv: Result_NonePaymentSendFailureZ = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NonePaymentSendFailureZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NonePaymentSendFailureZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NonePaymentSendFailureZ { const ret: number = bindings.CResult_NonePaymentSendFailureZ_clone(this.ptr); const ret_hu_conv: Result_NonePaymentSendFailureZ = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_NonePeerHandleErrorZ.mts b/ts/structs/Result_NonePeerHandleErrorZ.mts index dd950aaa..e0d25df2 100644 --- a/ts/structs/Result_NonePeerHandleErrorZ.mts +++ b/ts/structs/Result_NonePeerHandleErrorZ.mts @@ -294,18 +294,27 @@ export class Result_NonePeerHandleErrorZ extends CommonBase { return new Result_NonePeerHandleErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_NonePeerHandleErrorZ in the success state. + */ public static constructor_ok(): Result_NonePeerHandleErrorZ { const ret: number = bindings.CResult_NonePeerHandleErrorZ_ok(); const ret_hu_conv: Result_NonePeerHandleErrorZ = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_NonePeerHandleErrorZ in the error state. + */ public static constructor_err(e: PeerHandleError): Result_NonePeerHandleErrorZ { const ret: number = bindings.CResult_NonePeerHandleErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_NonePeerHandleErrorZ = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_NonePeerHandleErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_NonePeerHandleErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_NonePeerHandleErrorZ { const ret: number = bindings.CResult_NonePeerHandleErrorZ_clone(this.ptr); const ret_hu_conv: Result_NonePeerHandleErrorZ = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_OpenChannelDecodeErrorZ.mts b/ts/structs/Result_OpenChannelDecodeErrorZ.mts index ed1dcfad..5f9f377f 100644 --- a/ts/structs/Result_OpenChannelDecodeErrorZ.mts +++ b/ts/structs/Result_OpenChannelDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_OpenChannelDecodeErrorZ extends CommonBase { return new Result_OpenChannelDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_OpenChannelDecodeErrorZ in the success state. + */ public static constructor_ok(o: OpenChannel): Result_OpenChannelDecodeErrorZ { const ret: number = bindings.CResult_OpenChannelDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_OpenChannelDecodeErrorZ = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_OpenChannelDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_OpenChannelDecodeErrorZ { const ret: number = bindings.CResult_OpenChannelDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_OpenChannelDecodeErrorZ = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_OpenChannelDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_OpenChannelDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_OpenChannelDecodeErrorZ { const ret: number = bindings.CResult_OpenChannelDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_OpenChannelDecodeErrorZ = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_OutPointDecodeErrorZ.mts b/ts/structs/Result_OutPointDecodeErrorZ.mts index 02800268..9db68533 100644 --- a/ts/structs/Result_OutPointDecodeErrorZ.mts +++ b/ts/structs/Result_OutPointDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_OutPointDecodeErrorZ extends CommonBase { return new Result_OutPointDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_OutPointDecodeErrorZ in the success state. + */ public static constructor_ok(o: OutPoint): Result_OutPointDecodeErrorZ { const ret: number = bindings.CResult_OutPointDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_OutPointDecodeErrorZ = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_OutPointDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_OutPointDecodeErrorZ { const ret: number = bindings.CResult_OutPointDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_OutPointDecodeErrorZ = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_OutPointDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_OutPointDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_OutPointDecodeErrorZ { const ret: number = bindings.CResult_OutPointDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_OutPointDecodeErrorZ = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PayeeDecodeErrorZ.mts b/ts/structs/Result_PayeeDecodeErrorZ.mts index fd0e7dbc..6cc36a72 100644 --- a/ts/structs/Result_PayeeDecodeErrorZ.mts +++ b/ts/structs/Result_PayeeDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_PayeeDecodeErrorZ extends CommonBase { return new Result_PayeeDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_PayeeDecodeErrorZ in the success state. + */ public static constructor_ok(o: Payee): Result_PayeeDecodeErrorZ { const ret: number = bindings.CResult_PayeeDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_PayeeDecodeErrorZ = Result_PayeeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_PayeeDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_PayeeDecodeErrorZ { const ret: number = bindings.CResult_PayeeDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_PayeeDecodeErrorZ = Result_PayeeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_PayeeDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_PayeeDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_PayeeDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_PayeeDecodeErrorZ { const ret: number = bindings.CResult_PayeeDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_PayeeDecodeErrorZ = Result_PayeeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PaymentIdPaymentSendFailureZ.mts b/ts/structs/Result_PaymentIdPaymentSendFailureZ.mts index b0233d71..872fe1e0 100644 --- a/ts/structs/Result_PaymentIdPaymentSendFailureZ.mts +++ b/ts/structs/Result_PaymentIdPaymentSendFailureZ.mts @@ -294,18 +294,27 @@ export class Result_PaymentIdPaymentSendFailureZ extends CommonBase { return new Result_PaymentIdPaymentSendFailureZ_Err(null, ptr); } } + /** + * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state. + */ public static constructor_ok(o: Uint8Array): Result_PaymentIdPaymentSendFailureZ { const ret: number = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(bindings.encodeUint8Array(bindings.check_arr_len(o, 32))); const ret_hu_conv: Result_PaymentIdPaymentSendFailureZ = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state. + */ public static constructor_err(e: PaymentSendFailure): Result_PaymentIdPaymentSendFailureZ { const ret: number = bindings.CResult_PaymentIdPaymentSendFailureZ_err(CommonBase.get_ptr_of(e)); const ret_hu_conv: Result_PaymentIdPaymentSendFailureZ = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_PaymentIdPaymentSendFailureZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_PaymentIdPaymentSendFailureZ extends CommonBase { return ret; } + /** + * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_PaymentIdPaymentSendFailureZ { const ret: number = bindings.CResult_PaymentIdPaymentSendFailureZ_clone(this.ptr); const ret_hu_conv: Result_PaymentIdPaymentSendFailureZ = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PaymentPreimageAPIErrorZ.mts b/ts/structs/Result_PaymentPreimageAPIErrorZ.mts index 8426bdaf..5ee04917 100644 --- a/ts/structs/Result_PaymentPreimageAPIErrorZ.mts +++ b/ts/structs/Result_PaymentPreimageAPIErrorZ.mts @@ -294,18 +294,27 @@ export class Result_PaymentPreimageAPIErrorZ extends CommonBase { return new Result_PaymentPreimageAPIErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state. + */ public static constructor_ok(o: Uint8Array): Result_PaymentPreimageAPIErrorZ { const ret: number = bindings.CResult_PaymentPreimageAPIErrorZ_ok(bindings.encodeUint8Array(bindings.check_arr_len(o, 32))); const ret_hu_conv: Result_PaymentPreimageAPIErrorZ = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state. + */ public static constructor_err(e: APIError): Result_PaymentPreimageAPIErrorZ { const ret: number = bindings.CResult_PaymentPreimageAPIErrorZ_err(CommonBase.get_ptr_of(e)); const ret_hu_conv: Result_PaymentPreimageAPIErrorZ = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_PaymentPreimageAPIErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_PaymentPreimageAPIErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_PaymentPreimageAPIErrorZ { const ret: number = bindings.CResult_PaymentPreimageAPIErrorZ_clone(this.ptr); const ret_hu_conv: Result_PaymentPreimageAPIErrorZ = Result_PaymentPreimageAPIErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PaymentSecretAPIErrorZ.mts b/ts/structs/Result_PaymentSecretAPIErrorZ.mts index 5c26f11a..85590e06 100644 --- a/ts/structs/Result_PaymentSecretAPIErrorZ.mts +++ b/ts/structs/Result_PaymentSecretAPIErrorZ.mts @@ -294,18 +294,27 @@ export class Result_PaymentSecretAPIErrorZ extends CommonBase { return new Result_PaymentSecretAPIErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_PaymentSecretAPIErrorZ in the success state. + */ public static constructor_ok(o: Uint8Array): Result_PaymentSecretAPIErrorZ { const ret: number = bindings.CResult_PaymentSecretAPIErrorZ_ok(bindings.encodeUint8Array(bindings.check_arr_len(o, 32))); const ret_hu_conv: Result_PaymentSecretAPIErrorZ = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_PaymentSecretAPIErrorZ in the error state. + */ public static constructor_err(e: APIError): Result_PaymentSecretAPIErrorZ { const ret: number = bindings.CResult_PaymentSecretAPIErrorZ_err(CommonBase.get_ptr_of(e)); const ret_hu_conv: Result_PaymentSecretAPIErrorZ = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_PaymentSecretAPIErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_PaymentSecretAPIErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_PaymentSecretAPIErrorZ { const ret: number = bindings.CResult_PaymentSecretAPIErrorZ_clone(this.ptr); const ret_hu_conv: Result_PaymentSecretAPIErrorZ = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PaymentSecretNoneZ.mts b/ts/structs/Result_PaymentSecretNoneZ.mts index a9542975..143884f5 100644 --- a/ts/structs/Result_PaymentSecretNoneZ.mts +++ b/ts/structs/Result_PaymentSecretNoneZ.mts @@ -294,18 +294,27 @@ export class Result_PaymentSecretNoneZ extends CommonBase { return new Result_PaymentSecretNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_PaymentSecretNoneZ in the success state. + */ public static constructor_ok(o: Uint8Array): Result_PaymentSecretNoneZ { const ret: number = bindings.CResult_PaymentSecretNoneZ_ok(bindings.encodeUint8Array(bindings.check_arr_len(o, 32))); const ret_hu_conv: Result_PaymentSecretNoneZ = Result_PaymentSecretNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_PaymentSecretNoneZ in the error state. + */ public static constructor_err(): Result_PaymentSecretNoneZ { const ret: number = bindings.CResult_PaymentSecretNoneZ_err(); const ret_hu_conv: Result_PaymentSecretNoneZ = Result_PaymentSecretNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_PaymentSecretNoneZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_PaymentSecretNoneZ extends CommonBase { return ret; } + /** + * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_PaymentSecretNoneZ { const ret: number = bindings.CResult_PaymentSecretNoneZ_clone(this.ptr); const ret_hu_conv: Result_PaymentSecretNoneZ = Result_PaymentSecretNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PingDecodeErrorZ.mts b/ts/structs/Result_PingDecodeErrorZ.mts index 21b6d144..0fccf269 100644 --- a/ts/structs/Result_PingDecodeErrorZ.mts +++ b/ts/structs/Result_PingDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_PingDecodeErrorZ extends CommonBase { return new Result_PingDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_PingDecodeErrorZ in the success state. + */ public static constructor_ok(o: Ping): Result_PingDecodeErrorZ { const ret: number = bindings.CResult_PingDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_PingDecodeErrorZ = Result_PingDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_PingDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_PingDecodeErrorZ { const ret: number = bindings.CResult_PingDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_PingDecodeErrorZ = Result_PingDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_PingDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_PingDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_PingDecodeErrorZ { const ret: number = bindings.CResult_PingDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_PingDecodeErrorZ = Result_PingDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PongDecodeErrorZ.mts b/ts/structs/Result_PongDecodeErrorZ.mts index 6da76aa5..f02da857 100644 --- a/ts/structs/Result_PongDecodeErrorZ.mts +++ b/ts/structs/Result_PongDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_PongDecodeErrorZ extends CommonBase { return new Result_PongDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_PongDecodeErrorZ in the success state. + */ public static constructor_ok(o: Pong): Result_PongDecodeErrorZ { const ret: number = bindings.CResult_PongDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_PongDecodeErrorZ = Result_PongDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_PongDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_PongDecodeErrorZ { const ret: number = bindings.CResult_PongDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_PongDecodeErrorZ = Result_PongDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_PongDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_PongDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_PongDecodeErrorZ { const ret: number = bindings.CResult_PongDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_PongDecodeErrorZ = Result_PongDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_PublicKeyErrorZ.mts b/ts/structs/Result_PublicKeyErrorZ.mts index b6858ab0..1a736a4a 100644 --- a/ts/structs/Result_PublicKeyErrorZ.mts +++ b/ts/structs/Result_PublicKeyErrorZ.mts @@ -294,18 +294,27 @@ export class Result_PublicKeyErrorZ extends CommonBase { return new Result_PublicKeyErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_PublicKeyErrorZ in the success state. + */ public static constructor_ok(o: Uint8Array): Result_PublicKeyErrorZ { const ret: number = bindings.CResult_PublicKeyErrorZ_ok(bindings.encodeUint8Array(bindings.check_arr_len(o, 33))); const ret_hu_conv: Result_PublicKeyErrorZ = Result_PublicKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_PublicKeyErrorZ in the error state. + */ public static constructor_err(e: Secp256k1Error): Result_PublicKeyErrorZ { const ret: number = bindings.CResult_PublicKeyErrorZ_err(e); const ret_hu_conv: Result_PublicKeyErrorZ = Result_PublicKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_PublicKeyErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_PublicKeyErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_PublicKeyErrorZ { const ret: number = bindings.CResult_PublicKeyErrorZ_clone(this.ptr); const ret_hu_conv: Result_PublicKeyErrorZ = Result_PublicKeyErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_QueryChannelRangeDecodeErrorZ.mts b/ts/structs/Result_QueryChannelRangeDecodeErrorZ.mts index d460bb0f..edc08fb3 100644 --- a/ts/structs/Result_QueryChannelRangeDecodeErrorZ.mts +++ b/ts/structs/Result_QueryChannelRangeDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { return new Result_QueryChannelRangeDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state. + */ public static constructor_ok(o: QueryChannelRange): Result_QueryChannelRangeDecodeErrorZ { const ret: number = bindings.CResult_QueryChannelRangeDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_QueryChannelRangeDecodeErrorZ = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_QueryChannelRangeDecodeErrorZ { const ret: number = bindings.CResult_QueryChannelRangeDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_QueryChannelRangeDecodeErrorZ = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_QueryChannelRangeDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_QueryChannelRangeDecodeErrorZ { const ret: number = bindings.CResult_QueryChannelRangeDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_QueryChannelRangeDecodeErrorZ = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.mts b/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.mts index b5557096..14e6fab0 100644 --- a/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.mts +++ b/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { return new Result_QueryShortChannelIdsDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state. + */ public static constructor_ok(o: QueryShortChannelIds): Result_QueryShortChannelIdsDecodeErrorZ { const ret: number = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_QueryShortChannelIdsDecodeErrorZ = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_QueryShortChannelIdsDecodeErrorZ { const ret: number = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_QueryShortChannelIdsDecodeErrorZ = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_QueryShortChannelIdsDecodeErrorZ { const ret: number = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_QueryShortChannelIdsDecodeErrorZ = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RecoverableSignatureNoneZ.mts b/ts/structs/Result_RecoverableSignatureNoneZ.mts index 3e3e00a4..0e9607f6 100644 --- a/ts/structs/Result_RecoverableSignatureNoneZ.mts +++ b/ts/structs/Result_RecoverableSignatureNoneZ.mts @@ -294,18 +294,27 @@ export class Result_RecoverableSignatureNoneZ extends CommonBase { return new Result_RecoverableSignatureNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_RecoverableSignatureNoneZ in the success state. + */ public static constructor_ok(o: Uint8Array): Result_RecoverableSignatureNoneZ { const ret: number = bindings.CResult_RecoverableSignatureNoneZ_ok(bindings.encodeUint8Array(bindings.check_arr_len(o, 68))); const ret_hu_conv: Result_RecoverableSignatureNoneZ = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_RecoverableSignatureNoneZ in the error state. + */ public static constructor_err(): Result_RecoverableSignatureNoneZ { const ret: number = bindings.CResult_RecoverableSignatureNoneZ_err(); const ret_hu_conv: Result_RecoverableSignatureNoneZ = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_RecoverableSignatureNoneZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_RecoverableSignatureNoneZ extends CommonBase { return ret; } + /** + * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_RecoverableSignatureNoneZ { const ret: number = bindings.CResult_RecoverableSignatureNoneZ_clone(this.ptr); const ret_hu_conv: Result_RecoverableSignatureNoneZ = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.mts b/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.mts index a428ee88..0cf2f761 100644 --- a/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.mts +++ b/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { return new Result_ReplyChannelRangeDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state. + */ public static constructor_ok(o: ReplyChannelRange): Result_ReplyChannelRangeDecodeErrorZ { const ret: number = bindings.CResult_ReplyChannelRangeDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ReplyChannelRangeDecodeErrorZ = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ReplyChannelRangeDecodeErrorZ { const ret: number = bindings.CResult_ReplyChannelRangeDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ReplyChannelRangeDecodeErrorZ = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ReplyChannelRangeDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ReplyChannelRangeDecodeErrorZ { const ret: number = bindings.CResult_ReplyChannelRangeDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ReplyChannelRangeDecodeErrorZ = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mts b/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mts index 276b96ac..c7637358 100644 --- a/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mts +++ b/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { return new Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state. + */ public static constructor_ok(o: ReplyShortChannelIdsEnd): Result_ReplyShortChannelIdsEndDecodeErrorZ { const ret: number = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ReplyShortChannelIdsEndDecodeErrorZ = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ReplyShortChannelIdsEndDecodeErrorZ { const ret: number = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ReplyShortChannelIdsEndDecodeErrorZ = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ReplyShortChannelIdsEndDecodeErrorZ { const ret: number = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ReplyShortChannelIdsEndDecodeErrorZ = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RevokeAndACKDecodeErrorZ.mts b/ts/structs/Result_RevokeAndACKDecodeErrorZ.mts index 56f79914..b66d7cb6 100644 --- a/ts/structs/Result_RevokeAndACKDecodeErrorZ.mts +++ b/ts/structs/Result_RevokeAndACKDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_RevokeAndACKDecodeErrorZ extends CommonBase { return new Result_RevokeAndACKDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state. + */ public static constructor_ok(o: RevokeAndACK): Result_RevokeAndACKDecodeErrorZ { const ret: number = bindings.CResult_RevokeAndACKDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_RevokeAndACKDecodeErrorZ = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_RevokeAndACKDecodeErrorZ { const ret: number = bindings.CResult_RevokeAndACKDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_RevokeAndACKDecodeErrorZ = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_RevokeAndACKDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_RevokeAndACKDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_RevokeAndACKDecodeErrorZ { const ret: number = bindings.CResult_RevokeAndACKDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_RevokeAndACKDecodeErrorZ = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteDecodeErrorZ.mts b/ts/structs/Result_RouteDecodeErrorZ.mts index 96d5c578..790146cc 100644 --- a/ts/structs/Result_RouteDecodeErrorZ.mts +++ b/ts/structs/Result_RouteDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_RouteDecodeErrorZ extends CommonBase { return new Result_RouteDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_RouteDecodeErrorZ in the success state. + */ public static constructor_ok(o: Route): Result_RouteDecodeErrorZ { const ret: number = bindings.CResult_RouteDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_RouteDecodeErrorZ = Result_RouteDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_RouteDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_RouteDecodeErrorZ { const ret: number = bindings.CResult_RouteDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_RouteDecodeErrorZ = Result_RouteDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_RouteDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_RouteDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_RouteDecodeErrorZ { const ret: number = bindings.CResult_RouteDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_RouteDecodeErrorZ = Result_RouteDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteHintDecodeErrorZ.mts b/ts/structs/Result_RouteHintDecodeErrorZ.mts index a0d19d8c..949d9ce3 100644 --- a/ts/structs/Result_RouteHintDecodeErrorZ.mts +++ b/ts/structs/Result_RouteHintDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_RouteHintDecodeErrorZ extends CommonBase { return new Result_RouteHintDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_RouteHintDecodeErrorZ in the success state. + */ public static constructor_ok(o: RouteHint): Result_RouteHintDecodeErrorZ { const ret: number = bindings.CResult_RouteHintDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_RouteHintDecodeErrorZ = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_RouteHintDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_RouteHintDecodeErrorZ { const ret: number = bindings.CResult_RouteHintDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_RouteHintDecodeErrorZ = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_RouteHintDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_RouteHintDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_RouteHintDecodeErrorZ { const ret: number = bindings.CResult_RouteHintDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_RouteHintDecodeErrorZ = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteHintHopDecodeErrorZ.mts b/ts/structs/Result_RouteHintHopDecodeErrorZ.mts index a139d0a5..9a2e9d17 100644 --- a/ts/structs/Result_RouteHintHopDecodeErrorZ.mts +++ b/ts/structs/Result_RouteHintHopDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_RouteHintHopDecodeErrorZ extends CommonBase { return new Result_RouteHintHopDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state. + */ public static constructor_ok(o: RouteHintHop): Result_RouteHintHopDecodeErrorZ { const ret: number = bindings.CResult_RouteHintHopDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_RouteHintHopDecodeErrorZ = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_RouteHintHopDecodeErrorZ { const ret: number = bindings.CResult_RouteHintHopDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_RouteHintHopDecodeErrorZ = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_RouteHintHopDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_RouteHintHopDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_RouteHintHopDecodeErrorZ { const ret: number = bindings.CResult_RouteHintHopDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_RouteHintHopDecodeErrorZ = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteHopDecodeErrorZ.mts b/ts/structs/Result_RouteHopDecodeErrorZ.mts index b4bc4183..86787a71 100644 --- a/ts/structs/Result_RouteHopDecodeErrorZ.mts +++ b/ts/structs/Result_RouteHopDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_RouteHopDecodeErrorZ extends CommonBase { return new Result_RouteHopDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_RouteHopDecodeErrorZ in the success state. + */ public static constructor_ok(o: RouteHop): Result_RouteHopDecodeErrorZ { const ret: number = bindings.CResult_RouteHopDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_RouteHopDecodeErrorZ = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_RouteHopDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_RouteHopDecodeErrorZ { const ret: number = bindings.CResult_RouteHopDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_RouteHopDecodeErrorZ = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_RouteHopDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_RouteHopDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_RouteHopDecodeErrorZ { const ret: number = bindings.CResult_RouteHopDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_RouteHopDecodeErrorZ = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteLightningErrorZ.mts b/ts/structs/Result_RouteLightningErrorZ.mts index 47f758d5..6479e6c4 100644 --- a/ts/structs/Result_RouteLightningErrorZ.mts +++ b/ts/structs/Result_RouteLightningErrorZ.mts @@ -294,18 +294,27 @@ export class Result_RouteLightningErrorZ extends CommonBase { return new Result_RouteLightningErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_RouteLightningErrorZ in the success state. + */ public static constructor_ok(o: Route): Result_RouteLightningErrorZ { const ret: number = bindings.CResult_RouteLightningErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_RouteLightningErrorZ = Result_RouteLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_RouteLightningErrorZ in the error state. + */ public static constructor_err(e: LightningError): Result_RouteLightningErrorZ { const ret: number = bindings.CResult_RouteLightningErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_RouteLightningErrorZ = Result_RouteLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_RouteLightningErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_RouteLightningErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_RouteLightningErrorZ { const ret: number = bindings.CResult_RouteLightningErrorZ_clone(this.ptr); const ret_hu_conv: Result_RouteLightningErrorZ = Result_RouteLightningErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RouteParametersDecodeErrorZ.mts b/ts/structs/Result_RouteParametersDecodeErrorZ.mts index 3dcd7c43..a9bca368 100644 --- a/ts/structs/Result_RouteParametersDecodeErrorZ.mts +++ b/ts/structs/Result_RouteParametersDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_RouteParametersDecodeErrorZ extends CommonBase { return new Result_RouteParametersDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_RouteParametersDecodeErrorZ in the success state. + */ public static constructor_ok(o: RouteParameters): Result_RouteParametersDecodeErrorZ { const ret: number = bindings.CResult_RouteParametersDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_RouteParametersDecodeErrorZ = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_RouteParametersDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_RouteParametersDecodeErrorZ { const ret: number = bindings.CResult_RouteParametersDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_RouteParametersDecodeErrorZ = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_RouteParametersDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_RouteParametersDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_RouteParametersDecodeErrorZ { const ret: number = bindings.CResult_RouteParametersDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_RouteParametersDecodeErrorZ = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_RoutingFeesDecodeErrorZ.mts b/ts/structs/Result_RoutingFeesDecodeErrorZ.mts index a096e265..104ef1f2 100644 --- a/ts/structs/Result_RoutingFeesDecodeErrorZ.mts +++ b/ts/structs/Result_RoutingFeesDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_RoutingFeesDecodeErrorZ extends CommonBase { return new Result_RoutingFeesDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state. + */ public static constructor_ok(o: RoutingFees): Result_RoutingFeesDecodeErrorZ { const ret: number = bindings.CResult_RoutingFeesDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_RoutingFeesDecodeErrorZ = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_RoutingFeesDecodeErrorZ { const ret: number = bindings.CResult_RoutingFeesDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_RoutingFeesDecodeErrorZ = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_RoutingFeesDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_RoutingFeesDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_RoutingFeesDecodeErrorZ { const ret: number = bindings.CResult_RoutingFeesDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_RoutingFeesDecodeErrorZ = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ScoringParametersDecodeErrorZ.mts b/ts/structs/Result_ScoringParametersDecodeErrorZ.mts index f8def3c9..74d7c105 100644 --- a/ts/structs/Result_ScoringParametersDecodeErrorZ.mts +++ b/ts/structs/Result_ScoringParametersDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ScoringParametersDecodeErrorZ extends CommonBase { return new Result_ScoringParametersDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ScoringParametersDecodeErrorZ in the success state. + */ public static constructor_ok(o_base_penalty_msat_arg: bigint, o_failure_penalty_msat_arg: bigint, o_overuse_penalty_start_1024th_arg: number, o_overuse_penalty_msat_per_1024th_arg: bigint, o_failure_penalty_half_life_arg: bigint): Result_ScoringParametersDecodeErrorZ { const ret: number = bindings.CResult_ScoringParametersDecodeErrorZ_ok(bindings.ScoringParameters_new(o_base_penalty_msat_arg, o_failure_penalty_msat_arg, o_overuse_penalty_start_1024th_arg, o_overuse_penalty_msat_per_1024th_arg, o_failure_penalty_half_life_arg)); const ret_hu_conv: Result_ScoringParametersDecodeErrorZ = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ScoringParametersDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ScoringParametersDecodeErrorZ { const ret: number = bindings.CResult_ScoringParametersDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ScoringParametersDecodeErrorZ = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ScoringParametersDecodeErrorZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_SecretKeyErrorZ.mts b/ts/structs/Result_SecretKeyErrorZ.mts index f54022dc..65379d1a 100644 --- a/ts/structs/Result_SecretKeyErrorZ.mts +++ b/ts/structs/Result_SecretKeyErrorZ.mts @@ -294,18 +294,27 @@ export class Result_SecretKeyErrorZ extends CommonBase { return new Result_SecretKeyErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_SecretKeyErrorZ in the success state. + */ public static constructor_ok(o: Uint8Array): Result_SecretKeyErrorZ { const ret: number = bindings.CResult_SecretKeyErrorZ_ok(bindings.encodeUint8Array(bindings.check_arr_len(o, 32))); const ret_hu_conv: Result_SecretKeyErrorZ = Result_SecretKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_SecretKeyErrorZ in the error state. + */ public static constructor_err(e: Secp256k1Error): Result_SecretKeyErrorZ { const ret: number = bindings.CResult_SecretKeyErrorZ_err(e); const ret_hu_conv: Result_SecretKeyErrorZ = Result_SecretKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_SecretKeyErrorZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_ShutdownDecodeErrorZ.mts b/ts/structs/Result_ShutdownDecodeErrorZ.mts index 1356b682..b702e74b 100644 --- a/ts/structs/Result_ShutdownDecodeErrorZ.mts +++ b/ts/structs/Result_ShutdownDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ShutdownDecodeErrorZ extends CommonBase { return new Result_ShutdownDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ShutdownDecodeErrorZ in the success state. + */ public static constructor_ok(o: Shutdown): Result_ShutdownDecodeErrorZ { const ret: number = bindings.CResult_ShutdownDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ShutdownDecodeErrorZ = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ShutdownDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ShutdownDecodeErrorZ { const ret: number = bindings.CResult_ShutdownDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ShutdownDecodeErrorZ = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ShutdownDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ShutdownDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ShutdownDecodeErrorZ { const ret: number = bindings.CResult_ShutdownDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ShutdownDecodeErrorZ = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ShutdownScriptDecodeErrorZ.mts b/ts/structs/Result_ShutdownScriptDecodeErrorZ.mts index a5ade076..2d42bd4f 100644 --- a/ts/structs/Result_ShutdownScriptDecodeErrorZ.mts +++ b/ts/structs/Result_ShutdownScriptDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_ShutdownScriptDecodeErrorZ extends CommonBase { return new Result_ShutdownScriptDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state. + */ public static constructor_ok(o: ShutdownScript): Result_ShutdownScriptDecodeErrorZ { const ret: number = bindings.CResult_ShutdownScriptDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ShutdownScriptDecodeErrorZ = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_ShutdownScriptDecodeErrorZ { const ret: number = bindings.CResult_ShutdownScriptDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ShutdownScriptDecodeErrorZ = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ShutdownScriptDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ShutdownScriptDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ShutdownScriptDecodeErrorZ { const ret: number = bindings.CResult_ShutdownScriptDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_ShutdownScriptDecodeErrorZ = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_ShutdownScriptInvalidShutdownScriptZ.mts b/ts/structs/Result_ShutdownScriptInvalidShutdownScriptZ.mts index 392c7ddc..c03cdbd3 100644 --- a/ts/structs/Result_ShutdownScriptInvalidShutdownScriptZ.mts +++ b/ts/structs/Result_ShutdownScriptInvalidShutdownScriptZ.mts @@ -294,18 +294,27 @@ export class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { return new Result_ShutdownScriptInvalidShutdownScriptZ_Err(null, ptr); } } + /** + * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state. + */ public static constructor_ok(o: ShutdownScript): Result_ShutdownScriptInvalidShutdownScriptZ { const ret: number = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_ShutdownScriptInvalidShutdownScriptZ = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state. + */ public static constructor_err(e: InvalidShutdownScript): Result_ShutdownScriptInvalidShutdownScriptZ { const ret: number = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_ShutdownScriptInvalidShutdownScriptZ = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { return ret; } + /** + * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_ShutdownScriptInvalidShutdownScriptZ { const ret: number = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_clone(this.ptr); const ret_hu_conv: Result_ShutdownScriptInvalidShutdownScriptZ = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_SignDecodeErrorZ.mts b/ts/structs/Result_SignDecodeErrorZ.mts index 44842bf3..51e3253c 100644 --- a/ts/structs/Result_SignDecodeErrorZ.mts +++ b/ts/structs/Result_SignDecodeErrorZ.mts @@ -294,6 +294,9 @@ export class Result_SignDecodeErrorZ extends CommonBase { return new Result_SignDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_SignDecodeErrorZ in the success state. + */ public static constructor_ok(o: Sign): Result_SignDecodeErrorZ { const ret: number = bindings.CResult_SignDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o)); const ret_hu_conv: Result_SignDecodeErrorZ = Result_SignDecodeErrorZ.constr_from_ptr(ret); @@ -301,12 +304,18 @@ export class Result_SignDecodeErrorZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new CResult_SignDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_SignDecodeErrorZ { const ret: number = bindings.CResult_SignDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_SignDecodeErrorZ = Result_SignDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_SignDecodeErrorZ_is_ok(this.ptr); return ret; @@ -317,6 +326,10 @@ export class Result_SignDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_SignDecodeErrorZ { const ret: number = bindings.CResult_SignDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_SignDecodeErrorZ = Result_SignDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_SignatureNoneZ.mts b/ts/structs/Result_SignatureNoneZ.mts index ddda85ee..174b7d22 100644 --- a/ts/structs/Result_SignatureNoneZ.mts +++ b/ts/structs/Result_SignatureNoneZ.mts @@ -294,18 +294,27 @@ export class Result_SignatureNoneZ extends CommonBase { return new Result_SignatureNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_SignatureNoneZ in the success state. + */ public static constructor_ok(o: Uint8Array): Result_SignatureNoneZ { const ret: number = bindings.CResult_SignatureNoneZ_ok(bindings.encodeUint8Array(bindings.check_arr_len(o, 64))); const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_SignatureNoneZ in the error state. + */ public static constructor_err(): Result_SignatureNoneZ { const ret: number = bindings.CResult_SignatureNoneZ_err(); const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_SignatureNoneZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_SignatureNoneZ extends CommonBase { return ret; } + /** + * Creates a new CResult_SignatureNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_SignatureNoneZ { const ret: number = bindings.CResult_SignatureNoneZ_clone(this.ptr); const ret_hu_conv: Result_SignatureNoneZ = Result_SignatureNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.mts b/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.mts index 2552db07..023b2927 100644 --- a/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.mts +++ b/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { return new Result_SpendableOutputDescriptorDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state. + */ public static constructor_ok(o: SpendableOutputDescriptor): Result_SpendableOutputDescriptorDecodeErrorZ { const ret: number = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(CommonBase.get_ptr_of(o)); const ret_hu_conv: Result_SpendableOutputDescriptorDecodeErrorZ = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_SpendableOutputDescriptorDecodeErrorZ { const ret: number = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_SpendableOutputDescriptorDecodeErrorZ = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_SpendableOutputDescriptorDecodeErrorZ { const ret: number = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_SpendableOutputDescriptorDecodeErrorZ = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mts b/ts/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mts index 70c8268c..972fefaf 100644 --- a/ts/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mts +++ b/ts/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase return new Result_StaticPaymentOutputDescriptorDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state. + */ public static constructor_ok(o: StaticPaymentOutputDescriptor): Result_StaticPaymentOutputDescriptorDecodeErrorZ { const ret: number = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_StaticPaymentOutputDescriptorDecodeErrorZ = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_StaticPaymentOutputDescriptorDecodeErrorZ { const ret: number = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_StaticPaymentOutputDescriptorDecodeErrorZ = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase return ret; } + /** + * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_StaticPaymentOutputDescriptorDecodeErrorZ { const ret: number = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_StaticPaymentOutputDescriptorDecodeErrorZ = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_StringErrorZ.mts b/ts/structs/Result_StringErrorZ.mts index ee7f91cf..d0ddbade 100644 --- a/ts/structs/Result_StringErrorZ.mts +++ b/ts/structs/Result_StringErrorZ.mts @@ -294,18 +294,27 @@ export class Result_StringErrorZ extends CommonBase { return new Result_StringErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_StringErrorZ in the success state. + */ public static constructor_ok(o: string): Result_StringErrorZ { const ret: number = bindings.CResult_StringErrorZ_ok(bindings.encodeString(o)); const ret_hu_conv: Result_StringErrorZ = Result_StringErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_StringErrorZ in the error state. + */ public static constructor_err(e: Secp256k1Error): Result_StringErrorZ { const ret: number = bindings.CResult_StringErrorZ_err(e); const ret_hu_conv: Result_StringErrorZ = Result_StringErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_StringErrorZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_TransactionNoneZ.mts b/ts/structs/Result_TransactionNoneZ.mts index bdf7230b..ee53ac7e 100644 --- a/ts/structs/Result_TransactionNoneZ.mts +++ b/ts/structs/Result_TransactionNoneZ.mts @@ -294,18 +294,27 @@ export class Result_TransactionNoneZ extends CommonBase { return new Result_TransactionNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_TransactionNoneZ in the success state. + */ public static constructor_ok(o: Uint8Array): Result_TransactionNoneZ { const ret: number = bindings.CResult_TransactionNoneZ_ok(bindings.encodeUint8Array(o)); const ret_hu_conv: Result_TransactionNoneZ = Result_TransactionNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_TransactionNoneZ in the error state. + */ public static constructor_err(): Result_TransactionNoneZ { const ret: number = bindings.CResult_TransactionNoneZ_err(); const ret_hu_conv: Result_TransactionNoneZ = Result_TransactionNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_TransactionNoneZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_TransactionNoneZ extends CommonBase { return ret; } + /** + * Creates a new CResult_TransactionNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_TransactionNoneZ { const ret: number = bindings.CResult_TransactionNoneZ_clone(this.ptr); const ret_hu_conv: Result_TransactionNoneZ = Result_TransactionNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_TrustedClosingTransactionNoneZ.mts b/ts/structs/Result_TrustedClosingTransactionNoneZ.mts index 1097e6be..d58bfbe4 100644 --- a/ts/structs/Result_TrustedClosingTransactionNoneZ.mts +++ b/ts/structs/Result_TrustedClosingTransactionNoneZ.mts @@ -294,6 +294,9 @@ export class Result_TrustedClosingTransactionNoneZ extends CommonBase { return new Result_TrustedClosingTransactionNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state. + */ public static constructor_ok(o: TrustedClosingTransaction): Result_TrustedClosingTransactionNoneZ { const ret: number = bindings.CResult_TrustedClosingTransactionNoneZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_TrustedClosingTransactionNoneZ = Result_TrustedClosingTransactionNoneZ.constr_from_ptr(ret); @@ -309,12 +312,18 @@ export class Result_TrustedClosingTransactionNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state. + */ public static constructor_err(): Result_TrustedClosingTransactionNoneZ { const ret: number = bindings.CResult_TrustedClosingTransactionNoneZ_err(); const ret_hu_conv: Result_TrustedClosingTransactionNoneZ = Result_TrustedClosingTransactionNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_TrustedClosingTransactionNoneZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_TrustedCommitmentTransactionNoneZ.mts b/ts/structs/Result_TrustedCommitmentTransactionNoneZ.mts index 6f46c794..48fc89d8 100644 --- a/ts/structs/Result_TrustedCommitmentTransactionNoneZ.mts +++ b/ts/structs/Result_TrustedCommitmentTransactionNoneZ.mts @@ -294,6 +294,9 @@ export class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { return new Result_TrustedCommitmentTransactionNoneZ_Err(null, ptr); } } + /** + * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state. + */ public static constructor_ok(o: TrustedCommitmentTransaction): Result_TrustedCommitmentTransactionNoneZ { const ret: number = bindings.CResult_TrustedCommitmentTransactionNoneZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_TrustedCommitmentTransactionNoneZ = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret); @@ -309,12 +312,18 @@ export class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state. + */ public static constructor_err(): Result_TrustedCommitmentTransactionNoneZ { const ret: number = bindings.CResult_TrustedCommitmentTransactionNoneZ_err(); const ret_hu_conv: Result_TrustedCommitmentTransactionNoneZ = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_TrustedCommitmentTransactionNoneZ_is_ok(this.ptr); return ret; diff --git a/ts/structs/Result_TxCreationKeysDecodeErrorZ.mts b/ts/structs/Result_TxCreationKeysDecodeErrorZ.mts index 88f1fe11..35bf0912 100644 --- a/ts/structs/Result_TxCreationKeysDecodeErrorZ.mts +++ b/ts/structs/Result_TxCreationKeysDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_TxCreationKeysDecodeErrorZ extends CommonBase { return new Result_TxCreationKeysDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state. + */ public static constructor_ok(o: TxCreationKeys): Result_TxCreationKeysDecodeErrorZ { const ret: number = bindings.CResult_TxCreationKeysDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_TxCreationKeysDecodeErrorZ = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_TxCreationKeysDecodeErrorZ { const ret: number = bindings.CResult_TxCreationKeysDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_TxCreationKeysDecodeErrorZ = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_TxCreationKeysDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_TxCreationKeysDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_TxCreationKeysDecodeErrorZ { const ret: number = bindings.CResult_TxCreationKeysDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_TxCreationKeysDecodeErrorZ = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_TxCreationKeysErrorZ.mts b/ts/structs/Result_TxCreationKeysErrorZ.mts index a7db61a8..8b2da44d 100644 --- a/ts/structs/Result_TxCreationKeysErrorZ.mts +++ b/ts/structs/Result_TxCreationKeysErrorZ.mts @@ -294,18 +294,27 @@ export class Result_TxCreationKeysErrorZ extends CommonBase { return new Result_TxCreationKeysErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_TxCreationKeysErrorZ in the success state. + */ public static constructor_ok(o: TxCreationKeys): Result_TxCreationKeysErrorZ { const ret: number = bindings.CResult_TxCreationKeysErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_TxCreationKeysErrorZ = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_TxCreationKeysErrorZ in the error state. + */ public static constructor_err(e: Secp256k1Error): Result_TxCreationKeysErrorZ { const ret: number = bindings.CResult_TxCreationKeysErrorZ_err(e); const ret_hu_conv: Result_TxCreationKeysErrorZ = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_TxCreationKeysErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_TxCreationKeysErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_TxCreationKeysErrorZ { const ret: number = bindings.CResult_TxCreationKeysErrorZ_clone(this.ptr); const ret_hu_conv: Result_TxCreationKeysErrorZ = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_TxOutAccessErrorZ.mts b/ts/structs/Result_TxOutAccessErrorZ.mts index e795f3ad..8846a51c 100644 --- a/ts/structs/Result_TxOutAccessErrorZ.mts +++ b/ts/structs/Result_TxOutAccessErrorZ.mts @@ -294,18 +294,27 @@ export class Result_TxOutAccessErrorZ extends CommonBase { return new Result_TxOutAccessErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_TxOutAccessErrorZ in the success state. + */ public static constructor_ok(o: TxOut): Result_TxOutAccessErrorZ { const ret: number = bindings.CResult_TxOutAccessErrorZ_ok(CommonBase.get_ptr_of(o)); const ret_hu_conv: Result_TxOutAccessErrorZ = Result_TxOutAccessErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_TxOutAccessErrorZ in the error state. + */ public static constructor_err(e: AccessError): Result_TxOutAccessErrorZ { const ret: number = bindings.CResult_TxOutAccessErrorZ_err(e); const ret_hu_conv: Result_TxOutAccessErrorZ = Result_TxOutAccessErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_TxOutAccessErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_TxOutAccessErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_TxOutAccessErrorZ { const ret: number = bindings.CResult_TxOutAccessErrorZ_clone(this.ptr); const ret_hu_conv: Result_TxOutAccessErrorZ = Result_TxOutAccessErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mts b/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mts index 9363cdeb..098e5b9e 100644 --- a/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mts +++ b/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { return new Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state. + */ public static constructor_ok(o: UnsignedChannelAnnouncement): Result_UnsignedChannelAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_UnsignedChannelAnnouncementDecodeErrorZ = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_UnsignedChannelAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_UnsignedChannelAnnouncementDecodeErrorZ = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_UnsignedChannelAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_UnsignedChannelAnnouncementDecodeErrorZ = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.mts b/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.mts index 2e4ee1eb..b02c4682 100644 --- a/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.mts +++ b/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { return new Result_UnsignedChannelUpdateDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state. + */ public static constructor_ok(o: UnsignedChannelUpdate): Result_UnsignedChannelUpdateDecodeErrorZ { const ret: number = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_UnsignedChannelUpdateDecodeErrorZ = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_UnsignedChannelUpdateDecodeErrorZ { const ret: number = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_UnsignedChannelUpdateDecodeErrorZ = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_UnsignedChannelUpdateDecodeErrorZ { const ret: number = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_UnsignedChannelUpdateDecodeErrorZ = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mts b/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mts index 89ecdca9..8e732299 100644 --- a/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mts +++ b/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { return new Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state. + */ public static constructor_ok(o: UnsignedNodeAnnouncement): Result_UnsignedNodeAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_UnsignedNodeAnnouncementDecodeErrorZ = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_UnsignedNodeAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_UnsignedNodeAnnouncementDecodeErrorZ = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_UnsignedNodeAnnouncementDecodeErrorZ { const ret: number = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_UnsignedNodeAnnouncementDecodeErrorZ = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.mts b/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.mts index a3709bb7..18fdd6a7 100644 --- a/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.mts +++ b/ts/structs/Result_UpdateAddHTLCDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { return new Result_UpdateAddHTLCDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state. + */ public static constructor_ok(o: UpdateAddHTLC): Result_UpdateAddHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_UpdateAddHTLCDecodeErrorZ = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_UpdateAddHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_UpdateAddHTLCDecodeErrorZ = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_UpdateAddHTLCDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_UpdateAddHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateAddHTLCDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_UpdateAddHTLCDecodeErrorZ = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.mts b/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.mts index e2035554..7cfe3d06 100644 --- a/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.mts +++ b/ts/structs/Result_UpdateFailHTLCDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { return new Result_UpdateFailHTLCDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state. + */ public static constructor_ok(o: UpdateFailHTLC): Result_UpdateFailHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_UpdateFailHTLCDecodeErrorZ = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_UpdateFailHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_UpdateFailHTLCDecodeErrorZ = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_UpdateFailHTLCDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_UpdateFailHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateFailHTLCDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_UpdateFailHTLCDecodeErrorZ = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mts b/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mts index 9c09d109..2c1b46d3 100644 --- a/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mts +++ b/ts/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { return new Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state. + */ public static constructor_ok(o: UpdateFailMalformedHTLC): Result_UpdateFailMalformedHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_UpdateFailMalformedHTLCDecodeErrorZ = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_UpdateFailMalformedHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_UpdateFailMalformedHTLCDecodeErrorZ = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_UpdateFailMalformedHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_UpdateFailMalformedHTLCDecodeErrorZ = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UpdateFeeDecodeErrorZ.mts b/ts/structs/Result_UpdateFeeDecodeErrorZ.mts index 48fdbc42..6310f9e9 100644 --- a/ts/structs/Result_UpdateFeeDecodeErrorZ.mts +++ b/ts/structs/Result_UpdateFeeDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_UpdateFeeDecodeErrorZ extends CommonBase { return new Result_UpdateFeeDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state. + */ public static constructor_ok(o: UpdateFee): Result_UpdateFeeDecodeErrorZ { const ret: number = bindings.CResult_UpdateFeeDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_UpdateFeeDecodeErrorZ = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_UpdateFeeDecodeErrorZ { const ret: number = bindings.CResult_UpdateFeeDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_UpdateFeeDecodeErrorZ = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_UpdateFeeDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_UpdateFeeDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_UpdateFeeDecodeErrorZ { const ret: number = bindings.CResult_UpdateFeeDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_UpdateFeeDecodeErrorZ = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.mts b/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.mts index 9e963611..38f4d23c 100644 --- a/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.mts +++ b/ts/structs/Result_UpdateFulfillHTLCDecodeErrorZ.mts @@ -294,18 +294,27 @@ export class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { return new Result_UpdateFulfillHTLCDecodeErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state. + */ public static constructor_ok(o: UpdateFulfillHTLC): Result_UpdateFulfillHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o == null ? 0 : CommonBase.get_ptr_of(o) & ~1); const ret_hu_conv: Result_UpdateFulfillHTLCDecodeErrorZ = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state. + */ public static constructor_err(e: DecodeError): Result_UpdateFulfillHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_UpdateFulfillHTLCDecodeErrorZ = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_UpdateFulfillHTLCDecodeErrorZ { const ret: number = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_clone(this.ptr); const ret_hu_conv: Result_UpdateFulfillHTLCDecodeErrorZ = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result__u832APIErrorZ.mts b/ts/structs/Result__u832APIErrorZ.mts index 86d4afb5..4653e484 100644 --- a/ts/structs/Result__u832APIErrorZ.mts +++ b/ts/structs/Result__u832APIErrorZ.mts @@ -294,18 +294,27 @@ export class Result__u832APIErrorZ extends CommonBase { return new Result__u832APIErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult__u832APIErrorZ in the success state. + */ public static constructor_ok(o: Uint8Array): Result__u832APIErrorZ { const ret: number = bindings.CResult__u832APIErrorZ_ok(bindings.encodeUint8Array(bindings.check_arr_len(o, 32))); const ret_hu_conv: Result__u832APIErrorZ = Result__u832APIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult__u832APIErrorZ in the error state. + */ public static constructor_err(e: APIError): Result__u832APIErrorZ { const ret: number = bindings.CResult__u832APIErrorZ_err(CommonBase.get_ptr_of(e)); const ret_hu_conv: Result__u832APIErrorZ = Result__u832APIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult__u832APIErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result__u832APIErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult__u832APIErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result__u832APIErrorZ { const ret: number = bindings.CResult__u832APIErrorZ_clone(this.ptr); const ret_hu_conv: Result__u832APIErrorZ = Result__u832APIErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_boolLightningErrorZ.mts b/ts/structs/Result_boolLightningErrorZ.mts index 6e50ca14..0a83c94a 100644 --- a/ts/structs/Result_boolLightningErrorZ.mts +++ b/ts/structs/Result_boolLightningErrorZ.mts @@ -294,18 +294,27 @@ export class Result_boolLightningErrorZ extends CommonBase { return new Result_boolLightningErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_boolLightningErrorZ in the success state. + */ public static constructor_ok(o: boolean): Result_boolLightningErrorZ { const ret: number = bindings.CResult_boolLightningErrorZ_ok(o); const ret_hu_conv: Result_boolLightningErrorZ = Result_boolLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_boolLightningErrorZ in the error state. + */ public static constructor_err(e: LightningError): Result_boolLightningErrorZ { const ret: number = bindings.CResult_boolLightningErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_boolLightningErrorZ = Result_boolLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_boolLightningErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_boolLightningErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_boolLightningErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_boolLightningErrorZ { const ret: number = bindings.CResult_boolLightningErrorZ_clone(this.ptr); const ret_hu_conv: Result_boolLightningErrorZ = Result_boolLightningErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Result_boolPeerHandleErrorZ.mts b/ts/structs/Result_boolPeerHandleErrorZ.mts index ee5001b2..5521501b 100644 --- a/ts/structs/Result_boolPeerHandleErrorZ.mts +++ b/ts/structs/Result_boolPeerHandleErrorZ.mts @@ -294,18 +294,27 @@ export class Result_boolPeerHandleErrorZ extends CommonBase { return new Result_boolPeerHandleErrorZ_Err(null, ptr); } } + /** + * Creates a new CResult_boolPeerHandleErrorZ in the success state. + */ public static constructor_ok(o: boolean): Result_boolPeerHandleErrorZ { const ret: number = bindings.CResult_boolPeerHandleErrorZ_ok(o); const ret_hu_conv: Result_boolPeerHandleErrorZ = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a new CResult_boolPeerHandleErrorZ in the error state. + */ public static constructor_err(e: PeerHandleError): Result_boolPeerHandleErrorZ { const ret: number = bindings.CResult_boolPeerHandleErrorZ_err(e == null ? 0 : CommonBase.get_ptr_of(e) & ~1); const ret_hu_conv: Result_boolPeerHandleErrorZ = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Checks if the given object is currently in the success state + */ public is_ok(): boolean { const ret: boolean = bindings.CResult_boolPeerHandleErrorZ_is_ok(this.ptr); return ret; @@ -316,6 +325,10 @@ export class Result_boolPeerHandleErrorZ extends CommonBase { return ret; } + /** + * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): Result_boolPeerHandleErrorZ { const ret: number = bindings.CResult_boolPeerHandleErrorZ_clone(this.ptr); const ret_hu_conv: Result_boolPeerHandleErrorZ = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/RevokeAndACK.mts b/ts/structs/RevokeAndACK.mts index 55f51f5a..60bdf6b1 100644 --- a/ts/structs/RevokeAndACK.mts +++ b/ts/structs/RevokeAndACK.mts @@ -281,42 +281,66 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A revoke_and_ack message to be sent or received from a peer + */ export class RevokeAndACK extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.RevokeAndACK_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.RevokeAndACK_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.RevokeAndACK_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The secret corresponding to the per-commitment point + */ public get_per_commitment_secret(): Uint8Array { const ret: number = bindings.RevokeAndACK_get_per_commitment_secret(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The secret corresponding to the per-commitment point + */ public set_per_commitment_secret(val: Uint8Array): void { bindings.RevokeAndACK_set_per_commitment_secret(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The next sender-broadcast commitment transaction's per-commitment point + */ public get_next_per_commitment_point(): Uint8Array { const ret: number = bindings.RevokeAndACK_get_next_per_commitment_point(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The next sender-broadcast commitment transaction's per-commitment point + */ public set_next_per_commitment_point(val: Uint8Array): void { bindings.RevokeAndACK_set_next_per_commitment_point(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Constructs a new RevokeAndACK given each field + */ public static constructor_new(channel_id_arg: Uint8Array, per_commitment_secret_arg: Uint8Array, next_per_commitment_point_arg: Uint8Array): RevokeAndACK { const ret: number = bindings.RevokeAndACK_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_secret_arg, 32)), bindings.encodeUint8Array(bindings.check_arr_len(next_per_commitment_point_arg, 33))); const ret_hu_conv: RevokeAndACK = new RevokeAndACK(null, ret); @@ -329,6 +353,9 @@ export class RevokeAndACK extends CommonBase { return ret; } + /** + * Creates a copy of the RevokeAndACK + */ public clone(): RevokeAndACK { const ret: number = bindings.RevokeAndACK_clone(this.ptr); const ret_hu_conv: RevokeAndACK = new RevokeAndACK(null, ret); @@ -336,12 +363,18 @@ export class RevokeAndACK extends CommonBase { return ret_hu_conv; } + /** + * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read + */ public write(): Uint8Array { const ret: number = bindings.RevokeAndACK_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write + */ public static constructor_read(ser: Uint8Array): Result_RevokeAndACKDecodeErrorZ { const ret: number = bindings.RevokeAndACK_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_RevokeAndACKDecodeErrorZ = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Route.mts b/ts/structs/Route.mts index 80bad2b9..0a8fc2a1 100644 --- a/ts/structs/Route.mts +++ b/ts/structs/Route.mts @@ -281,12 +281,24 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP, + * it can take multiple paths. Each path is composed of one or more hops through the network. + */ export class Route extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.Route_free); } + /** + * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the + * last RouteHop in each path must be the same. + * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the + * destination. Thus, this must always be at least length one. While the maximum length of any + * given path is variable, keeping the length of any path to less than 20 should currently + * ensure it is viable. + */ public get_paths(): RouteHop[][] { const ret: number = bindings.Route_get_paths(this.ptr); const ret_conv_12_len: number = bindings.getArrayLength(ret); @@ -301,15 +313,34 @@ export class Route extends CommonBase { CommonBase.add_ref_from(ret_conv_12_conv_10_hu_conv, this); ret_conv_12_conv_10_arr[k] = ret_conv_12_conv_10_hu_conv; } + bindings.freeWasmMemory(ret_conv_12) ret_conv_12_arr[m] = ret_conv_12_conv_10_arr; } + bindings.freeWasmMemory(ret) return ret_conv_12_arr; } + /** + * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the + * last RouteHop in each path must be the same. + * Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the + * destination. Thus, this must always be at least length one. While the maximum length of any + * given path is variable, keeping the length of any path to less than 20 should currently + * ensure it is viable. + */ public set_paths(val: RouteHop[][]): void { bindings.Route_set_paths(this.ptr, bindings.encodeUint32Array(val != null ? val.map(val_conv_12 => bindings.encodeUint32Array(val_conv_12 != null ? val_conv_12.map(val_conv_12_conv_10 => val_conv_12_conv_10 == null ? 0 : CommonBase.get_ptr_of(val_conv_12_conv_10) & ~1) : null)) : null)); } + /** + * The `payee` parameter passed to [`find_route`]. + * This is used by `ChannelManager` to track information which may be required for retries, + * provided back to you via [`Event::PaymentPathFailed`]. + * + * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_payee(): Payee { const ret: number = bindings.Route_get_payee(this.ptr); const ret_hu_conv: Payee = new Payee(null, ret); @@ -317,10 +348,22 @@ export class Route extends CommonBase { return ret_hu_conv; } + /** + * The `payee` parameter passed to [`find_route`]. + * This is used by `ChannelManager` to track information which may be required for retries, + * provided back to you via [`Event::PaymentPathFailed`]. + * + * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_payee(val: Payee): void { bindings.Route_set_payee(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Constructs a new Route given each field + */ public static constructor_new(paths_arg: RouteHop[][], payee_arg: Payee): Route { const ret: number = bindings.Route_new(bindings.encodeUint32Array(paths_arg != null ? paths_arg.map(paths_arg_conv_12 => bindings.encodeUint32Array(paths_arg_conv_12 != null ? paths_arg_conv_12.map(paths_arg_conv_12_conv_10 => paths_arg_conv_12_conv_10 == null ? 0 : CommonBase.get_ptr_of(paths_arg_conv_12_conv_10) & ~1) : null)) : null), payee_arg == null ? 0 : CommonBase.get_ptr_of(payee_arg) & ~1); const ret_hu_conv: Route = new Route(null, ret); @@ -333,6 +376,9 @@ export class Route extends CommonBase { return ret; } + /** + * Creates a copy of the Route + */ public clone(): Route { const ret: number = bindings.Route_clone(this.ptr); const ret_hu_conv: Route = new Route(null, ret); @@ -340,33 +386,56 @@ export class Route extends CommonBase { return ret_hu_conv; } + /** + * Checks if two Routes contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.Route_hash(this.ptr); return ret; } + /** + * Checks if two Routes contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: Route): boolean { const ret: boolean = bindings.Route_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); return ret; } + /** + * Returns the total amount of fees paid on this [`Route`]. + * + * This doesn't include any extra payment made to the recipient, which can happen in excess of + * the amount passed to [`find_route`]'s `params.final_value_msat`. + */ public get_total_fees(): bigint { const ret: bigint = bindings.Route_get_total_fees(this.ptr); return ret; } + /** + * Returns the total amount paid on this [`Route`], excluding the fees. + */ public get_total_amount(): bigint { const ret: bigint = bindings.Route_get_total_amount(this.ptr); return ret; } + /** + * Serialize the Route object into a byte array which can be read by Route_read + */ public write(): Uint8Array { const ret: number = bindings.Route_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a Route from a byte array, created by Route_write + */ public static constructor_read(ser: Uint8Array): Result_RouteDecodeErrorZ { const ret: number = bindings.Route_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_RouteDecodeErrorZ = Result_RouteDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/RouteHint.mts b/ts/structs/RouteHint.mts index 48d5625d..fb8079d7 100644 --- a/ts/structs/RouteHint.mts +++ b/ts/structs/RouteHint.mts @@ -281,6 +281,9 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A list of hops along a payment path terminating with a channel to the recipient. + */ export class RouteHint extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { @@ -297,6 +300,7 @@ export class RouteHint extends CommonBase { CommonBase.add_ref_from(ret_conv_14_hu_conv, this); ret_conv_14_arr[o] = ret_conv_14_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_14_arr; } @@ -304,6 +308,9 @@ export class RouteHint extends CommonBase { bindings.RouteHint_set_a(this.ptr, bindings.encodeUint32Array(val != null ? val.map(val_conv_14 => val_conv_14 == null ? 0 : CommonBase.get_ptr_of(val_conv_14) & ~1) : null)); } + /** + * Constructs a new RouteHint given each field + */ public static constructor_new(a_arg: RouteHintHop[]): RouteHint { const ret: number = bindings.RouteHint_new(bindings.encodeUint32Array(a_arg != null ? a_arg.map(a_arg_conv_14 => a_arg_conv_14 == null ? 0 : CommonBase.get_ptr_of(a_arg_conv_14) & ~1) : null)); const ret_hu_conv: RouteHint = new RouteHint(null, ret); @@ -316,6 +323,9 @@ export class RouteHint extends CommonBase { return ret; } + /** + * Creates a copy of the RouteHint + */ public clone(): RouteHint { const ret: number = bindings.RouteHint_clone(this.ptr); const ret_hu_conv: RouteHint = new RouteHint(null, ret); @@ -323,23 +333,37 @@ export class RouteHint extends CommonBase { return ret_hu_conv; } + /** + * Checks if two RouteHints contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.RouteHint_hash(this.ptr); return ret; } + /** + * Checks if two RouteHints contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: RouteHint): boolean { const ret: boolean = bindings.RouteHint_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); return ret; } + /** + * Serialize the RouteHint object into a byte array which can be read by RouteHint_read + */ public write(): Uint8Array { const ret: number = bindings.RouteHint_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a RouteHint from a byte array, created by RouteHint_write + */ public static constructor_read(ser: Uint8Array): Result_RouteHintDecodeErrorZ { const ret: number = bindings.RouteHint_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_RouteHintDecodeErrorZ = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/RouteHintHop.mts b/ts/structs/RouteHintHop.mts index bf9a56fc..7596abe0 100644 --- a/ts/structs/RouteHintHop.mts +++ b/ts/structs/RouteHintHop.mts @@ -281,31 +281,49 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A channel descriptor for a hop along a payment path. + */ export class RouteHintHop extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.RouteHintHop_free); } + /** + * The node_id of the non-target end of the route + */ public get_src_node_id(): Uint8Array { const ret: number = bindings.RouteHintHop_get_src_node_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The node_id of the non-target end of the route + */ public set_src_node_id(val: Uint8Array): void { bindings.RouteHintHop_set_src_node_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The short_channel_id of this channel + */ public get_short_channel_id(): bigint { const ret: bigint = bindings.RouteHintHop_get_short_channel_id(this.ptr); return ret; } + /** + * The short_channel_id of this channel + */ public set_short_channel_id(val: bigint): void { bindings.RouteHintHop_set_short_channel_id(this.ptr, val); } + /** + * The fees which must be paid to use this channel + */ public get_fees(): RoutingFees { const ret: number = bindings.RouteHintHop_get_fees(this.ptr); const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); @@ -313,19 +331,31 @@ export class RouteHintHop extends CommonBase { return ret_hu_conv; } + /** + * The fees which must be paid to use this channel + */ public set_fees(val: RoutingFees): void { bindings.RouteHintHop_set_fees(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The difference in CLTV values between this node and the next node. + */ public get_cltv_expiry_delta(): number { const ret: number = bindings.RouteHintHop_get_cltv_expiry_delta(this.ptr); return ret; } + /** + * The difference in CLTV values between this node and the next node. + */ public set_cltv_expiry_delta(val: number): void { bindings.RouteHintHop_set_cltv_expiry_delta(this.ptr, val); } + /** + * The minimum value, in msat, which must be relayed to the next hop. + */ public get_htlc_minimum_msat(): Option_u64Z { const ret: number = bindings.RouteHintHop_get_htlc_minimum_msat(this.ptr); const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret); @@ -333,10 +363,16 @@ export class RouteHintHop extends CommonBase { return ret_hu_conv; } + /** + * The minimum value, in msat, which must be relayed to the next hop. + */ public set_htlc_minimum_msat(val: Option_u64Z): void { bindings.RouteHintHop_set_htlc_minimum_msat(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * The maximum value in msat available for routing with a single HTLC. + */ public get_htlc_maximum_msat(): Option_u64Z { const ret: number = bindings.RouteHintHop_get_htlc_maximum_msat(this.ptr); const ret_hu_conv: Option_u64Z = Option_u64Z.constr_from_ptr(ret); @@ -344,10 +380,16 @@ export class RouteHintHop extends CommonBase { return ret_hu_conv; } + /** + * The maximum value in msat available for routing with a single HTLC. + */ public set_htlc_maximum_msat(val: Option_u64Z): void { bindings.RouteHintHop_set_htlc_maximum_msat(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * Constructs a new RouteHintHop given each field + */ public static constructor_new(src_node_id_arg: Uint8Array, short_channel_id_arg: bigint, fees_arg: RoutingFees, cltv_expiry_delta_arg: number, htlc_minimum_msat_arg: Option_u64Z, htlc_maximum_msat_arg: Option_u64Z): RouteHintHop { const ret: number = bindings.RouteHintHop_new(bindings.encodeUint8Array(bindings.check_arr_len(src_node_id_arg, 33)), short_channel_id_arg, fees_arg == null ? 0 : CommonBase.get_ptr_of(fees_arg) & ~1, cltv_expiry_delta_arg, CommonBase.get_ptr_of(htlc_minimum_msat_arg), CommonBase.get_ptr_of(htlc_maximum_msat_arg)); const ret_hu_conv: RouteHintHop = new RouteHintHop(null, ret); @@ -360,6 +402,9 @@ export class RouteHintHop extends CommonBase { return ret; } + /** + * Creates a copy of the RouteHintHop + */ public clone(): RouteHintHop { const ret: number = bindings.RouteHintHop_clone(this.ptr); const ret_hu_conv: RouteHintHop = new RouteHintHop(null, ret); @@ -367,23 +412,37 @@ export class RouteHintHop extends CommonBase { return ret_hu_conv; } + /** + * Checks if two RouteHintHops contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.RouteHintHop_hash(this.ptr); return ret; } + /** + * Checks if two RouteHintHops contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: RouteHintHop): boolean { const ret: boolean = bindings.RouteHintHop_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); return ret; } + /** + * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read + */ public write(): Uint8Array { const ret: number = bindings.RouteHintHop_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a RouteHintHop from a byte array, created by RouteHintHop_write + */ public static constructor_read(ser: Uint8Array): Result_RouteHintHopDecodeErrorZ { const ret: number = bindings.RouteHintHop_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_RouteHintHopDecodeErrorZ = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/RouteHop.mts b/ts/structs/RouteHop.mts index 18f12f04..734e2e61 100644 --- a/ts/structs/RouteHop.mts +++ b/ts/structs/RouteHop.mts @@ -281,22 +281,35 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A hop in a route + */ export class RouteHop extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.RouteHop_free); } + /** + * The node_id of the node at this hop. + */ public get_pubkey(): Uint8Array { const ret: number = bindings.RouteHop_get_pubkey(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The node_id of the node at this hop. + */ public set_pubkey(val: Uint8Array): void { bindings.RouteHop_set_pubkey(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The node_announcement features of the node at this hop. For the last hop, these may be + * amended to match the features present in the invoice this node generated. + */ public get_node_features(): NodeFeatures { const ret: number = bindings.RouteHop_get_node_features(this.ptr); const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); @@ -304,19 +317,33 @@ export class RouteHop extends CommonBase { return ret_hu_conv; } + /** + * The node_announcement features of the node at this hop. For the last hop, these may be + * amended to match the features present in the invoice this node generated. + */ public set_node_features(val: NodeFeatures): void { bindings.RouteHop_set_node_features(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The channel that should be used from the previous hop to reach this node. + */ public get_short_channel_id(): bigint { const ret: bigint = bindings.RouteHop_get_short_channel_id(this.ptr); return ret; } + /** + * The channel that should be used from the previous hop to reach this node. + */ public set_short_channel_id(val: bigint): void { bindings.RouteHop_set_short_channel_id(this.ptr, val); } + /** + * The channel_announcement features of the channel that should be used from the previous hop + * to reach this node. + */ public get_channel_features(): ChannelFeatures { const ret: number = bindings.RouteHop_get_channel_features(this.ptr); const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret); @@ -324,28 +351,53 @@ export class RouteHop extends CommonBase { return ret_hu_conv; } + /** + * The channel_announcement features of the channel that should be used from the previous hop + * to reach this node. + */ public set_channel_features(val: ChannelFeatures): void { bindings.RouteHop_set_channel_features(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The fee taken on this hop (for paying for the use of the *next* channel in the path). + * For the last hop, this should be the full value of the payment (might be more than + * requested if we had to match htlc_minimum_msat). + */ public get_fee_msat(): bigint { const ret: bigint = bindings.RouteHop_get_fee_msat(this.ptr); return ret; } + /** + * The fee taken on this hop (for paying for the use of the *next* channel in the path). + * For the last hop, this should be the full value of the payment (might be more than + * requested if we had to match htlc_minimum_msat). + */ public set_fee_msat(val: bigint): void { bindings.RouteHop_set_fee_msat(this.ptr, val); } + /** + * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value + * expected at the destination, in excess of the current block height. + */ public get_cltv_expiry_delta(): number { const ret: number = bindings.RouteHop_get_cltv_expiry_delta(this.ptr); return ret; } + /** + * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value + * expected at the destination, in excess of the current block height. + */ public set_cltv_expiry_delta(val: number): void { bindings.RouteHop_set_cltv_expiry_delta(this.ptr, val); } + /** + * Constructs a new RouteHop given each field + */ public static constructor_new(pubkey_arg: Uint8Array, node_features_arg: NodeFeatures, short_channel_id_arg: bigint, channel_features_arg: ChannelFeatures, fee_msat_arg: bigint, cltv_expiry_delta_arg: number): RouteHop { const ret: number = bindings.RouteHop_new(bindings.encodeUint8Array(bindings.check_arr_len(pubkey_arg, 33)), node_features_arg == null ? 0 : CommonBase.get_ptr_of(node_features_arg) & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : CommonBase.get_ptr_of(channel_features_arg) & ~1, fee_msat_arg, cltv_expiry_delta_arg); const ret_hu_conv: RouteHop = new RouteHop(null, ret); @@ -358,6 +410,9 @@ export class RouteHop extends CommonBase { return ret; } + /** + * Creates a copy of the RouteHop + */ public clone(): RouteHop { const ret: number = bindings.RouteHop_clone(this.ptr); const ret_hu_conv: RouteHop = new RouteHop(null, ret); @@ -365,23 +420,37 @@ export class RouteHop extends CommonBase { return ret_hu_conv; } + /** + * Checks if two RouteHops contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.RouteHop_hash(this.ptr); return ret; } + /** + * Checks if two RouteHops contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: RouteHop): boolean { const ret: boolean = bindings.RouteHop_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); return ret; } + /** + * Serialize the RouteHop object into a byte array which can be read by RouteHop_read + */ public write(): Uint8Array { const ret: number = bindings.RouteHop_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a RouteHop from a byte array, created by RouteHop_write + */ public static constructor_read(ser: Uint8Array): Result_RouteHopDecodeErrorZ { const ret: number = bindings.RouteHop_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_RouteHopDecodeErrorZ = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/RouteParameters.mts b/ts/structs/RouteParameters.mts index cbab1efa..3ba7f7a5 100644 --- a/ts/structs/RouteParameters.mts +++ b/ts/structs/RouteParameters.mts @@ -281,12 +281,23 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Parameters needed to find a [`Route`] for paying a [`Payee`]. + * + * Passed to [`find_route`] and also provided in [`Event::PaymentPathFailed`] for retrying a failed + * payment path. + * + * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed + */ export class RouteParameters extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.RouteParameters_free); } + /** + * The recipient of the failed payment path. + */ public get_payee(): Payee { const ret: number = bindings.RouteParameters_get_payee(this.ptr); const ret_hu_conv: Payee = new Payee(null, ret); @@ -294,28 +305,46 @@ export class RouteParameters extends CommonBase { return ret_hu_conv; } + /** + * The recipient of the failed payment path. + */ public set_payee(val: Payee): void { bindings.RouteParameters_set_payee(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The amount in msats sent on the failed payment path. + */ public get_final_value_msat(): bigint { const ret: bigint = bindings.RouteParameters_get_final_value_msat(this.ptr); return ret; } + /** + * The amount in msats sent on the failed payment path. + */ public set_final_value_msat(val: bigint): void { bindings.RouteParameters_set_final_value_msat(this.ptr, val); } + /** + * The CLTV on the final hop of the failed payment path. + */ public get_final_cltv_expiry_delta(): number { const ret: number = bindings.RouteParameters_get_final_cltv_expiry_delta(this.ptr); return ret; } + /** + * The CLTV on the final hop of the failed payment path. + */ public set_final_cltv_expiry_delta(val: number): void { bindings.RouteParameters_set_final_cltv_expiry_delta(this.ptr, val); } + /** + * Constructs a new RouteParameters given each field + */ public static constructor_new(payee_arg: Payee, final_value_msat_arg: bigint, final_cltv_expiry_delta_arg: number): RouteParameters { const ret: number = bindings.RouteParameters_new(payee_arg == null ? 0 : CommonBase.get_ptr_of(payee_arg) & ~1, final_value_msat_arg, final_cltv_expiry_delta_arg); const ret_hu_conv: RouteParameters = new RouteParameters(null, ret); @@ -328,6 +357,9 @@ export class RouteParameters extends CommonBase { return ret; } + /** + * Creates a copy of the RouteParameters + */ public clone(): RouteParameters { const ret: number = bindings.RouteParameters_clone(this.ptr); const ret_hu_conv: RouteParameters = new RouteParameters(null, ret); @@ -335,12 +367,18 @@ export class RouteParameters extends CommonBase { return ret_hu_conv; } + /** + * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read + */ public write(): Uint8Array { const ret: number = bindings.RouteParameters_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a RouteParameters from a byte array, created by RouteParameters_write + */ public static constructor_read(ser: Uint8Array): Result_RouteParametersDecodeErrorZ { const ret: number = bindings.RouteParameters_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_RouteParametersDecodeErrorZ = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/RoutingFees.mts b/ts/structs/RoutingFees.mts index d51cc65e..4260a258 100644 --- a/ts/structs/RoutingFees.mts +++ b/ts/structs/RoutingFees.mts @@ -281,30 +281,50 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Fees for routing via a given channel or a node + */ export class RoutingFees extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.RoutingFees_free); } + /** + * Flat routing fee in satoshis + */ public get_base_msat(): number { const ret: number = bindings.RoutingFees_get_base_msat(this.ptr); return ret; } + /** + * Flat routing fee in satoshis + */ public set_base_msat(val: number): void { bindings.RoutingFees_set_base_msat(this.ptr, val); } + /** + * Liquidity-based routing fee in millionths of a routed amount. + * In other words, 10000 is 1%. + */ public get_proportional_millionths(): number { const ret: number = bindings.RoutingFees_get_proportional_millionths(this.ptr); return ret; } + /** + * Liquidity-based routing fee in millionths of a routed amount. + * In other words, 10000 is 1%. + */ public set_proportional_millionths(val: number): void { bindings.RoutingFees_set_proportional_millionths(this.ptr, val); } + /** + * Constructs a new RoutingFees given each field + */ public static constructor_new(base_msat_arg: number, proportional_millionths_arg: number): RoutingFees { const ret: number = bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg); const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); @@ -312,6 +332,11 @@ export class RoutingFees extends CommonBase { return ret_hu_conv; } + /** + * Checks if two RoutingFeess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ public eq(b: RoutingFees): boolean { const ret: boolean = bindings.RoutingFees_eq(this.ptr, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); CommonBase.add_ref_from(this, b); @@ -323,6 +348,9 @@ export class RoutingFees extends CommonBase { return ret; } + /** + * Creates a copy of the RoutingFees + */ public clone(): RoutingFees { const ret: number = bindings.RoutingFees_clone(this.ptr); const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); @@ -330,17 +358,26 @@ export class RoutingFees extends CommonBase { return ret_hu_conv; } + /** + * Checks if two RoutingFeess contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.RoutingFees_hash(this.ptr); return ret; } + /** + * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read + */ public write(): Uint8Array { const ret: number = bindings.RoutingFees_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a RoutingFees from a byte array, created by RoutingFees_write + */ public static constructor_read(ser: Uint8Array): Result_RoutingFeesDecodeErrorZ { const ret: number = bindings.RoutingFees_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_RoutingFeesDecodeErrorZ = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/RoutingMessageHandler.mts b/ts/structs/RoutingMessageHandler.mts index 4bb159a0..7eb2c16a 100644 --- a/ts/structs/RoutingMessageHandler.mts +++ b/ts/structs/RoutingMessageHandler.mts @@ -283,16 +283,56 @@ import * as bindings from '../bindings.mjs' +/** An implementation of RoutingMessageHandler */ export interface RoutingMessageHandlerInterface { + /**Handle an incoming node_announcement message, returning true if it should be forwarded on, + * false or returning an Err otherwise. + */ handle_node_announcement(msg: NodeAnnouncement): Result_boolLightningErrorZ; + /**Handle a channel_announcement message, returning true if it should be forwarded on, false + * or returning an Err otherwise. + */ handle_channel_announcement(msg: ChannelAnnouncement): Result_boolLightningErrorZ; + /**Handle an incoming channel_update message, returning true if it should be forwarded on, + * false or returning an Err otherwise. + */ handle_channel_update(msg: ChannelUpdate): Result_boolLightningErrorZ; + /**Gets a subset of the channel announcements and updates required to dump our routing table + * to a remote node, starting at the short_channel_id indicated by starting_point and + * including the batch_amount entries immediately higher in numerical value than starting_point. + */ get_next_channel_announcements(starting_point: bigint, batch_amount: number): ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[]; + /**Gets a subset of the node announcements required to dump our routing table to a remote node, + * starting at the node *after* the provided publickey and including batch_amount entries + * immediately higher (as defined by ::cmp) than starting_point. + * If None is provided for starting_point, we start at the first node. + * + * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None + */ get_next_node_announcements(starting_point: Uint8Array, batch_amount: number): NodeAnnouncement[]; + /**Called when a connection is established with a peer. This can be used to + * perform routing table synchronization using a strategy defined by the + * implementor. + */ sync_routing_table(their_node_id: Uint8Array, init: Init): void; + /**Handles the reply of a query we initiated to learn about channels + * for a given range of blocks. We can expect to receive one or more + * replies to a single query. + */ handle_reply_channel_range(their_node_id: Uint8Array, msg: ReplyChannelRange): Result_NoneLightningErrorZ; + /**Handles the reply of a query we initiated asking for routing gossip + * messages for a list of channels. We should receive this message when + * a node has completed its best effort to send us the pertaining routing + * gossip messages. + */ handle_reply_short_channel_ids_end(their_node_id: Uint8Array, msg: ReplyShortChannelIdsEnd): Result_NoneLightningErrorZ; + /**Handles when a peer asks us to send a list of short_channel_ids + * for the requested range of blocks. + */ handle_query_channel_range(their_node_id: Uint8Array, msg: QueryChannelRange): Result_NoneLightningErrorZ; + /**Handles when a peer asks us to send routing gossip messages for a + * list of short_channel_ids. + */ handle_query_short_channel_ids(their_node_id: Uint8Array, msg: QueryShortChannelIds): Result_NoneLightningErrorZ; } @@ -300,6 +340,15 @@ class LDKRoutingMessageHandlerHolder { held: RoutingMessageHandler; } +/** + * A trait to describe an object which can receive routing messages. + * + * # Implementor DoS Warnings + * + * For `gossip_queries` messages there are potential DoS vectors when handling + * inbound queries. Implementors using an on-disk network graph should be aware of + * repeated disk I/O for queries accessing different parts of the network graph. + */ export class RoutingMessageHandler extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKRoutingMessageHandler; @@ -310,7 +359,8 @@ export class RoutingMessageHandler extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: RoutingMessageHandlerInterface, messageSendEventsProvider_impl: MessageSendEventsProviderInterface): RoutingMessageHandler { + /** Creates a new instance of RoutingMessageHandler from a given implementation */ + public static new_impl(arg: RoutingMessageHandlerInterface, messageSendEventsProvider_impl: MessageSendEventsProviderInterface): RoutingMessageHandler { const impl_holder: LDKRoutingMessageHandlerHolder = new LDKRoutingMessageHandlerHolder(); let structImplementation = { handle_node_announcement (msg: number): number { @@ -388,6 +438,11 @@ export class RoutingMessageHandler extends CommonBase { impl_holder.held.ptrs_to.push(messageSendEventsProvider); return impl_holder.held; } + + /** + * Handle an incoming node_announcement message, returning true if it should be forwarded on, + * false or returning an Err otherwise. + */ public handle_node_announcement(msg: NodeAnnouncement): Result_boolLightningErrorZ { const ret: number = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_boolLightningErrorZ = Result_boolLightningErrorZ.constr_from_ptr(ret); @@ -395,6 +450,10 @@ export class RoutingMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Handle a channel_announcement message, returning true if it should be forwarded on, false + * or returning an Err otherwise. + */ public handle_channel_announcement(msg: ChannelAnnouncement): Result_boolLightningErrorZ { const ret: number = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_boolLightningErrorZ = Result_boolLightningErrorZ.constr_from_ptr(ret); @@ -402,6 +461,10 @@ export class RoutingMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Handle an incoming channel_update message, returning true if it should be forwarded on, + * false or returning an Err otherwise. + */ public handle_channel_update(msg: ChannelUpdate): Result_boolLightningErrorZ { const ret: number = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_boolLightningErrorZ = Result_boolLightningErrorZ.constr_from_ptr(ret); @@ -409,6 +472,11 @@ export class RoutingMessageHandler extends CommonBase { return ret_hu_conv; } + /** + * Gets a subset of the channel announcements and updates required to dump our routing table + * to a remote node, starting at the short_channel_id indicated by starting_point and + * including the batch_amount entries immediately higher in numerical value than starting_point. + */ public get_next_channel_announcements(starting_point: bigint, batch_amount: number): ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ[] { const ret: number = bindings.RoutingMessageHandler_get_next_channel_announcements(this.ptr, starting_point, batch_amount); const ret_conv_59_len: number = bindings.getArrayLength(ret); @@ -419,9 +487,18 @@ export class RoutingMessageHandler extends CommonBase { CommonBase.add_ref_from(ret_conv_59_hu_conv, this); ret_conv_59_arr[h] = ret_conv_59_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_59_arr; } + /** + * Gets a subset of the node announcements required to dump our routing table to a remote node, + * starting at the node *after* the provided publickey and including batch_amount entries + * immediately higher (as defined by ::cmp) than starting_point. + * If None is provided for starting_point, we start at the first node. + * + * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_next_node_announcements(starting_point: Uint8Array, batch_amount: number): NodeAnnouncement[] { const ret: number = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(starting_point, 33)), batch_amount); const ret_conv_18_len: number = bindings.getArrayLength(ret); @@ -432,32 +509,57 @@ export class RoutingMessageHandler extends CommonBase { CommonBase.add_ref_from(ret_conv_18_hu_conv, this); ret_conv_18_arr[s] = ret_conv_18_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_18_arr; } + /** + * Called when a connection is established with a peer. This can be used to + * perform routing table synchronization using a strategy defined by the + * implementor. + */ public sync_routing_table(their_node_id: Uint8Array, init: Init): void { bindings.RoutingMessageHandler_sync_routing_table(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), init == null ? 0 : CommonBase.get_ptr_of(init) & ~1); CommonBase.add_ref_from(this, init); } + /** + * Handles the reply of a query we initiated to learn about channels + * for a given range of blocks. We can expect to receive one or more + * replies to a single query. + */ public handle_reply_channel_range(their_node_id: Uint8Array, msg: ReplyChannelRange): Result_NoneLightningErrorZ { const ret: number = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Handles the reply of a query we initiated asking for routing gossip + * messages for a list of channels. We should receive this message when + * a node has completed its best effort to send us the pertaining routing + * gossip messages. + */ public handle_reply_short_channel_ids_end(their_node_id: Uint8Array, msg: ReplyShortChannelIdsEnd): Result_NoneLightningErrorZ { const ret: number = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Handles when a peer asks us to send a list of short_channel_ids + * for the requested range of blocks. + */ public handle_query_channel_range(their_node_id: Uint8Array, msg: QueryChannelRange): Result_NoneLightningErrorZ { const ret: number = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Handles when a peer asks us to send routing gossip messages for a + * list of short_channel_ids. + */ public handle_query_short_channel_ids(their_node_id: Uint8Array, msg: QueryShortChannelIds): Result_NoneLightningErrorZ { const ret: number = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(their_node_id, 33)), msg == null ? 0 : CommonBase.get_ptr_of(msg) & ~1); const ret_hu_conv: Result_NoneLightningErrorZ = Result_NoneLightningErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Score.mts b/ts/structs/Score.mts index 3d1c4f4a..a9199f8a 100644 --- a/ts/structs/Score.mts +++ b/ts/structs/Score.mts @@ -283,10 +283,30 @@ import * as bindings from '../bindings.mjs' +/** An implementation of Score */ export interface ScoreInterface { + /**Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the + * given channel in the direction from `source` to `target`. + * + * The channel's capacity (less any other MPP parts which are also being considered for use in + * the same payment) is given by `channel_capacity_msat`. It may be guessed from various + * sources or assumed from no data at all. + * + * For hints provided in the invoice, we assume the channel has sufficient capacity to accept + * the invoice's full amount, and provide a `channel_capacity_msat` of `None`. In all other + * cases it is set to `Some`, even if we're guessing at the channel value. + * + * Your code should be overflow-safe through a `channel_capacity_msat` of 21 million BTC. + */ channel_penalty_msat(short_channel_id: bigint, send_amt_msat: bigint, channel_capacity_msat: Option_u64Z, source: NodeId, target: NodeId): bigint; + /**Handles updating channel penalties after failing to route through a channel. + */ payment_path_failed(path: RouteHop[], short_channel_id: bigint): void; + /**Handles updating channel penalties after successfully routing along a path. + */ payment_path_successful(path: RouteHop[]): void; + /**Serialize the object into a byte array + */ write(): Uint8Array; } @@ -294,6 +314,11 @@ class LDKScoreHolder { held: Score; } +/** + * An interface used to score payment channels for path finding. + * + * \tScoring is in terms of fees willing to be paid in order to avoid routing through a channel. + */ export class Score extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKScore; @@ -304,7 +329,8 @@ export class Score extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: ScoreInterface): Score { + /** Creates a new instance of Score from a given implementation */ + public static new_impl(arg: ScoreInterface): Score { const impl_holder: LDKScoreHolder = new LDKScoreHolder(); let structImplementation = { channel_penalty_msat (short_channel_id: bigint, send_amt_msat: bigint, channel_capacity_msat: number, source: number, target: number): bigint { @@ -324,6 +350,7 @@ export class Score extends CommonBase { CommonBase.add_ref_from(path_conv_10_hu_conv, this); path_conv_10_arr[k] = path_conv_10_hu_conv; } + bindings.freeWasmMemory(path) arg.payment_path_failed(path_conv_10_arr, short_channel_id); }, payment_path_successful (path: number): void { @@ -335,6 +362,7 @@ export class Score extends CommonBase { CommonBase.add_ref_from(path_conv_10_hu_conv, this); path_conv_10_arr[k] = path_conv_10_hu_conv; } + bindings.freeWasmMemory(path) arg.payment_path_successful(path_conv_10_arr); }, write (): number { @@ -349,6 +377,21 @@ export class Score extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the + * given channel in the direction from `source` to `target`. + * + * The channel's capacity (less any other MPP parts which are also being considered for use in + * the same payment) is given by `channel_capacity_msat`. It may be guessed from various + * sources or assumed from no data at all. + * + * For hints provided in the invoice, we assume the channel has sufficient capacity to accept + * the invoice's full amount, and provide a `channel_capacity_msat` of `None`. In all other + * cases it is set to `Some`, even if we're guessing at the channel value. + * + * Your code should be overflow-safe through a `channel_capacity_msat` of 21 million BTC. + */ public channel_penalty_msat(short_channel_id: bigint, send_amt_msat: bigint, channel_capacity_msat: Option_u64Z, source: NodeId, target: NodeId): bigint { const ret: bigint = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id, send_amt_msat, CommonBase.get_ptr_of(channel_capacity_msat), source == null ? 0 : CommonBase.get_ptr_of(source) & ~1, target == null ? 0 : CommonBase.get_ptr_of(target) & ~1); CommonBase.add_ref_from(this, source); @@ -356,14 +399,23 @@ export class Score extends CommonBase { return ret; } + /** + * Handles updating channel penalties after failing to route through a channel. + */ public payment_path_failed(path: RouteHop[], short_channel_id: bigint): void { bindings.Score_payment_path_failed(this.ptr, bindings.encodeUint32Array(path != null ? path.map(path_conv_10 => path_conv_10 == null ? 0 : CommonBase.get_ptr_of(path_conv_10) & ~1) : null), short_channel_id); } + /** + * Handles updating channel penalties after successfully routing along a path. + */ public payment_path_successful(path: RouteHop[]): void { bindings.Score_payment_path_successful(this.ptr, bindings.encodeUint32Array(path != null ? path.map(path_conv_10 => path_conv_10 == null ? 0 : CommonBase.get_ptr_of(path_conv_10) & ~1) : null)); } + /** + * Serialize the object into a byte array + */ public write(): Uint8Array { const ret: number = bindings.Score_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); diff --git a/ts/structs/ScoringParameters.mts b/ts/structs/ScoringParameters.mts index 4028729d..a4669e16 100644 --- a/ts/structs/ScoringParameters.mts +++ b/ts/structs/ScoringParameters.mts @@ -281,57 +281,153 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Parameters for configuring [`Scorer`]. + */ export class ScoringParameters extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.ScoringParameters_free); } + /** + * A fixed penalty in msats to apply to each channel. + * + * Default value: 500 msat + */ public get_base_penalty_msat(): bigint { const ret: bigint = bindings.ScoringParameters_get_base_penalty_msat(this.ptr); return ret; } + /** + * A fixed penalty in msats to apply to each channel. + * + * Default value: 500 msat + */ public set_base_penalty_msat(val: bigint): void { bindings.ScoringParameters_set_base_penalty_msat(this.ptr, val); } + /** + * A penalty in msats to apply to a channel upon failing to relay a payment. + * + * This accumulates for each failure but may be reduced over time based on + * [`failure_penalty_half_life`] or when successfully routing through a channel. + * + * Default value: 1,024,000 msat + * + * [`failure_penalty_half_life`]: Self::failure_penalty_half_life + */ public get_failure_penalty_msat(): bigint { const ret: bigint = bindings.ScoringParameters_get_failure_penalty_msat(this.ptr); return ret; } + /** + * A penalty in msats to apply to a channel upon failing to relay a payment. + * + * This accumulates for each failure but may be reduced over time based on + * [`failure_penalty_half_life`] or when successfully routing through a channel. + * + * Default value: 1,024,000 msat + * + * [`failure_penalty_half_life`]: Self::failure_penalty_half_life + */ public set_failure_penalty_msat(val: bigint): void { bindings.ScoringParameters_set_failure_penalty_msat(this.ptr, val); } + /** + * When the amount being sent over a channel is this many 1024ths of the total channel + * capacity, we begin applying [`overuse_penalty_msat_per_1024th`]. + * + * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel) + * + * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th + */ public get_overuse_penalty_start_1024th(): number { const ret: number = bindings.ScoringParameters_get_overuse_penalty_start_1024th(this.ptr); return ret; } + /** + * When the amount being sent over a channel is this many 1024ths of the total channel + * capacity, we begin applying [`overuse_penalty_msat_per_1024th`]. + * + * Default value: 128 1024ths (i.e. begin penalizing when an HTLC uses 1/8th of a channel) + * + * [`overuse_penalty_msat_per_1024th`]: Self::overuse_penalty_msat_per_1024th + */ public set_overuse_penalty_start_1024th(val: number): void { bindings.ScoringParameters_set_overuse_penalty_start_1024th(this.ptr, val); } + /** + * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent + * over the channel exceeds [`overuse_penalty_start_1024th`] by. + * + * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty + * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel) + * + * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th + */ public get_overuse_penalty_msat_per_1024th(): bigint { const ret: bigint = bindings.ScoringParameters_get_overuse_penalty_msat_per_1024th(this.ptr); return ret; } + /** + * A penalty applied, per whole 1024ths of the channel capacity which the amount being sent + * over the channel exceeds [`overuse_penalty_start_1024th`] by. + * + * Default value: 20 msat (i.e. 2560 msat penalty to use 1/4th of a channel, 7680 msat penalty + * to use half a channel, and 12,560 msat penalty to use 3/4ths of a channel) + * + * [`overuse_penalty_start_1024th`]: Self::overuse_penalty_start_1024th + */ public set_overuse_penalty_msat_per_1024th(val: bigint): void { bindings.ScoringParameters_set_overuse_penalty_msat_per_1024th(this.ptr, val); } + /** + * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are + * cut in half. + * + * Successfully routing through a channel will immediately cut the penalty in half as well. + * + * # Note + * + * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will + * never decay. + * + * [`failure_penalty_msat`]: Self::failure_penalty_msat + */ public get_failure_penalty_half_life(): bigint { const ret: bigint = bindings.ScoringParameters_get_failure_penalty_half_life(this.ptr); return ret; } + /** + * The time required to elapse before any accumulated [`failure_penalty_msat`] penalties are + * cut in half. + * + * Successfully routing through a channel will immediately cut the penalty in half as well. + * + * # Note + * + * When built with the `no-std` feature, time will never elapse. Therefore, this penalty will + * never decay. + * + * [`failure_penalty_msat`]: Self::failure_penalty_msat + */ public set_failure_penalty_half_life(val: bigint): void { bindings.ScoringParameters_set_failure_penalty_half_life(this.ptr, val); } + /** + * Constructs a new ScoringParameters given each field + */ public static constructor_new(base_penalty_msat_arg: bigint, failure_penalty_msat_arg: bigint, overuse_penalty_start_1024th_arg: number, overuse_penalty_msat_per_1024th_arg: bigint, failure_penalty_half_life_arg: bigint): ScoringParameters { const ret: number = bindings.ScoringParameters_new(base_penalty_msat_arg, failure_penalty_msat_arg, overuse_penalty_start_1024th_arg, overuse_penalty_msat_per_1024th_arg, failure_penalty_half_life_arg); const ret_hu_conv: ScoringParameters = new ScoringParameters(null, ret); @@ -339,18 +435,27 @@ export class ScoringParameters extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ScoringParameters object into a byte array which can be read by ScoringParameters_read + */ public write(): Uint8Array { const ret: number = bindings.ScoringParameters_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ScoringParameters from a byte array, created by ScoringParameters_write + */ public static constructor_read(ser: Uint8Array): Result_ScoringParametersDecodeErrorZ { const ret: number = bindings.ScoringParameters_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ScoringParametersDecodeErrorZ = Result_ScoringParametersDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a "default" ScoringParameters. See struct and individual field documentaiton for details on which values are used. + */ public static constructor_default(): ScoringParameters { const ret: number = bindings.ScoringParameters_default(); const ret_hu_conv: ScoringParameters = new ScoringParameters(null, ret); diff --git a/ts/structs/Shutdown.mts b/ts/structs/Shutdown.mts index 4d8267b3..4a6b14aa 100644 --- a/ts/structs/Shutdown.mts +++ b/ts/structs/Shutdown.mts @@ -281,32 +281,52 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A shutdown message to be sent or received from a peer + */ export class Shutdown extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.Shutdown_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.Shutdown_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.Shutdown_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The destination of this peer's funds on closing. + * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh. + */ public get_scriptpubkey(): Uint8Array { const ret: number = bindings.Shutdown_get_scriptpubkey(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The destination of this peer's funds on closing. + * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh. + */ public set_scriptpubkey(val: Uint8Array): void { bindings.Shutdown_set_scriptpubkey(this.ptr, bindings.encodeUint8Array(val)); } + /** + * Constructs a new Shutdown given each field + */ public static constructor_new(channel_id_arg: Uint8Array, scriptpubkey_arg: Uint8Array): Shutdown { const ret: number = bindings.Shutdown_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), bindings.encodeUint8Array(scriptpubkey_arg)); const ret_hu_conv: Shutdown = new Shutdown(null, ret); @@ -319,6 +339,9 @@ export class Shutdown extends CommonBase { return ret; } + /** + * Creates a copy of the Shutdown + */ public clone(): Shutdown { const ret: number = bindings.Shutdown_clone(this.ptr); const ret_hu_conv: Shutdown = new Shutdown(null, ret); @@ -326,12 +349,18 @@ export class Shutdown extends CommonBase { return ret_hu_conv; } + /** + * Serialize the Shutdown object into a byte array which can be read by Shutdown_read + */ public write(): Uint8Array { const ret: number = bindings.Shutdown_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a Shutdown from a byte array, created by Shutdown_write + */ public static constructor_read(ser: Uint8Array): Result_ShutdownDecodeErrorZ { const ret: number = bindings.Shutdown_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ShutdownDecodeErrorZ = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ShutdownScript.mts b/ts/structs/ShutdownScript.mts index 1de2c8a1..79688cf9 100644 --- a/ts/structs/ShutdownScript.mts +++ b/ts/structs/ShutdownScript.mts @@ -281,6 +281,11 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A script pubkey for shutting down a channel as defined by [BOLT #2]. + * + * [BOLT #2]: https://github.com/lightningnetwork/lightning-rfc/blob/master/02-peer-protocol.md + */ export class ShutdownScript extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { @@ -292,6 +297,9 @@ export class ShutdownScript extends CommonBase { return ret; } + /** + * Creates a copy of the ShutdownScript + */ public clone(): ShutdownScript { const ret: number = bindings.ShutdownScript_clone(this.ptr); const ret_hu_conv: ShutdownScript = new ShutdownScript(null, ret); @@ -299,18 +307,27 @@ export class ShutdownScript extends CommonBase { return ret_hu_conv; } + /** + * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read + */ public write(): Uint8Array { const ret: number = bindings.ShutdownScript_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a ShutdownScript from a byte array, created by ShutdownScript_write + */ public static constructor_read(ser: Uint8Array): Result_ShutdownScriptDecodeErrorZ { const ret: number = bindings.ShutdownScript_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_ShutdownScriptDecodeErrorZ = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`]. + */ public static constructor_new_p2wpkh(pubkey_hash: Uint8Array): ShutdownScript { const ret: number = bindings.ShutdownScript_new_p2wpkh(bindings.encodeUint8Array(bindings.check_arr_len(pubkey_hash, 20))); const ret_hu_conv: ShutdownScript = new ShutdownScript(null, ret); @@ -318,6 +335,9 @@ export class ShutdownScript extends CommonBase { return ret_hu_conv; } + /** + * Generates a P2WSH script pubkey from the given [`WScriptHash`]. + */ public static constructor_new_p2wsh(script_hash: Uint8Array): ShutdownScript { const ret: number = bindings.ShutdownScript_new_p2wsh(bindings.encodeUint8Array(bindings.check_arr_len(script_hash, 32))); const ret_hu_conv: ShutdownScript = new ShutdownScript(null, ret); @@ -325,24 +345,47 @@ export class ShutdownScript extends CommonBase { return ret_hu_conv; } + /** + * Generates a witness script pubkey from the given segwit version and program. + * + * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or + * [`ShutdownScript::new_p2wsh`] instead. + * + * # Errors + * + * This function may return an error if `program` is invalid for the segwit `version`. + */ public static constructor_new_witness_program(version: number, program: Uint8Array): Result_ShutdownScriptInvalidShutdownScriptZ { const ret: number = bindings.ShutdownScript_new_witness_program(version, bindings.encodeUint8Array(program)); const ret_hu_conv: Result_ShutdownScriptInvalidShutdownScriptZ = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Converts the shutdown script into the underlying [`Script`]. + */ public into_inner(): Uint8Array { const ret: number = bindings.ShutdownScript_into_inner(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public as_legacy_pubkey(): Uint8Array { const ret: number = bindings.ShutdownScript_as_legacy_pubkey(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Returns whether the shutdown script is compatible with the features as defined by BOLT #2. + * + * Specifically, checks for compliance with feature `option_shutdown_anysegwit`. + */ public is_compatible(features: InitFeatures): boolean { const ret: boolean = bindings.ShutdownScript_is_compatible(this.ptr, features == null ? 0 : CommonBase.get_ptr_of(features) & ~1); CommonBase.add_ref_from(this, features); diff --git a/ts/structs/Sign.mts b/ts/structs/Sign.mts index b6f78e47..1b7765c3 100644 --- a/ts/structs/Sign.mts +++ b/ts/structs/Sign.mts @@ -283,7 +283,10 @@ import * as bindings from '../bindings.mjs' +/** An implementation of Sign */ export interface SignInterface { + /**Serialize the object into a byte array + */ write(): Uint8Array; } @@ -291,6 +294,13 @@ class LDKSignHolder { held: Sign; } +/** + * A cloneable signer. + * + * Although we require signers to be cloneable, it may be useful for developers to be able to use + * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait, + * which implies Sized, into this derived trait. + */ export class Sign extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKSign; @@ -301,7 +311,8 @@ export class Sign extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: SignInterface, baseSign_impl: BaseSignInterface, pubkeys: ChannelPublicKeys): Sign { + /** Creates a new instance of Sign from a given implementation */ + public static new_impl(arg: SignInterface, baseSign_impl: BaseSignInterface, pubkeys: ChannelPublicKeys): Sign { const impl_holder: LDKSignHolder = new LDKSignHolder(); let structImplementation = { write (): number { @@ -318,6 +329,10 @@ export class Sign extends CommonBase { impl_holder.held.ptrs_to.push(baseSign); return impl_holder.held; } + + /** + * Serialize the object into a byte array + */ public write(): Uint8Array { const ret: number = bindings.Sign_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); @@ -329,6 +344,9 @@ export class Sign extends CommonBase { return ret; } + /** + * Creates a copy of a Sign + */ public clone(): Sign { const ret: number = bindings.Sign_clone(this.ptr); const ret_hu_conv: Sign = new Sign(null, ret); diff --git a/ts/structs/SocketDescriptor.mts b/ts/structs/SocketDescriptor.mts index 59a47458..01775920 100644 --- a/ts/structs/SocketDescriptor.mts +++ b/ts/structs/SocketDescriptor.mts @@ -283,10 +283,39 @@ import * as bindings from '../bindings.mjs' +/** An implementation of SocketDescriptor */ export interface SocketDescriptorInterface { + /**Attempts to send some data from the given slice to the peer. + * + * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected. + * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be + * called and further write attempts may occur until that time. + * + * If the returned size is smaller than `data.len()`, a + * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be + * written. Additionally, until a `send_data` event completes fully, no further + * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to + * prevent denial-of-service issues, you should not read or buffer any data from the socket + * until then. + * + * If a [`PeerManager::read_event`] call on this descriptor had previously returned true + * (indicating that read events should be paused to prevent DoS in the send buffer), + * `resume_read` may be set indicating that read events on this descriptor should resume. A + * `resume_read` of false carries no meaning, and should not cause any action. + */ send_data(data: Uint8Array, resume_read: boolean): number; + /**Disconnect the socket pointed to by this SocketDescriptor. + * + * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this + * call (doing so is a noop). + */ disconnect_socket(): void; + /**Checks if two objects are equal given this object's this_arg pointer and another object. + */ eq(other_arg: SocketDescriptor): boolean; + /**Calculate a succinct non-cryptographic hash for an object given its this_arg pointer. + * This is used, for example, for inclusion of this object in a hash map. + */ hash(): bigint; } @@ -294,6 +323,20 @@ class LDKSocketDescriptorHolder { held: SocketDescriptor; } +/** + * Provides an object which can be used to send data to and which uniquely identifies a connection + * to a remote host. You will need to be able to generate multiple of these which meet Eq and + * implement Hash to meet the PeerManager API. + * + * For efficiency, Clone should be relatively cheap for this type. + * + * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original + * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it + * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no + * further calls to the [`PeerManager`] related to the original socket occur. This allows you to + * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish + * to simply use another value which is guaranteed to be globally unique instead. + */ export class SocketDescriptor extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKSocketDescriptor; @@ -304,7 +347,8 @@ export class SocketDescriptor extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: SocketDescriptorInterface): SocketDescriptor { + /** Creates a new instance of SocketDescriptor from a given implementation */ + public static new_impl(arg: SocketDescriptorInterface): SocketDescriptor { const impl_holder: LDKSocketDescriptorHolder = new LDKSocketDescriptorHolder(); let structImplementation = { send_data (data: number, resume_read: boolean): number { @@ -332,15 +376,45 @@ export class SocketDescriptor extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Attempts to send some data from the given slice to the peer. + * + * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected. + * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be + * called and further write attempts may occur until that time. + * + * If the returned size is smaller than `data.len()`, a + * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be + * written. Additionally, until a `send_data` event completes fully, no further + * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to + * prevent denial-of-service issues, you should not read or buffer any data from the socket + * until then. + * + * If a [`PeerManager::read_event`] call on this descriptor had previously returned true + * (indicating that read events should be paused to prevent DoS in the send buffer), + * `resume_read` may be set indicating that read events on this descriptor should resume. A + * `resume_read` of false carries no meaning, and should not cause any action. + */ public send_data(data: Uint8Array, resume_read: boolean): number { const ret: number = bindings.SocketDescriptor_send_data(this.ptr, bindings.encodeUint8Array(data), resume_read); return ret; } + /** + * Disconnect the socket pointed to by this SocketDescriptor. + * + * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this + * call (doing so is a noop). + */ public disconnect_socket(): void { bindings.SocketDescriptor_disconnect_socket(this.ptr); } + /** + * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer. + * This is used, for example, for inclusion of this object in a hash map. + */ public hash(): bigint { const ret: bigint = bindings.SocketDescriptor_hash(this.ptr); return ret; @@ -351,6 +425,9 @@ export class SocketDescriptor extends CommonBase { return ret; } + /** + * Creates a copy of a SocketDescriptor + */ public clone(): SocketDescriptor { const ret: number = bindings.SocketDescriptor_clone(this.ptr); const ret_hu_conv: SocketDescriptor = new SocketDescriptor(null, ret); diff --git a/ts/structs/SpendableOutputDescriptor.mts b/ts/structs/SpendableOutputDescriptor.mts index 1090be1b..e64a1b4d 100644 --- a/ts/structs/SpendableOutputDescriptor.mts +++ b/ts/structs/SpendableOutputDescriptor.mts @@ -280,6 +280,13 @@ import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScor import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * When on-chain outputs are created by rust-lightning (which our counterparty is not able to + * claim at any point in the future) an event is generated which you must track and be able to + * spend on-chain. The information needed to do this is provided in this enum, including the + * outpoint describing which txid and output index is available, the full output which exists at + * that txid/index, and any keys or other information required to sign. + */ export class SpendableOutputDescriptor extends CommonBase { protected constructor(_dummy: object, ptr: number) { super(ptr, bindings.SpendableOutputDescriptor_free); } /* @internal */ @@ -299,6 +306,9 @@ export class SpendableOutputDescriptor extends CommonBase { return ret; } + /** + * Creates a copy of the SpendableOutputDescriptor + */ public clone(): SpendableOutputDescriptor { const ret: number = bindings.SpendableOutputDescriptor_clone(this.ptr); const ret_hu_conv: SpendableOutputDescriptor = SpendableOutputDescriptor.constr_from_ptr(ret); @@ -306,6 +316,9 @@ export class SpendableOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor + */ public static constructor_static_output(outpoint: OutPoint, output: TxOut): SpendableOutputDescriptor { const ret: number = bindings.SpendableOutputDescriptor_static_output(outpoint == null ? 0 : CommonBase.get_ptr_of(outpoint) & ~1, CommonBase.get_ptr_of(output)); const ret_hu_conv: SpendableOutputDescriptor = SpendableOutputDescriptor.constr_from_ptr(ret); @@ -313,6 +326,9 @@ export class SpendableOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor + */ public static constructor_delayed_payment_output(a: DelayedPaymentOutputDescriptor): SpendableOutputDescriptor { const ret: number = bindings.SpendableOutputDescriptor_delayed_payment_output(a == null ? 0 : CommonBase.get_ptr_of(a) & ~1); const ret_hu_conv: SpendableOutputDescriptor = SpendableOutputDescriptor.constr_from_ptr(ret); @@ -320,6 +336,9 @@ export class SpendableOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor + */ public static constructor_static_payment_output(a: StaticPaymentOutputDescriptor): SpendableOutputDescriptor { const ret: number = bindings.SpendableOutputDescriptor_static_payment_output(a == null ? 0 : CommonBase.get_ptr_of(a) & ~1); const ret_hu_conv: SpendableOutputDescriptor = SpendableOutputDescriptor.constr_from_ptr(ret); @@ -327,12 +346,18 @@ export class SpendableOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read + */ public write(): Uint8Array { const ret: number = bindings.SpendableOutputDescriptor_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write + */ public static constructor_read(ser: Uint8Array): Result_SpendableOutputDescriptorDecodeErrorZ { const ret: number = bindings.SpendableOutputDescriptor_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_SpendableOutputDescriptorDecodeErrorZ = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); @@ -340,8 +365,15 @@ export class SpendableOutputDescriptor extends CommonBase { } } +/** A SpendableOutputDescriptor of type StaticOutput */ export class SpendableOutputDescriptor_StaticOutput extends SpendableOutputDescriptor { + /** + * The outpoint which is spendable + */ public outpoint: OutPoint; + /** + * The output which is referenced by the given outpoint. + */ public output: TxOut; /* @internal */ public constructor(ptr: number) { @@ -355,6 +387,7 @@ export class SpendableOutputDescriptor_StaticOutput extends SpendableOutputDescr this.output = output_conv; } } +/** A SpendableOutputDescriptor of type DelayedPaymentOutput */ export class SpendableOutputDescriptor_DelayedPaymentOutput extends SpendableOutputDescriptor { public delayed_payment_output: DelayedPaymentOutputDescriptor; /* @internal */ @@ -366,6 +399,7 @@ export class SpendableOutputDescriptor_DelayedPaymentOutput extends SpendableOut this.delayed_payment_output = delayed_payment_output_hu_conv; } } +/** A SpendableOutputDescriptor of type StaticPaymentOutput */ export class SpendableOutputDescriptor_StaticPaymentOutput extends SpendableOutputDescriptor { public static_payment_output: StaticPaymentOutputDescriptor; /* @internal */ diff --git a/ts/structs/StaticPaymentOutputDescriptor.mts b/ts/structs/StaticPaymentOutputDescriptor.mts index b46fe141..f74936aa 100644 --- a/ts/structs/StaticPaymentOutputDescriptor.mts +++ b/ts/structs/StaticPaymentOutputDescriptor.mts @@ -281,12 +281,19 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Information about a spendable output to our \"payment key\". See + * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this. + */ export class StaticPaymentOutputDescriptor extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.StaticPaymentOutputDescriptor_free); } + /** + * The outpoint which is spendable + */ public get_outpoint(): OutPoint { const ret: number = bindings.StaticPaymentOutputDescriptor_get_outpoint(this.ptr); const ret_hu_conv: OutPoint = new OutPoint(null, ret); @@ -294,33 +301,58 @@ export class StaticPaymentOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * The outpoint which is spendable + */ public set_outpoint(val: OutPoint): void { bindings.StaticPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The output which is referenced by the given outpoint + */ public set_output(val: TxOut): void { bindings.StaticPaymentOutputDescriptor_set_output(this.ptr, CommonBase.get_ptr_of(val)); } + /** + * Arbitrary identification information returned by a call to + * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in + * the channel to spend the output. + */ public get_channel_keys_id(): Uint8Array { const ret: number = bindings.StaticPaymentOutputDescriptor_get_channel_keys_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Arbitrary identification information returned by a call to + * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in + * the channel to spend the output. + */ public set_channel_keys_id(val: Uint8Array): void { bindings.StaticPaymentOutputDescriptor_set_channel_keys_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The value of the channel which this transactions spends. + */ public get_channel_value_satoshis(): bigint { const ret: bigint = bindings.StaticPaymentOutputDescriptor_get_channel_value_satoshis(this.ptr); return ret; } + /** + * The value of the channel which this transactions spends. + */ public set_channel_value_satoshis(val: bigint): void { bindings.StaticPaymentOutputDescriptor_set_channel_value_satoshis(this.ptr, val); } + /** + * Constructs a new StaticPaymentOutputDescriptor given each field + */ public static constructor_new(outpoint_arg: OutPoint, output_arg: TxOut, channel_keys_id_arg: Uint8Array, channel_value_satoshis_arg: bigint): StaticPaymentOutputDescriptor { const ret: number = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : CommonBase.get_ptr_of(outpoint_arg) & ~1, CommonBase.get_ptr_of(output_arg), bindings.encodeUint8Array(bindings.check_arr_len(channel_keys_id_arg, 32)), channel_value_satoshis_arg); const ret_hu_conv: StaticPaymentOutputDescriptor = new StaticPaymentOutputDescriptor(null, ret); @@ -333,6 +365,9 @@ export class StaticPaymentOutputDescriptor extends CommonBase { return ret; } + /** + * Creates a copy of the StaticPaymentOutputDescriptor + */ public clone(): StaticPaymentOutputDescriptor { const ret: number = bindings.StaticPaymentOutputDescriptor_clone(this.ptr); const ret_hu_conv: StaticPaymentOutputDescriptor = new StaticPaymentOutputDescriptor(null, ret); @@ -340,12 +375,18 @@ export class StaticPaymentOutputDescriptor extends CommonBase { return ret_hu_conv; } + /** + * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read + */ public write(): Uint8Array { const ret: number = bindings.StaticPaymentOutputDescriptor_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write + */ public static constructor_read(ser: Uint8Array): Result_StaticPaymentOutputDescriptorDecodeErrorZ { const ret: number = bindings.StaticPaymentOutputDescriptor_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_StaticPaymentOutputDescriptorDecodeErrorZ = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mts b/ts/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mts index 37298cab..6557ba7c 100644 --- a/ts/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mts +++ b/ts/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mts @@ -281,12 +281,18 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free); } + /** + * + */ public get_a(): ChannelAnnouncement { const ret: number = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(this.ptr); const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); @@ -294,6 +300,9 @@ export class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ extends C return ret_hu_conv; } + /** + * + */ public get_b(): ChannelUpdate { const ret: number = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(this.ptr); const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); @@ -301,6 +310,9 @@ export class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ extends C return ret_hu_conv; } + /** + * + */ public get_c(): ChannelUpdate { const ret: number = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(this.ptr); const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); @@ -313,6 +325,10 @@ export class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ extends C return ret; } + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { const ret: number = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(this.ptr); const ret_hu_conv: ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(null, ret); @@ -320,6 +336,9 @@ export class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ extends C return ret_hu_conv; } + /** + * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements. + */ public static constructor_new(a: ChannelAnnouncement, b: ChannelUpdate, c: ChannelUpdate): ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { const ret: number = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a == null ? 0 : CommonBase.get_ptr_of(a) & ~1, b == null ? 0 : CommonBase.get_ptr_of(b) & ~1, c == null ? 0 : CommonBase.get_ptr_of(c) & ~1); const ret_hu_conv: ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ = new ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(null, ret); diff --git a/ts/structs/TrustedClosingTransaction.mts b/ts/structs/TrustedClosingTransaction.mts index 2a64d9d7..5a9c6a40 100644 --- a/ts/structs/TrustedClosingTransaction.mts +++ b/ts/structs/TrustedClosingTransaction.mts @@ -281,24 +281,44 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A wrapper on ClosingTransaction indicating that the built bitcoin + * transaction is trusted. + * + * See trust() and verify() functions on CommitmentTransaction. + * + * This structure implements Deref. + */ export class TrustedClosingTransaction extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.TrustedClosingTransaction_free); } + /** + * The pre-built Bitcoin commitment transaction + */ public built_transaction(): Uint8Array { const ret: number = bindings.TrustedClosingTransaction_built_transaction(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Get the SIGHASH_ALL sighash value of the transaction. + * + * This can be used to verify a signature. + */ public get_sighash_all(funding_redeemscript: Uint8Array, channel_value_satoshis: bigint): Uint8Array { const ret: number = bindings.TrustedClosingTransaction_get_sighash_all(this.ptr, bindings.encodeUint8Array(funding_redeemscript), channel_value_satoshis); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Sign a transaction, either because we are counter-signing the counterparty's transaction or + * because we are about to broadcast a holder transaction. + */ public sign(funding_key: Uint8Array, funding_redeemscript: Uint8Array, channel_value_satoshis: bigint): Uint8Array { const ret: number = bindings.TrustedClosingTransaction_sign(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(funding_key, 32)), bindings.encodeUint8Array(funding_redeemscript), channel_value_satoshis); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); diff --git a/ts/structs/TrustedCommitmentTransaction.mts b/ts/structs/TrustedCommitmentTransaction.mts index 6cda7b97..7c27f4a5 100644 --- a/ts/structs/TrustedCommitmentTransaction.mts +++ b/ts/structs/TrustedCommitmentTransaction.mts @@ -281,18 +281,32 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin + * transaction and the transaction creation keys) are trusted. + * + * See trust() and verify() functions on CommitmentTransaction. + * + * This structure implements Deref. + */ export class TrustedCommitmentTransaction extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.TrustedCommitmentTransaction_free); } + /** + * The transaction ID of the built Bitcoin transaction + */ public txid(): Uint8Array { const ret: number = bindings.TrustedCommitmentTransaction_txid(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The pre-built Bitcoin commitment transaction + */ public built_transaction(): BuiltCommitmentTransaction { const ret: number = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr); const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret); @@ -300,6 +314,9 @@ export class TrustedCommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * The pre-calculated transaction creation public keys. + */ public keys(): TxCreationKeys { const ret: number = bindings.TrustedCommitmentTransaction_keys(this.ptr); const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret); @@ -307,11 +324,20 @@ export class TrustedCommitmentTransaction extends CommonBase { return ret_hu_conv; } + /** + * Should anchors be used. + */ public opt_anchors(): boolean { const ret: boolean = bindings.TrustedCommitmentTransaction_opt_anchors(this.ptr); return ret; } + /** + * Get a signature for each HTLC which was included in the commitment transaction (ie for + * which HTLCOutputInCommitment::transaction_output_index.is_some()). + * + * The returned Vec has one entry for each HTLC, and in the same order. + */ public get_htlc_sigs(htlc_base_key: Uint8Array, channel_parameters: DirectedChannelTransactionParameters): Result_CVec_SignatureZNoneZ { const ret: number = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(htlc_base_key, 32)), channel_parameters == null ? 0 : CommonBase.get_ptr_of(channel_parameters) & ~1); const ret_hu_conv: Result_CVec_SignatureZNoneZ = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); diff --git a/ts/structs/TwoTuple_BlockHashChannelManagerZ.mts b/ts/structs/TwoTuple_BlockHashChannelManagerZ.mts index 9b6490b2..55031c6a 100644 --- a/ts/structs/TwoTuple_BlockHashChannelManagerZ.mts +++ b/ts/structs/TwoTuple_BlockHashChannelManagerZ.mts @@ -281,18 +281,27 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_BlockHashChannelManagerZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_BlockHashChannelManagerZ_free); } + /** + * + */ public get_a(): Uint8Array { const ret: number = bindings.C2Tuple_BlockHashChannelManagerZ_get_a(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * + */ public get_b(): ChannelManager { const ret: number = bindings.C2Tuple_BlockHashChannelManagerZ_get_b(this.ptr); const ret_hu_conv: ChannelManager = new ChannelManager(null, ret); @@ -300,6 +309,9 @@ export class TwoTuple_BlockHashChannelManagerZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements. + */ public static constructor_new(a: Uint8Array, b_fee_est: FeeEstimator, b_chain_monitor: Watch, b_tx_broadcaster: BroadcasterInterface, b_logger: Logger, b_keys_manager: KeysInterface, b_config: UserConfig, b_params: ChainParameters): TwoTuple_BlockHashChannelManagerZ { const ret: number = bindings.C2Tuple_BlockHashChannelManagerZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 32)), bindings.ChannelManager_new(b_fee_est == null ? 0 : CommonBase.get_ptr_of(b_fee_est), b_chain_monitor == null ? 0 : CommonBase.get_ptr_of(b_chain_monitor), b_tx_broadcaster == null ? 0 : CommonBase.get_ptr_of(b_tx_broadcaster), b_logger == null ? 0 : CommonBase.get_ptr_of(b_logger), b_keys_manager == null ? 0 : CommonBase.get_ptr_of(b_keys_manager), b_config == null ? 0 : CommonBase.get_ptr_of(b_config) & ~1, b_params == null ? 0 : CommonBase.get_ptr_of(b_params) & ~1)); const ret_hu_conv: TwoTuple_BlockHashChannelManagerZ = new TwoTuple_BlockHashChannelManagerZ(null, ret); diff --git a/ts/structs/TwoTuple_BlockHashChannelMonitorZ.mts b/ts/structs/TwoTuple_BlockHashChannelMonitorZ.mts index 6361c245..d6c0bffa 100644 --- a/ts/structs/TwoTuple_BlockHashChannelMonitorZ.mts +++ b/ts/structs/TwoTuple_BlockHashChannelMonitorZ.mts @@ -281,18 +281,27 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_BlockHashChannelMonitorZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_BlockHashChannelMonitorZ_free); } + /** + * + */ public get_a(): Uint8Array { const ret: number = bindings.C2Tuple_BlockHashChannelMonitorZ_get_a(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * + */ public get_b(): ChannelMonitor { const ret: number = bindings.C2Tuple_BlockHashChannelMonitorZ_get_b(this.ptr); const ret_hu_conv: ChannelMonitor = new ChannelMonitor(null, ret); @@ -305,6 +314,10 @@ export class TwoTuple_BlockHashChannelMonitorZ extends CommonBase { return ret; } + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): TwoTuple_BlockHashChannelMonitorZ { const ret: number = bindings.C2Tuple_BlockHashChannelMonitorZ_clone(this.ptr); const ret_hu_conv: TwoTuple_BlockHashChannelMonitorZ = new TwoTuple_BlockHashChannelMonitorZ(null, ret); @@ -312,6 +325,9 @@ export class TwoTuple_BlockHashChannelMonitorZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements. + */ public static constructor_new(a: Uint8Array, b: ChannelMonitor): TwoTuple_BlockHashChannelMonitorZ { const ret: number = bindings.C2Tuple_BlockHashChannelMonitorZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 32)), b == null ? 0 : CommonBase.get_ptr_of(b) & ~1); const ret_hu_conv: TwoTuple_BlockHashChannelMonitorZ = new TwoTuple_BlockHashChannelMonitorZ(null, ret); diff --git a/ts/structs/TwoTuple_OutPointScriptZ.mts b/ts/structs/TwoTuple_OutPointScriptZ.mts index df205819..25b6e4e1 100644 --- a/ts/structs/TwoTuple_OutPointScriptZ.mts +++ b/ts/structs/TwoTuple_OutPointScriptZ.mts @@ -281,12 +281,18 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_OutPointScriptZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_OutPointScriptZ_free); } + /** + * + */ public get_a(): OutPoint { const ret: number = bindings.C2Tuple_OutPointScriptZ_get_a(this.ptr); const ret_hu_conv: OutPoint = new OutPoint(null, ret); @@ -294,12 +300,18 @@ export class TwoTuple_OutPointScriptZ extends CommonBase { return ret_hu_conv; } + /** + * + */ public get_b(): Uint8Array { const ret: number = bindings.C2Tuple_OutPointScriptZ_get_b(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Creates a new C2Tuple_OutPointScriptZ from the contained elements. + */ public static constructor_new(a: OutPoint, b: Uint8Array): TwoTuple_OutPointScriptZ { const ret: number = bindings.C2Tuple_OutPointScriptZ_new(a == null ? 0 : CommonBase.get_ptr_of(a) & ~1, bindings.encodeUint8Array(b)); const ret_hu_conv: TwoTuple_OutPointScriptZ = new TwoTuple_OutPointScriptZ(null, ret); diff --git a/ts/structs/TwoTuple_PaymentHashPaymentIdZ.mts b/ts/structs/TwoTuple_PaymentHashPaymentIdZ.mts index 8eb781c1..ceb9fd47 100644 --- a/ts/structs/TwoTuple_PaymentHashPaymentIdZ.mts +++ b/ts/structs/TwoTuple_PaymentHashPaymentIdZ.mts @@ -281,18 +281,27 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_PaymentHashPaymentIdZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_PaymentHashPaymentIdZ_free); } + /** + * + */ public get_a(): Uint8Array { const ret: number = bindings.C2Tuple_PaymentHashPaymentIdZ_get_a(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * + */ public get_b(): Uint8Array { const ret: number = bindings.C2Tuple_PaymentHashPaymentIdZ_get_b(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); @@ -304,6 +313,10 @@ export class TwoTuple_PaymentHashPaymentIdZ extends CommonBase { return ret; } + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): TwoTuple_PaymentHashPaymentIdZ { const ret: number = bindings.C2Tuple_PaymentHashPaymentIdZ_clone(this.ptr); const ret_hu_conv: TwoTuple_PaymentHashPaymentIdZ = new TwoTuple_PaymentHashPaymentIdZ(null, ret); @@ -311,6 +324,9 @@ export class TwoTuple_PaymentHashPaymentIdZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements. + */ public static constructor_new(a: Uint8Array, b: Uint8Array): TwoTuple_PaymentHashPaymentIdZ { const ret: number = bindings.C2Tuple_PaymentHashPaymentIdZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 32)), bindings.encodeUint8Array(bindings.check_arr_len(b, 32))); const ret_hu_conv: TwoTuple_PaymentHashPaymentIdZ = new TwoTuple_PaymentHashPaymentIdZ(null, ret); diff --git a/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.mts b/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.mts index 31157642..b541c1c2 100644 --- a/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.mts +++ b/ts/structs/TwoTuple_PaymentHashPaymentSecretZ.mts @@ -281,18 +281,27 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_PaymentHashPaymentSecretZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_PaymentHashPaymentSecretZ_free); } + /** + * + */ public get_a(): Uint8Array { const ret: number = bindings.C2Tuple_PaymentHashPaymentSecretZ_get_a(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * + */ public get_b(): Uint8Array { const ret: number = bindings.C2Tuple_PaymentHashPaymentSecretZ_get_b(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); @@ -304,6 +313,10 @@ export class TwoTuple_PaymentHashPaymentSecretZ extends CommonBase { return ret; } + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): TwoTuple_PaymentHashPaymentSecretZ { const ret: number = bindings.C2Tuple_PaymentHashPaymentSecretZ_clone(this.ptr); const ret_hu_conv: TwoTuple_PaymentHashPaymentSecretZ = new TwoTuple_PaymentHashPaymentSecretZ(null, ret); @@ -311,6 +324,9 @@ export class TwoTuple_PaymentHashPaymentSecretZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements. + */ public static constructor_new(a: Uint8Array, b: Uint8Array): TwoTuple_PaymentHashPaymentSecretZ { const ret: number = bindings.C2Tuple_PaymentHashPaymentSecretZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 32)), bindings.encodeUint8Array(bindings.check_arr_len(b, 32))); const ret_hu_conv: TwoTuple_PaymentHashPaymentSecretZ = new TwoTuple_PaymentHashPaymentSecretZ(null, ret); diff --git a/ts/structs/TwoTuple_PublicKeyTypeZ.mts b/ts/structs/TwoTuple_PublicKeyTypeZ.mts index 96057fc5..2564df9f 100644 --- a/ts/structs/TwoTuple_PublicKeyTypeZ.mts +++ b/ts/structs/TwoTuple_PublicKeyTypeZ.mts @@ -281,18 +281,27 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_PublicKeyTypeZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_PublicKeyTypeZ_free); } + /** + * + */ public get_a(): Uint8Array { const ret: number = bindings.C2Tuple_PublicKeyTypeZ_get_a(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * + */ public get_b(): Type { const ret: number = bindings.C2Tuple_PublicKeyTypeZ_get_b(this.ptr); const ret_hu_conv: Type = new Type(null, ret); @@ -305,6 +314,10 @@ export class TwoTuple_PublicKeyTypeZ extends CommonBase { return ret; } + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): TwoTuple_PublicKeyTypeZ { const ret: number = bindings.C2Tuple_PublicKeyTypeZ_clone(this.ptr); const ret_hu_conv: TwoTuple_PublicKeyTypeZ = new TwoTuple_PublicKeyTypeZ(null, ret); @@ -312,6 +325,9 @@ export class TwoTuple_PublicKeyTypeZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements. + */ public static constructor_new(a: Uint8Array, b: Type): TwoTuple_PublicKeyTypeZ { const ret: number = bindings.C2Tuple_PublicKeyTypeZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 33)), b == null ? 0 : CommonBase.get_ptr_of(b)); const ret_hu_conv: TwoTuple_PublicKeyTypeZ = new TwoTuple_PublicKeyTypeZ(null, ret); diff --git a/ts/structs/TwoTuple_SignatureCVec_SignatureZZ.mts b/ts/structs/TwoTuple_SignatureCVec_SignatureZZ.mts index 6e273969..2f299114 100644 --- a/ts/structs/TwoTuple_SignatureCVec_SignatureZZ.mts +++ b/ts/structs/TwoTuple_SignatureCVec_SignatureZZ.mts @@ -281,18 +281,27 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_SignatureCVec_SignatureZZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_SignatureCVec_SignatureZZ_free); } + /** + * + */ public get_a(): Uint8Array { const ret: number = bindings.C2Tuple_SignatureCVec_SignatureZZ_get_a(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * + */ public get_b(): Uint8Array[] { const ret: number = bindings.C2Tuple_SignatureCVec_SignatureZZ_get_b(this.ptr); const ret_conv_12_len: number = bindings.getArrayLength(ret); @@ -302,6 +311,7 @@ export class TwoTuple_SignatureCVec_SignatureZZ extends CommonBase { const ret_conv_12_conv: Uint8Array = bindings.decodeUint8Array(ret_conv_12); ret_conv_12_arr[m] = ret_conv_12_conv; } + bindings.freeWasmMemory(ret) return ret_conv_12_arr; } @@ -310,6 +320,10 @@ export class TwoTuple_SignatureCVec_SignatureZZ extends CommonBase { return ret; } + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): TwoTuple_SignatureCVec_SignatureZZ { const ret: number = bindings.C2Tuple_SignatureCVec_SignatureZZ_clone(this.ptr); const ret_hu_conv: TwoTuple_SignatureCVec_SignatureZZ = new TwoTuple_SignatureCVec_SignatureZZ(null, ret); @@ -317,6 +331,9 @@ export class TwoTuple_SignatureCVec_SignatureZZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements. + */ public static constructor_new(a: Uint8Array, b: Uint8Array[]): TwoTuple_SignatureCVec_SignatureZZ { const ret: number = bindings.C2Tuple_SignatureCVec_SignatureZZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 64)), bindings.encodeUint32Array(b != null ? b.map(b_conv_12 => bindings.encodeUint8Array(bindings.check_arr_len(b_conv_12, 64))) : null)); const ret_hu_conv: TwoTuple_SignatureCVec_SignatureZZ = new TwoTuple_SignatureCVec_SignatureZZ(null, ret); diff --git a/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.mts b/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.mts index 2c04b744..1a99b9fe 100644 --- a/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.mts +++ b/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ.mts @@ -281,18 +281,27 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free); } + /** + * + */ public get_a(): Uint8Array { const ret: number = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * + */ public get_b(): TwoTuple_u32ScriptZ[] { const ret: number = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(this.ptr); const ret_conv_21_len: number = bindings.getArrayLength(ret); @@ -303,9 +312,13 @@ export class TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ extends CommonBase { CommonBase.add_ref_from(ret_conv_21_hu_conv, this); ret_conv_21_arr[v] = ret_conv_21_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_21_arr; } + /** + * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements. + */ public static constructor_new(a: Uint8Array, b: TwoTuple_u32ScriptZ[]): TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ { const ret: number = bindings.C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 32)), bindings.encodeUint32Array(b != null ? b.map(b_conv_21 => b_conv_21 != null ? CommonBase.get_ptr_of(b_conv_21) : 0) : null)); const ret_hu_conv: TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ = new TwoTuple_TxidCVec_C2Tuple_u32ScriptZZZ(null, ret); diff --git a/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.mts b/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.mts index f9a10d84..25867dcd 100644 --- a/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.mts +++ b/ts/structs/TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ.mts @@ -281,18 +281,27 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free); } + /** + * + */ public get_a(): Uint8Array { const ret: number = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * + */ public get_b(): TwoTuple_u32TxOutZ[] { const ret: number = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(this.ptr); const ret_conv_20_len: number = bindings.getArrayLength(ret); @@ -303,6 +312,7 @@ export class TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ extends CommonBase { CommonBase.add_ref_from(ret_conv_20_hu_conv, this); ret_conv_20_arr[u] = ret_conv_20_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_20_arr; } @@ -311,6 +321,10 @@ export class TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ extends CommonBase { return ret; } + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ { const ret: number = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(this.ptr); const ret_hu_conv: TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ(null, ret); @@ -318,6 +332,9 @@ export class TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements. + */ public static constructor_new(a: Uint8Array, b: TwoTuple_u32TxOutZ[]): TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ { const ret: number = bindings.C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(bindings.encodeUint8Array(bindings.check_arr_len(a, 32)), bindings.encodeUint32Array(b != null ? b.map(b_conv_20 => b_conv_20 != null ? CommonBase.get_ptr_of(b_conv_20) : 0) : null)); const ret_hu_conv: TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ = new TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ(null, ret); diff --git a/ts/structs/TwoTuple_u32ScriptZ.mts b/ts/structs/TwoTuple_u32ScriptZ.mts index 14a5273d..d0058f72 100644 --- a/ts/structs/TwoTuple_u32ScriptZ.mts +++ b/ts/structs/TwoTuple_u32ScriptZ.mts @@ -281,23 +281,35 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_u32ScriptZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_u32ScriptZ_free); } + /** + * + */ public get_a(): number { const ret: number = bindings.C2Tuple_u32ScriptZ_get_a(this.ptr); return ret; } + /** + * + */ public get_b(): Uint8Array { const ret: number = bindings.C2Tuple_u32ScriptZ_get_b(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Creates a new C2Tuple_u32ScriptZ from the contained elements. + */ public static constructor_new(a: number, b: Uint8Array): TwoTuple_u32ScriptZ { const ret: number = bindings.C2Tuple_u32ScriptZ_new(a, bindings.encodeUint8Array(b)); const ret_hu_conv: TwoTuple_u32ScriptZ = new TwoTuple_u32ScriptZ(null, ret); diff --git a/ts/structs/TwoTuple_u32TxOutZ.mts b/ts/structs/TwoTuple_u32TxOutZ.mts index 0746c1a3..2c5c7a7a 100644 --- a/ts/structs/TwoTuple_u32TxOutZ.mts +++ b/ts/structs/TwoTuple_u32TxOutZ.mts @@ -281,17 +281,26 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_u32TxOutZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_u32TxOutZ_free); } + /** + * + */ public get_a(): number { const ret: number = bindings.C2Tuple_u32TxOutZ_get_a(this.ptr); return ret; } + /** + * + */ public get_b(): TxOut { const ret: number = bindings.C2Tuple_u32TxOutZ_get_b(this.ptr); const ret_conv: TxOut = new TxOut(null, ret); @@ -303,6 +312,10 @@ export class TwoTuple_u32TxOutZ extends CommonBase { return ret; } + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): TwoTuple_u32TxOutZ { const ret: number = bindings.C2Tuple_u32TxOutZ_clone(this.ptr); const ret_hu_conv: TwoTuple_u32TxOutZ = new TwoTuple_u32TxOutZ(null, ret); @@ -310,6 +323,9 @@ export class TwoTuple_u32TxOutZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new C2Tuple_u32TxOutZ from the contained elements. + */ public static constructor_new(a: number, b: TxOut): TwoTuple_u32TxOutZ { const ret: number = bindings.C2Tuple_u32TxOutZ_new(a, CommonBase.get_ptr_of(b)); const ret_hu_conv: TwoTuple_u32TxOutZ = new TwoTuple_u32TxOutZ(null, ret); diff --git a/ts/structs/TwoTuple_usizeTransactionZ.mts b/ts/structs/TwoTuple_usizeTransactionZ.mts index a0cd11e9..eb0755b4 100644 --- a/ts/structs/TwoTuple_usizeTransactionZ.mts +++ b/ts/structs/TwoTuple_usizeTransactionZ.mts @@ -281,17 +281,26 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A Tuple + */ export class TwoTuple_usizeTransactionZ extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.C2Tuple_usizeTransactionZ_free); } + /** + * + */ public get_a(): number { const ret: number = bindings.C2Tuple_usizeTransactionZ_get_a(this.ptr); return ret; } + /** + * + */ public get_b(): Uint8Array { const ret: number = bindings.C2Tuple_usizeTransactionZ_get_b(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); @@ -303,6 +312,10 @@ export class TwoTuple_usizeTransactionZ extends CommonBase { return ret; } + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ public clone(): TwoTuple_usizeTransactionZ { const ret: number = bindings.C2Tuple_usizeTransactionZ_clone(this.ptr); const ret_hu_conv: TwoTuple_usizeTransactionZ = new TwoTuple_usizeTransactionZ(null, ret); @@ -310,6 +323,9 @@ export class TwoTuple_usizeTransactionZ extends CommonBase { return ret_hu_conv; } + /** + * Creates a new C2Tuple_usizeTransactionZ from the contained elements. + */ public static constructor_new(a: number, b: Uint8Array): TwoTuple_usizeTransactionZ { const ret: number = bindings.C2Tuple_usizeTransactionZ_new(a, bindings.encodeUint8Array(b)); const ret_hu_conv: TwoTuple_usizeTransactionZ = new TwoTuple_usizeTransactionZ(null, ret); diff --git a/ts/structs/TxCreationKeys.mts b/ts/structs/TxCreationKeys.mts index 0d0c24c8..5efd0a2e 100644 --- a/ts/structs/TxCreationKeys.mts +++ b/ts/structs/TxCreationKeys.mts @@ -281,62 +281,112 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * The set of public keys which are used in the creation of one commitment transaction. + * These are derived from the channel base keys and per-commitment data. + * + * A broadcaster key is provided from potential broadcaster of the computed transaction. + * A countersignatory key is coming from a protocol participant unable to broadcast the + * transaction. + * + * These keys are assumed to be good, either because the code derived them from + * channel basepoints via the new function, or they were obtained via + * CommitmentTransaction.trust().keys() because we trusted the source of the + * pre-calculated keys. + */ export class TxCreationKeys extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.TxCreationKeys_free); } + /** + * The broadcaster's per-commitment public key which was used to derive the other keys. + */ public get_per_commitment_point(): Uint8Array { const ret: number = bindings.TxCreationKeys_get_per_commitment_point(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The broadcaster's per-commitment public key which was used to derive the other keys. + */ public set_per_commitment_point(val: Uint8Array): void { bindings.TxCreationKeys_set_per_commitment_point(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The revocation key which is used to allow the broadcaster of the commitment + * transaction to provide their counterparty the ability to punish them if they broadcast + * an old state. + */ public get_revocation_key(): Uint8Array { const ret: number = bindings.TxCreationKeys_get_revocation_key(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The revocation key which is used to allow the broadcaster of the commitment + * transaction to provide their counterparty the ability to punish them if they broadcast + * an old state. + */ public set_revocation_key(val: Uint8Array): void { bindings.TxCreationKeys_set_revocation_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Broadcaster's HTLC Key + */ public get_broadcaster_htlc_key(): Uint8Array { const ret: number = bindings.TxCreationKeys_get_broadcaster_htlc_key(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Broadcaster's HTLC Key + */ public set_broadcaster_htlc_key(val: Uint8Array): void { bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Countersignatory's HTLC Key + */ public get_countersignatory_htlc_key(): Uint8Array { const ret: number = bindings.TxCreationKeys_get_countersignatory_htlc_key(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Countersignatory's HTLC Key + */ public set_countersignatory_htlc_key(val: Uint8Array): void { bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay) + */ public get_broadcaster_delayed_payment_key(): Uint8Array { const ret: number = bindings.TxCreationKeys_get_broadcaster_delayed_payment_key(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay) + */ public set_broadcaster_delayed_payment_key(val: Uint8Array): void { bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * Constructs a new TxCreationKeys given each field + */ public static constructor_new(per_commitment_point_arg: Uint8Array, revocation_key_arg: Uint8Array, broadcaster_htlc_key_arg: Uint8Array, countersignatory_htlc_key_arg: Uint8Array, broadcaster_delayed_payment_key_arg: Uint8Array): TxCreationKeys { const ret: number = bindings.TxCreationKeys_new(bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(revocation_key_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(broadcaster_htlc_key_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(countersignatory_htlc_key_arg, 33)), bindings.encodeUint8Array(bindings.check_arr_len(broadcaster_delayed_payment_key_arg, 33))); const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret); @@ -349,6 +399,9 @@ export class TxCreationKeys extends CommonBase { return ret; } + /** + * Creates a copy of the TxCreationKeys + */ public clone(): TxCreationKeys { const ret: number = bindings.TxCreationKeys_clone(this.ptr); const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret); @@ -356,24 +409,38 @@ export class TxCreationKeys extends CommonBase { return ret_hu_conv; } + /** + * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read + */ public write(): Uint8Array { const ret: number = bindings.TxCreationKeys_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write + */ public static constructor_read(ser: Uint8Array): Result_TxCreationKeysDecodeErrorZ { const ret: number = bindings.TxCreationKeys_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_TxCreationKeysDecodeErrorZ = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Create per-state keys from channel base points and the per-commitment point. + * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. + */ public static constructor_derive_new(per_commitment_point: Uint8Array, broadcaster_delayed_payment_base: Uint8Array, broadcaster_htlc_base: Uint8Array, countersignatory_revocation_base: Uint8Array, countersignatory_htlc_base: Uint8Array): Result_TxCreationKeysErrorZ { const ret: number = bindings.TxCreationKeys_derive_new(bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point, 33)), bindings.encodeUint8Array(bindings.check_arr_len(broadcaster_delayed_payment_base, 33)), bindings.encodeUint8Array(bindings.check_arr_len(broadcaster_htlc_base, 33)), bindings.encodeUint8Array(bindings.check_arr_len(countersignatory_revocation_base, 33)), bindings.encodeUint8Array(bindings.check_arr_len(countersignatory_htlc_base, 33))); const ret_hu_conv: Result_TxCreationKeysErrorZ = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Generate per-state keys from channel static keys. + * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. + */ public static constructor_from_channel_static_keys(per_commitment_point: Uint8Array, broadcaster_keys: ChannelPublicKeys, countersignatory_keys: ChannelPublicKeys): Result_TxCreationKeysErrorZ { const ret: number = bindings.TxCreationKeys_from_channel_static_keys(bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point, 33)), broadcaster_keys == null ? 0 : CommonBase.get_ptr_of(broadcaster_keys) & ~1, countersignatory_keys == null ? 0 : CommonBase.get_ptr_of(countersignatory_keys) & ~1); const ret_hu_conv: Result_TxCreationKeysErrorZ = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Type.mts b/ts/structs/Type.mts index ac6bd670..5c59cfb3 100644 --- a/ts/structs/Type.mts +++ b/ts/structs/Type.mts @@ -283,9 +283,16 @@ import * as bindings from '../bindings.mjs' +/** An implementation of Type */ export interface TypeInterface { + /**Returns the type identifying the message payload. + */ type_id(): number; + /**Return a human-readable "debug" string describing this object + */ debug_str(): string; + /**Serialize the object into a byte array + */ write(): Uint8Array; } @@ -293,6 +300,11 @@ class LDKTypeHolder { held: Type; } +/** + * Defines a type identifier for sending messages over the wire. + * + * Messages implementing this trait specify a type and must be [`Writeable`]. + */ export class Type extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKType; @@ -303,7 +315,8 @@ export class Type extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: TypeInterface): Type { + /** Creates a new instance of Type from a given implementation */ + public static new_impl(arg: TypeInterface): Type { const impl_holder: LDKTypeHolder = new LDKTypeHolder(); let structImplementation = { type_id (): number { @@ -327,17 +340,27 @@ export class Type extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Returns the type identifying the message payload. + */ public type_id(): number { const ret: number = bindings.Type_type_id(this.ptr); return ret; } + /** + * Return a human-readable "debug" string describing this object + */ public debug_str(): string { const ret: number = bindings.Type_debug_str(this.ptr); const ret_conv: string = bindings.decodeString(ret); return ret_conv; } + /** + * Serialize the object into a byte array + */ public write(): Uint8Array { const ret: number = bindings.Type_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); @@ -349,6 +372,9 @@ export class Type extends CommonBase { return ret; } + /** + * Creates a copy of a Type + */ public clone(): Type { const ret: number = bindings.Type_clone(this.ptr); const ret_hu_conv: Type = new Type(null, ret); diff --git a/ts/structs/UnsignedChannelAnnouncement.mts b/ts/structs/UnsignedChannelAnnouncement.mts index 32b11890..a977ba37 100644 --- a/ts/structs/UnsignedChannelAnnouncement.mts +++ b/ts/structs/UnsignedChannelAnnouncement.mts @@ -281,12 +281,18 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * The unsigned part of a channel_announcement + */ export class UnsignedChannelAnnouncement extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.UnsignedChannelAnnouncement_free); } + /** + * The advertised channel features + */ public get_features(): ChannelFeatures { const ret: number = bindings.UnsignedChannelAnnouncement_get_features(this.ptr); const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret); @@ -294,65 +300,104 @@ export class UnsignedChannelAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * The advertised channel features + */ public set_features(val: ChannelFeatures): void { bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public get_chain_hash(): Uint8Array { const ret: number = bindings.UnsignedChannelAnnouncement_get_chain_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public set_chain_hash(val: Uint8Array): void { bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The short channel ID + */ public get_short_channel_id(): bigint { const ret: bigint = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this.ptr); return ret; } + /** + * The short channel ID + */ public set_short_channel_id(val: bigint): void { bindings.UnsignedChannelAnnouncement_set_short_channel_id(this.ptr, val); } + /** + * One of the two node_ids which are endpoints of this channel + */ public get_node_id_1(): Uint8Array { const ret: number = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * One of the two node_ids which are endpoints of this channel + */ public set_node_id_1(val: Uint8Array): void { bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The other of the two node_ids which are endpoints of this channel + */ public get_node_id_2(): Uint8Array { const ret: number = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The other of the two node_ids which are endpoints of this channel + */ public set_node_id_2(val: Uint8Array): void { bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The funding key for the first node + */ public get_bitcoin_key_1(): Uint8Array { const ret: number = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The funding key for the first node + */ public set_bitcoin_key_1(val: Uint8Array): void { bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * The funding key for the second node + */ public get_bitcoin_key_2(): Uint8Array { const ret: number = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The funding key for the second node + */ public set_bitcoin_key_2(val: Uint8Array): void { bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } @@ -362,6 +407,9 @@ export class UnsignedChannelAnnouncement extends CommonBase { return ret; } + /** + * Creates a copy of the UnsignedChannelAnnouncement + */ public clone(): UnsignedChannelAnnouncement { const ret: number = bindings.UnsignedChannelAnnouncement_clone(this.ptr); const ret_hu_conv: UnsignedChannelAnnouncement = new UnsignedChannelAnnouncement(null, ret); @@ -369,12 +417,18 @@ export class UnsignedChannelAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read + */ public write(): Uint8Array { const ret: number = bindings.UnsignedChannelAnnouncement_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write + */ public static constructor_read(ser: Uint8Array): Result_UnsignedChannelAnnouncementDecodeErrorZ { const ret: number = bindings.UnsignedChannelAnnouncement_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_UnsignedChannelAnnouncementDecodeErrorZ = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/UnsignedChannelUpdate.mts b/ts/structs/UnsignedChannelUpdate.mts index e41f5d9e..993d9a69 100644 --- a/ts/structs/UnsignedChannelUpdate.mts +++ b/ts/structs/UnsignedChannelUpdate.mts @@ -281,81 +281,146 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * The unsigned part of a channel_update + */ export class UnsignedChannelUpdate extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.UnsignedChannelUpdate_free); } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public get_chain_hash(): Uint8Array { const ret: number = bindings.UnsignedChannelUpdate_get_chain_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The genesis hash of the blockchain where the channel is to be opened + */ public set_chain_hash(val: Uint8Array): void { bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The short channel ID + */ public get_short_channel_id(): bigint { const ret: bigint = bindings.UnsignedChannelUpdate_get_short_channel_id(this.ptr); return ret; } + /** + * The short channel ID + */ public set_short_channel_id(val: bigint): void { bindings.UnsignedChannelUpdate_set_short_channel_id(this.ptr, val); } + /** + * A strictly monotonic announcement counter, with gaps allowed, specific to this channel + */ public get_timestamp(): number { const ret: number = bindings.UnsignedChannelUpdate_get_timestamp(this.ptr); return ret; } + /** + * A strictly monotonic announcement counter, with gaps allowed, specific to this channel + */ public set_timestamp(val: number): void { bindings.UnsignedChannelUpdate_set_timestamp(this.ptr, val); } + /** + * Channel flags + */ public get_flags(): number { const ret: number = bindings.UnsignedChannelUpdate_get_flags(this.ptr); return ret; } + /** + * Channel flags + */ public set_flags(val: number): void { bindings.UnsignedChannelUpdate_set_flags(this.ptr, val); } + /** + * The number of blocks such that if: + * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta` + * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines + * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a + * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10, + * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before + * forwarding. Note that the HTLC sender is the one who originally sets this value when + * constructing the route. + */ public get_cltv_expiry_delta(): number { const ret: number = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this.ptr); return ret; } + /** + * The number of blocks such that if: + * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta` + * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines + * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a + * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10, + * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before + * forwarding. Note that the HTLC sender is the one who originally sets this value when + * constructing the route. + */ public set_cltv_expiry_delta(val: number): void { bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this.ptr, val); } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public get_htlc_minimum_msat(): bigint { const ret: bigint = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this.ptr); return ret; } + /** + * The minimum HTLC size incoming to sender, in milli-satoshi + */ public set_htlc_minimum_msat(val: bigint): void { bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this.ptr, val); } + /** + * The base HTLC fee charged by sender, in milli-satoshi + */ public get_fee_base_msat(): number { const ret: number = bindings.UnsignedChannelUpdate_get_fee_base_msat(this.ptr); return ret; } + /** + * The base HTLC fee charged by sender, in milli-satoshi + */ public set_fee_base_msat(val: number): void { bindings.UnsignedChannelUpdate_set_fee_base_msat(this.ptr, val); } + /** + * The amount to fee multiplier, in micro-satoshi + */ public get_fee_proportional_millionths(): number { const ret: number = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this.ptr); return ret; } + /** + * The amount to fee multiplier, in micro-satoshi + */ public set_fee_proportional_millionths(val: number): void { bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val); } @@ -365,6 +430,9 @@ export class UnsignedChannelUpdate extends CommonBase { return ret; } + /** + * Creates a copy of the UnsignedChannelUpdate + */ public clone(): UnsignedChannelUpdate { const ret: number = bindings.UnsignedChannelUpdate_clone(this.ptr); const ret_hu_conv: UnsignedChannelUpdate = new UnsignedChannelUpdate(null, ret); @@ -372,12 +440,18 @@ export class UnsignedChannelUpdate extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read + */ public write(): Uint8Array { const ret: number = bindings.UnsignedChannelUpdate_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write + */ public static constructor_read(ser: Uint8Array): Result_UnsignedChannelUpdateDecodeErrorZ { const ret: number = bindings.UnsignedChannelUpdate_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_UnsignedChannelUpdateDecodeErrorZ = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/UnsignedNodeAnnouncement.mts b/ts/structs/UnsignedNodeAnnouncement.mts index 128b8721..10664a5e 100644 --- a/ts/structs/UnsignedNodeAnnouncement.mts +++ b/ts/structs/UnsignedNodeAnnouncement.mts @@ -281,12 +281,18 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * The unsigned part of a node_announcement + */ export class UnsignedNodeAnnouncement extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.UnsignedNodeAnnouncement_free); } + /** + * The advertised features + */ public get_features(): NodeFeatures { const ret: number = bindings.UnsignedNodeAnnouncement_get_features(this.ptr); const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); @@ -294,49 +300,83 @@ export class UnsignedNodeAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * The advertised features + */ public set_features(val: NodeFeatures): void { bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * A strictly monotonic announcement counter, with gaps allowed + */ public get_timestamp(): number { const ret: number = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr); return ret; } + /** + * A strictly monotonic announcement counter, with gaps allowed + */ public set_timestamp(val: number): void { bindings.UnsignedNodeAnnouncement_set_timestamp(this.ptr, val); } + /** + * The node_id this announcement originated from (don't rebroadcast the node_announcement back + * to this node). + */ public get_node_id(): Uint8Array { const ret: number = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The node_id this announcement originated from (don't rebroadcast the node_announcement back + * to this node). + */ public set_node_id(val: Uint8Array): void { bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 33))); } + /** + * An RGB color for UI purposes + */ public get_rgb(): Uint8Array { const ret: number = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * An RGB color for UI purposes + */ public set_rgb(val: Uint8Array): void { bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 3))); } + /** + * An alias, for UI purposes. This should be sanitized before use. There is no guarantee + * of uniqueness. + */ public get_alias(): Uint8Array { const ret: number = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * An alias, for UI purposes. This should be sanitized before use. There is no guarantee + * of uniqueness. + */ public set_alias(val: Uint8Array): void { bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * List of addresses on which this node is reachable + */ public set_addresses(val: NetAddress[]): void { bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, bindings.encodeUint32Array(val != null ? val.map(val_conv_12 => CommonBase.get_ptr_of(val_conv_12)) : null)); } @@ -346,6 +386,9 @@ export class UnsignedNodeAnnouncement extends CommonBase { return ret; } + /** + * Creates a copy of the UnsignedNodeAnnouncement + */ public clone(): UnsignedNodeAnnouncement { const ret: number = bindings.UnsignedNodeAnnouncement_clone(this.ptr); const ret_hu_conv: UnsignedNodeAnnouncement = new UnsignedNodeAnnouncement(null, ret); @@ -353,12 +396,18 @@ export class UnsignedNodeAnnouncement extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read + */ public write(): Uint8Array { const ret: number = bindings.UnsignedNodeAnnouncement_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write + */ public static constructor_read(ser: Uint8Array): Result_UnsignedNodeAnnouncementDecodeErrorZ { const ret: number = bindings.UnsignedNodeAnnouncement_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_UnsignedNodeAnnouncementDecodeErrorZ = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/UpdateAddHTLC.mts b/ts/structs/UpdateAddHTLC.mts index 0cac05ed..28920be6 100644 --- a/ts/structs/UpdateAddHTLC.mts +++ b/ts/structs/UpdateAddHTLC.mts @@ -281,55 +281,88 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An update_add_htlc message to be sent or received from a peer + */ export class UpdateAddHTLC extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.UpdateAddHTLC_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.UpdateAddHTLC_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.UpdateAddHTLC_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The HTLC ID + */ public get_htlc_id(): bigint { const ret: bigint = bindings.UpdateAddHTLC_get_htlc_id(this.ptr); return ret; } + /** + * The HTLC ID + */ public set_htlc_id(val: bigint): void { bindings.UpdateAddHTLC_set_htlc_id(this.ptr, val); } + /** + * The HTLC value in milli-satoshi + */ public get_amount_msat(): bigint { const ret: bigint = bindings.UpdateAddHTLC_get_amount_msat(this.ptr); return ret; } + /** + * The HTLC value in milli-satoshi + */ public set_amount_msat(val: bigint): void { bindings.UpdateAddHTLC_set_amount_msat(this.ptr, val); } + /** + * The payment hash, the pre-image of which controls HTLC redemption + */ public get_payment_hash(): Uint8Array { const ret: number = bindings.UpdateAddHTLC_get_payment_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The payment hash, the pre-image of which controls HTLC redemption + */ public set_payment_hash(val: Uint8Array): void { bindings.UpdateAddHTLC_set_payment_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The expiry height of the HTLC + */ public get_cltv_expiry(): number { const ret: number = bindings.UpdateAddHTLC_get_cltv_expiry(this.ptr); return ret; } + /** + * The expiry height of the HTLC + */ public set_cltv_expiry(val: number): void { bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val); } @@ -339,6 +372,9 @@ export class UpdateAddHTLC extends CommonBase { return ret; } + /** + * Creates a copy of the UpdateAddHTLC + */ public clone(): UpdateAddHTLC { const ret: number = bindings.UpdateAddHTLC_clone(this.ptr); const ret_hu_conv: UpdateAddHTLC = new UpdateAddHTLC(null, ret); @@ -346,12 +382,18 @@ export class UpdateAddHTLC extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read + */ public write(): Uint8Array { const ret: number = bindings.UpdateAddHTLC_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write + */ public static constructor_read(ser: Uint8Array): Result_UpdateAddHTLCDecodeErrorZ { const ret: number = bindings.UpdateAddHTLC_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_UpdateAddHTLCDecodeErrorZ = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/UpdateFailHTLC.mts b/ts/structs/UpdateFailHTLC.mts index b840ffed..4352c080 100644 --- a/ts/structs/UpdateFailHTLC.mts +++ b/ts/structs/UpdateFailHTLC.mts @@ -281,27 +281,42 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An update_fail_htlc message to be sent or received from a peer + */ export class UpdateFailHTLC extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.UpdateFailHTLC_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.UpdateFailHTLC_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.UpdateFailHTLC_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The HTLC ID + */ public get_htlc_id(): bigint { const ret: bigint = bindings.UpdateFailHTLC_get_htlc_id(this.ptr); return ret; } + /** + * The HTLC ID + */ public set_htlc_id(val: bigint): void { bindings.UpdateFailHTLC_set_htlc_id(this.ptr, val); } @@ -311,6 +326,9 @@ export class UpdateFailHTLC extends CommonBase { return ret; } + /** + * Creates a copy of the UpdateFailHTLC + */ public clone(): UpdateFailHTLC { const ret: number = bindings.UpdateFailHTLC_clone(this.ptr); const ret_hu_conv: UpdateFailHTLC = new UpdateFailHTLC(null, ret); @@ -318,12 +336,18 @@ export class UpdateFailHTLC extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read + */ public write(): Uint8Array { const ret: number = bindings.UpdateFailHTLC_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write + */ public static constructor_read(ser: Uint8Array): Result_UpdateFailHTLCDecodeErrorZ { const ret: number = bindings.UpdateFailHTLC_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_UpdateFailHTLCDecodeErrorZ = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/UpdateFailMalformedHTLC.mts b/ts/structs/UpdateFailMalformedHTLC.mts index e72a3ac2..ed7e1231 100644 --- a/ts/structs/UpdateFailMalformedHTLC.mts +++ b/ts/structs/UpdateFailMalformedHTLC.mts @@ -281,36 +281,57 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An update_fail_malformed_htlc message to be sent or received from a peer + */ export class UpdateFailMalformedHTLC extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.UpdateFailMalformedHTLC_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.UpdateFailMalformedHTLC_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The HTLC ID + */ public get_htlc_id(): bigint { const ret: bigint = bindings.UpdateFailMalformedHTLC_get_htlc_id(this.ptr); return ret; } + /** + * The HTLC ID + */ public set_htlc_id(val: bigint): void { bindings.UpdateFailMalformedHTLC_set_htlc_id(this.ptr, val); } + /** + * The failure code + */ public get_failure_code(): number { const ret: number = bindings.UpdateFailMalformedHTLC_get_failure_code(this.ptr); return ret; } + /** + * The failure code + */ public set_failure_code(val: number): void { bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val); } @@ -320,6 +341,9 @@ export class UpdateFailMalformedHTLC extends CommonBase { return ret; } + /** + * Creates a copy of the UpdateFailMalformedHTLC + */ public clone(): UpdateFailMalformedHTLC { const ret: number = bindings.UpdateFailMalformedHTLC_clone(this.ptr); const ret_hu_conv: UpdateFailMalformedHTLC = new UpdateFailMalformedHTLC(null, ret); @@ -327,12 +351,18 @@ export class UpdateFailMalformedHTLC extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read + */ public write(): Uint8Array { const ret: number = bindings.UpdateFailMalformedHTLC_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write + */ public static constructor_read(ser: Uint8Array): Result_UpdateFailMalformedHTLCDecodeErrorZ { const ret: number = bindings.UpdateFailMalformedHTLC_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_UpdateFailMalformedHTLCDecodeErrorZ = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/UpdateFee.mts b/ts/structs/UpdateFee.mts index b0621bfc..c09ea4fc 100644 --- a/ts/structs/UpdateFee.mts +++ b/ts/structs/UpdateFee.mts @@ -281,31 +281,49 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An update_fee message to be sent or received from a peer + */ export class UpdateFee extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.UpdateFee_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.UpdateFee_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.UpdateFee_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Fee rate per 1000-weight of the transaction + */ public get_feerate_per_kw(): number { const ret: number = bindings.UpdateFee_get_feerate_per_kw(this.ptr); return ret; } + /** + * Fee rate per 1000-weight of the transaction + */ public set_feerate_per_kw(val: number): void { bindings.UpdateFee_set_feerate_per_kw(this.ptr, val); } + /** + * Constructs a new UpdateFee given each field + */ public static constructor_new(channel_id_arg: Uint8Array, feerate_per_kw_arg: number): UpdateFee { const ret: number = bindings.UpdateFee_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), feerate_per_kw_arg); const ret_hu_conv: UpdateFee = new UpdateFee(null, ret); @@ -318,6 +336,9 @@ export class UpdateFee extends CommonBase { return ret; } + /** + * Creates a copy of the UpdateFee + */ public clone(): UpdateFee { const ret: number = bindings.UpdateFee_clone(this.ptr); const ret_hu_conv: UpdateFee = new UpdateFee(null, ret); @@ -325,12 +346,18 @@ export class UpdateFee extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read + */ public write(): Uint8Array { const ret: number = bindings.UpdateFee_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a UpdateFee from a byte array, created by UpdateFee_write + */ public static constructor_read(ser: Uint8Array): Result_UpdateFeeDecodeErrorZ { const ret: number = bindings.UpdateFee_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_UpdateFeeDecodeErrorZ = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/UpdateFulfillHTLC.mts b/ts/structs/UpdateFulfillHTLC.mts index 96646664..ef67bf76 100644 --- a/ts/structs/UpdateFulfillHTLC.mts +++ b/ts/structs/UpdateFulfillHTLC.mts @@ -281,41 +281,65 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * An update_fulfill_htlc message to be sent or received from a peer + */ export class UpdateFulfillHTLC extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.UpdateFulfillHTLC_free); } + /** + * The channel ID + */ public get_channel_id(): Uint8Array { const ret: number = bindings.UpdateFulfillHTLC_get_channel_id(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The channel ID + */ public set_channel_id(val: Uint8Array): void { bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * The HTLC ID + */ public get_htlc_id(): bigint { const ret: bigint = bindings.UpdateFulfillHTLC_get_htlc_id(this.ptr); return ret; } + /** + * The HTLC ID + */ public set_htlc_id(val: bigint): void { bindings.UpdateFulfillHTLC_set_htlc_id(this.ptr, val); } + /** + * The pre-image of the payment hash, allowing HTLC redemption + */ public get_payment_preimage(): Uint8Array { const ret: number = bindings.UpdateFulfillHTLC_get_payment_preimage(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * The pre-image of the payment hash, allowing HTLC redemption + */ public set_payment_preimage(val: Uint8Array): void { bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Constructs a new UpdateFulfillHTLC given each field + */ public static constructor_new(channel_id_arg: Uint8Array, htlc_id_arg: bigint, payment_preimage_arg: Uint8Array): UpdateFulfillHTLC { const ret: number = bindings.UpdateFulfillHTLC_new(bindings.encodeUint8Array(bindings.check_arr_len(channel_id_arg, 32)), htlc_id_arg, bindings.encodeUint8Array(bindings.check_arr_len(payment_preimage_arg, 32))); const ret_hu_conv: UpdateFulfillHTLC = new UpdateFulfillHTLC(null, ret); @@ -328,6 +352,9 @@ export class UpdateFulfillHTLC extends CommonBase { return ret; } + /** + * Creates a copy of the UpdateFulfillHTLC + */ public clone(): UpdateFulfillHTLC { const ret: number = bindings.UpdateFulfillHTLC_clone(this.ptr); const ret_hu_conv: UpdateFulfillHTLC = new UpdateFulfillHTLC(null, ret); @@ -335,12 +362,18 @@ export class UpdateFulfillHTLC extends CommonBase { return ret_hu_conv; } + /** + * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read + */ public write(): Uint8Array { const ret: number = bindings.UpdateFulfillHTLC_write(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write + */ public static constructor_read(ser: Uint8Array): Result_UpdateFulfillHTLCDecodeErrorZ { const ret: number = bindings.UpdateFulfillHTLC_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_UpdateFulfillHTLCDecodeErrorZ = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/UserConfig.mts b/ts/structs/UserConfig.mts index c2e23991..0784ffd0 100644 --- a/ts/structs/UserConfig.mts +++ b/ts/structs/UserConfig.mts @@ -281,12 +281,21 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * Top-level config which holds ChannelHandshakeLimits and ChannelConfig. + * + * Default::default() provides sane defaults for most configurations + * (but currently with 0 relay fees!) + */ export class UserConfig extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.UserConfig_free); } + /** + * Channel config that we propose to our counterparty. + */ public get_own_channel_config(): ChannelHandshakeConfig { const ret: number = bindings.UserConfig_get_own_channel_config(this.ptr); const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); @@ -294,10 +303,16 @@ export class UserConfig extends CommonBase { return ret_hu_conv; } + /** + * Channel config that we propose to our counterparty. + */ public set_own_channel_config(val: ChannelHandshakeConfig): void { bindings.UserConfig_set_own_channel_config(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Limits applied to our counterparty's proposed channel config settings. + */ public get_peer_channel_config_limits(): ChannelHandshakeLimits { const ret: number = bindings.UserConfig_get_peer_channel_config_limits(this.ptr); const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret); @@ -305,10 +320,16 @@ export class UserConfig extends CommonBase { return ret_hu_conv; } + /** + * Limits applied to our counterparty's proposed channel config settings. + */ public set_peer_channel_config_limits(val: ChannelHandshakeLimits): void { bindings.UserConfig_set_peer_channel_config_limits(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Channel config which affects behavior during channel lifetime. + */ public get_channel_options(): ChannelConfig { const ret: number = bindings.UserConfig_get_channel_options(this.ptr); const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); @@ -316,28 +337,78 @@ export class UserConfig extends CommonBase { return ret_hu_conv; } + /** + * Channel config which affects behavior during channel lifetime. + */ public set_channel_options(val: ChannelConfig): void { bindings.UserConfig_set_channel_options(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * If this is set to false, we will reject any HTLCs which were to be forwarded over private + * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a + * node which is not online reliably. + * + * For nodes which are not online reliably, you should set all channels to *not* be announced + * (using [`ChannelConfig::announced_channel`] and + * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to + * ensure you are not exposed to any forwarding risk. + * + * Note that because you cannot change a channel's announced state after creation, there is no + * way to disable forwarding on public channels retroactively. Thus, in order to change a node + * from a publicly-announced forwarding node to a private non-forwarding node you must close + * all your channels and open new ones. For privacy, you should also change your node_id + * (swapping all private and public key material for new ones) at that time. + * + * Default value: false. + */ public get_accept_forwards_to_priv_channels(): boolean { const ret: boolean = bindings.UserConfig_get_accept_forwards_to_priv_channels(this.ptr); return ret; } + /** + * If this is set to false, we will reject any HTLCs which were to be forwarded over private + * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a + * node which is not online reliably. + * + * For nodes which are not online reliably, you should set all channels to *not* be announced + * (using [`ChannelConfig::announced_channel`] and + * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to + * ensure you are not exposed to any forwarding risk. + * + * Note that because you cannot change a channel's announced state after creation, there is no + * way to disable forwarding on public channels retroactively. Thus, in order to change a node + * from a publicly-announced forwarding node to a private non-forwarding node you must close + * all your channels and open new ones. For privacy, you should also change your node_id + * (swapping all private and public key material for new ones) at that time. + * + * Default value: false. + */ public set_accept_forwards_to_priv_channels(val: boolean): void { bindings.UserConfig_set_accept_forwards_to_priv_channels(this.ptr, val); } + /** + * If this is set to false, we do not accept inbound requests to open a new channel. + * Default value: true. + */ public get_accept_inbound_channels(): boolean { const ret: boolean = bindings.UserConfig_get_accept_inbound_channels(this.ptr); return ret; } + /** + * If this is set to false, we do not accept inbound requests to open a new channel. + * Default value: true. + */ public set_accept_inbound_channels(val: boolean): void { bindings.UserConfig_set_accept_inbound_channels(this.ptr, val); } + /** + * Constructs a new UserConfig given each field + */ public static constructor_new(own_channel_config_arg: ChannelHandshakeConfig, peer_channel_config_limits_arg: ChannelHandshakeLimits, channel_options_arg: ChannelConfig, accept_forwards_to_priv_channels_arg: boolean, accept_inbound_channels_arg: boolean): UserConfig { const ret: number = bindings.UserConfig_new(own_channel_config_arg == null ? 0 : CommonBase.get_ptr_of(own_channel_config_arg) & ~1, peer_channel_config_limits_arg == null ? 0 : CommonBase.get_ptr_of(peer_channel_config_limits_arg) & ~1, channel_options_arg == null ? 0 : CommonBase.get_ptr_of(channel_options_arg) & ~1, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg); const ret_hu_conv: UserConfig = new UserConfig(null, ret); @@ -350,6 +421,9 @@ export class UserConfig extends CommonBase { return ret; } + /** + * Creates a copy of the UserConfig + */ public clone(): UserConfig { const ret: number = bindings.UserConfig_clone(this.ptr); const ret_hu_conv: UserConfig = new UserConfig(null, ret); @@ -357,6 +431,9 @@ export class UserConfig extends CommonBase { return ret_hu_conv; } + /** + * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used. + */ public static constructor_default(): UserConfig { const ret: number = bindings.UserConfig_default(); const ret_hu_conv: UserConfig = new UserConfig(null, ret); diff --git a/ts/structs/UtilMethods.mts b/ts/structs/UtilMethods.mts index 243c2f68..7032f0ce 100644 --- a/ts/structs/UtilMethods.mts +++ b/ts/structs/UtilMethods.mts @@ -283,51 +283,81 @@ import * as bindings from '../bindings.mjs' export class UtilMethods extends CommonBase { + /** + * Constructs a new COption_NoneZ containing a + */ public static constructor_COption_NoneZ_some(): COption_NoneZ { const ret: COption_NoneZ = bindings.COption_NoneZ_some(); return ret; } + /** + * Constructs a new COption_NoneZ containing nothing + */ public static constructor_COption_NoneZ_none(): COption_NoneZ { const ret: COption_NoneZ = bindings.COption_NoneZ_none(); return ret; } + /** + * Read a ClosureReason from a byte array, created by ClosureReason_write + */ public static constructor_ClosureReason_read(ser: Uint8Array): Result_COption_ClosureReasonZDecodeErrorZ { const ret: number = bindings.ClosureReason_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_COption_ClosureReasonZDecodeErrorZ = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Read a Event from a byte array, created by Event_write + */ public static constructor_Event_read(ser: Uint8Array): Result_COption_EventZDecodeErrorZ { const ret: number = bindings.Event_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_COption_EventZDecodeErrorZ = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Creates a digital signature of a message given a SecretKey, like the node's secret. + * A receiver knowing the PublicKey (e.g. the node's id) and the message can be sure that the signature was generated by the caller. + * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted. + */ public static constructor_sign(msg: Uint8Array, sk: Uint8Array): Result_StringErrorZ { const ret: number = bindings.sign(bindings.encodeUint8Array(msg), bindings.encodeUint8Array(bindings.check_arr_len(sk, 32))); const ret_hu_conv: Result_StringErrorZ = Result_StringErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Recovers the PublicKey of the signer of the message given the message and the signature. + */ public static constructor_recover_pk(msg: Uint8Array, sig: string): Result_PublicKeyErrorZ { const ret: number = bindings.recover_pk(bindings.encodeUint8Array(msg), bindings.encodeString(sig)); const ret_hu_conv: Result_PublicKeyErrorZ = Result_PublicKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature, + * and the PublicKey. + */ public static constructor_verify(msg: Uint8Array, sig: string, pk: Uint8Array): boolean { const ret: boolean = bindings.verify(bindings.encodeUint8Array(msg), bindings.encodeString(sig), bindings.encodeUint8Array(bindings.check_arr_len(pk, 33))); return ret; } + /** + * Read a MonitorEvent from a byte array, created by MonitorEvent_write + */ public static constructor_MonitorEvent_read(ser: Uint8Array): Result_COption_MonitorEventZDecodeErrorZ { const ret: number = bindings.MonitorEvent_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_COption_MonitorEventZDecodeErrorZ = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write + */ public static constructor_C2Tuple_BlockHashChannelMonitorZ_read(ser: Uint8Array, arg: KeysInterface): Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { const ret: number = bindings.C2Tuple_BlockHashChannelMonitorZ_read(bindings.encodeUint8Array(ser), arg == null ? 0 : CommonBase.get_ptr_of(arg)); const ret_hu_conv: Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); @@ -335,6 +365,9 @@ export class UtilMethods extends CommonBase { return ret_hu_conv; } + /** + * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write + */ public static constructor_C2Tuple_BlockHashChannelManagerZ_read(ser: Uint8Array, arg_keys_manager: KeysInterface, arg_fee_estimator: FeeEstimator, arg_chain_monitor: Watch, arg_tx_broadcaster: BroadcasterInterface, arg_logger: Logger, arg_default_config: UserConfig, arg_channel_monitors: ChannelMonitor[]): Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { const ret: number = bindings.C2Tuple_BlockHashChannelManagerZ_read(bindings.encodeUint8Array(ser), bindings.ChannelManagerReadArgs_new(arg_keys_manager == null ? 0 : CommonBase.get_ptr_of(arg_keys_manager), arg_fee_estimator == null ? 0 : CommonBase.get_ptr_of(arg_fee_estimator), arg_chain_monitor == null ? 0 : CommonBase.get_ptr_of(arg_chain_monitor), arg_tx_broadcaster == null ? 0 : CommonBase.get_ptr_of(arg_tx_broadcaster), arg_logger == null ? 0 : CommonBase.get_ptr_of(arg_logger), arg_default_config == null ? 0 : CommonBase.get_ptr_of(arg_default_config) & ~1, bindings.encodeUint32Array(arg_channel_monitors != null ? arg_channel_monitors.map(arg_channel_monitors_conv_16 => arg_channel_monitors_conv_16 == null ? 0 : CommonBase.get_ptr_of(arg_channel_monitors_conv_16) & ~1) : null))); const ret_hu_conv: Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret); @@ -348,93 +381,217 @@ export class UtilMethods extends CommonBase { return ret_hu_conv; } + /** + * Gets the weight for an HTLC-Success transaction. + */ public static constructor_htlc_success_tx_weight(opt_anchors: boolean): bigint { const ret: bigint = bindings.htlc_success_tx_weight(opt_anchors); return ret; } + /** + * Gets the weight for an HTLC-Timeout transaction. + */ public static constructor_htlc_timeout_tx_weight(opt_anchors: boolean): bigint { const ret: bigint = bindings.htlc_timeout_tx_weight(opt_anchors); return ret; } + /** + * Build the commitment secret from the seed and the commitment number + */ public static constructor_build_commitment_secret(commitment_seed: Uint8Array, idx: bigint): Uint8Array { const ret: number = bindings.build_commitment_secret(bindings.encodeUint8Array(bindings.check_arr_len(commitment_seed, 32)), idx); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Build a closing transaction + */ public static constructor_build_closing_transaction(to_holder_value_sat: bigint, to_counterparty_value_sat: bigint, to_holder_script: Uint8Array, to_counterparty_script: Uint8Array, funding_outpoint: OutPoint): Uint8Array { const ret: number = bindings.build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, bindings.encodeUint8Array(to_holder_script), bindings.encodeUint8Array(to_counterparty_script), funding_outpoint == null ? 0 : CommonBase.get_ptr_of(funding_outpoint) & ~1); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key) + * from the base secret and the per_commitment_point. + * + * Note that this is infallible iff we trust that at least one of the two input keys are randomly + * generated (ie our own). + */ public static constructor_derive_private_key(per_commitment_point: Uint8Array, base_secret: Uint8Array): Result_SecretKeyErrorZ { const ret: number = bindings.derive_private_key(bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point, 33)), bindings.encodeUint8Array(bindings.check_arr_len(base_secret, 32))); const ret_hu_conv: Result_SecretKeyErrorZ = Result_SecretKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key) + * from the base point and the per_commitment_key. This is the public equivalent of + * derive_private_key - using only public keys to derive a public key instead of private keys. + * + * Note that this is infallible iff we trust that at least one of the two input keys are randomly + * generated (ie our own). + */ public static constructor_derive_public_key(per_commitment_point: Uint8Array, base_point: Uint8Array): Result_PublicKeyErrorZ { const ret: number = bindings.derive_public_key(bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point, 33)), bindings.encodeUint8Array(bindings.check_arr_len(base_point, 33))); const ret_hu_conv: Result_PublicKeyErrorZ = Result_PublicKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Derives a per-commitment-transaction revocation key from its constituent parts. + * + * Only the cheating participant owns a valid witness to propagate a revoked + * commitment transaction, thus per_commitment_secret always come from cheater + * and revocation_base_secret always come from punisher, which is the broadcaster + * of the transaction spending with this key knowledge. + * + * Note that this is infallible iff we trust that at least one of the two input keys are randomly + * generated (ie our own). + */ public static constructor_derive_private_revocation_key(per_commitment_secret: Uint8Array, countersignatory_revocation_base_secret: Uint8Array): Result_SecretKeyErrorZ { const ret: number = bindings.derive_private_revocation_key(bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_secret, 32)), bindings.encodeUint8Array(bindings.check_arr_len(countersignatory_revocation_base_secret, 32))); const ret_hu_conv: Result_SecretKeyErrorZ = Result_SecretKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Derives a per-commitment-transaction revocation public key from its constituent parts. This is + * the public equivalend of derive_private_revocation_key - using only public keys to derive a + * public key instead of private keys. + * + * Only the cheating participant owns a valid witness to propagate a revoked + * commitment transaction, thus per_commitment_point always come from cheater + * and revocation_base_point always come from punisher, which is the broadcaster + * of the transaction spending with this key knowledge. + * + * Note that this is infallible iff we trust that at least one of the two input keys are randomly + * generated (ie our own). + */ public static constructor_derive_public_revocation_key(per_commitment_point: Uint8Array, countersignatory_revocation_base_point: Uint8Array): Result_PublicKeyErrorZ { const ret: number = bindings.derive_public_revocation_key(bindings.encodeUint8Array(bindings.check_arr_len(per_commitment_point, 33)), bindings.encodeUint8Array(bindings.check_arr_len(countersignatory_revocation_base_point, 33))); const ret_hu_conv: Result_PublicKeyErrorZ = Result_PublicKeyErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * A script either spendable by the revocation + * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain. + * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions. + */ public static constructor_get_revokeable_redeemscript(revocation_key: Uint8Array, contest_delay: number, broadcaster_delayed_payment_key: Uint8Array): Uint8Array { const ret: number = bindings.get_revokeable_redeemscript(bindings.encodeUint8Array(bindings.check_arr_len(revocation_key, 33)), contest_delay, bindings.encodeUint8Array(bindings.check_arr_len(broadcaster_delayed_payment_key, 33))); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc + * does not need to have its previous_output_index filled. + */ public static constructor_get_htlc_redeemscript(htlc: HTLCOutputInCommitment, opt_anchors: boolean, keys: TxCreationKeys): Uint8Array { const ret: number = bindings.get_htlc_redeemscript(htlc == null ? 0 : CommonBase.get_ptr_of(htlc) & ~1, opt_anchors, keys == null ? 0 : CommonBase.get_ptr_of(keys) & ~1); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Gets the redeemscript for a funding output from the two funding public keys. + * Note that the order of funding public keys does not matter. + */ public static constructor_make_funding_redeemscript(broadcaster: Uint8Array, countersignatory: Uint8Array): Uint8Array { const ret: number = bindings.make_funding_redeemscript(bindings.encodeUint8Array(bindings.check_arr_len(broadcaster, 33)), bindings.encodeUint8Array(bindings.check_arr_len(countersignatory, 33))); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC + * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the + * transaction which needs signing, and can be used to construct an HTLC transaction which is + * broadcastable given a counterparty HTLC signature. + * + * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the + * commitment transaction). + */ public static constructor_build_htlc_transaction(commitment_txid: Uint8Array, feerate_per_kw: number, contest_delay: number, htlc: HTLCOutputInCommitment, opt_anchors: boolean, broadcaster_delayed_payment_key: Uint8Array, revocation_key: Uint8Array): Uint8Array { const ret: number = bindings.build_htlc_transaction(bindings.encodeUint8Array(bindings.check_arr_len(commitment_txid, 32)), feerate_per_kw, contest_delay, htlc == null ? 0 : CommonBase.get_ptr_of(htlc) & ~1, opt_anchors, bindings.encodeUint8Array(bindings.check_arr_len(broadcaster_delayed_payment_key, 33)), bindings.encodeUint8Array(bindings.check_arr_len(revocation_key, 33))); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Gets the witnessScript for an anchor output from the funding public key. + * The witness in the spending input must be: + * + * After 16 blocks of confirmation, an alternative satisfying witness could be: + * <> + * (empty vector required to satisfy compliance with MINIMALIF-standard rule) + */ public static constructor_get_anchor_redeemscript(funding_pubkey: Uint8Array): Uint8Array { const ret: number = bindings.get_anchor_redeemscript(bindings.encodeUint8Array(bindings.check_arr_len(funding_pubkey, 33))); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a + * shared secret first. This prevents on-chain observers from discovering how many commitment + * transactions occurred in a channel before it was closed. + * + * This function gets the shared secret from relevant channel public keys and can be used to + * \"decrypt\" the commitment transaction number given a commitment transaction on-chain. + */ public static constructor_get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint: Uint8Array, countersignatory_payment_basepoint: Uint8Array, outbound_from_broadcaster: boolean): bigint { const ret: bigint = bindings.get_commitment_transaction_number_obscure_factor(bindings.encodeUint8Array(bindings.check_arr_len(broadcaster_payment_basepoint, 33)), bindings.encodeUint8Array(bindings.check_arr_len(countersignatory_payment_basepoint, 33)), outbound_from_broadcaster); return ret; } + /** + * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write + */ public static constructor_NetworkUpdate_read(ser: Uint8Array): Result_COption_NetworkUpdateZDecodeErrorZ { const ret: number = bindings.NetworkUpdate_read(bindings.encodeUint8Array(ser)); const ret_hu_conv: Result_COption_NetworkUpdateZDecodeErrorZ = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Finds a route from us (payer) to the given target node (payee). + * + * If the payee provided features in their invoice, they should be provided via `params.payee`. + * Without this, MPP will only be used if the payee's features are available in the network graph. + * + * Private routing paths between a public node and the target may be included in `params.payee`. + * + * If some channels aren't announced, it may be useful to fill in `first_hops` with the results + * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of our local + * channels from [`NetworkGraph`] will be ignored, and only those in `first_hops` will be used. + * + * The fees on channels from us to the next hop are ignored as they are assumed to all be equal. + * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` / + * `htlc_maximum_msat` *are* checked as they may change based on the receiving node. + * + * # Note + * + * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any + * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this + * function. + * + * # Panics + * + * Panics if first_hops contains channels without short_channel_ids; + * [`ChannelManager::list_usable_channels`] will never include such channels. + * + * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels + * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed + * + * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public static constructor_find_route(our_node_pubkey: Uint8Array, params: RouteParameters, network: NetworkGraph, first_hops: ChannelDetails[], logger: Logger, scorer: Score): Result_RouteLightningErrorZ { const ret: number = bindings.find_route(bindings.encodeUint8Array(bindings.check_arr_len(our_node_pubkey, 33)), params == null ? 0 : CommonBase.get_ptr_of(params) & ~1, network == null ? 0 : CommonBase.get_ptr_of(network) & ~1, bindings.encodeUint32Array(first_hops != null ? first_hops.map(first_hops_conv_16 => first_hops_conv_16 == null ? 0 : CommonBase.get_ptr_of(first_hops_conv_16) & ~1) : null), logger == null ? 0 : CommonBase.get_ptr_of(logger), scorer == null ? 0 : CommonBase.get_ptr_of(scorer)); const ret_hu_conv: Result_RouteLightningErrorZ = Result_RouteLightningErrorZ.constr_from_ptr(ret); diff --git a/ts/structs/Watch.mts b/ts/structs/Watch.mts index 772ec08f..736d77ee 100644 --- a/ts/structs/Watch.mts +++ b/ts/structs/Watch.mts @@ -283,9 +283,40 @@ import * as bindings from '../bindings.mjs' +/** An implementation of Watch */ export interface WatchInterface { + /**Watches a channel identified by `funding_txo` using `monitor`. + * + * Implementations are responsible for watching the chain for the funding transaction along + * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means + * calling [`block_connected`] and [`block_disconnected`] on the monitor. + * + * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if + * the given `funding_txo` has previously been registered via `watch_channel`. + * + * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch + * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected + * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected + */ watch_channel(funding_txo: OutPoint, monitor: ChannelMonitor): Result_NoneChannelMonitorUpdateErrZ; + /**Updates a channel identified by `funding_txo` by applying `update` to its monitor. + * + * Implementations must call [`update_monitor`] with the given update. See + * [`ChannelMonitorUpdateErr`] for invariants around returning an error. + * + * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor + */ update_channel(funding_txo: OutPoint, update: ChannelMonitorUpdate): Result_NoneChannelMonitorUpdateErrZ; + /**Returns any monitor events since the last call. Subsequent calls must only return new + * events. + * + * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no + * further events may be returned here until the [`ChannelMonitor`] has been fully persisted + * to disk. + * + * For details on asynchronous [`ChannelMonitor`] updating and returning + * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`]. + */ release_pending_monitor_events(): MonitorEvent[]; } @@ -293,6 +324,27 @@ class LDKWatchHolder { held: Watch; } +/** + * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as + * blocks are connected and disconnected. + * + * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are + * responsible for maintaining a set of monitors such that they can be updated accordingly as + * channel state changes and HTLCs are resolved. See method documentation for specific + * requirements. + * + * Implementations **must** ensure that updates are successfully applied and persisted upon method + * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down + * without taking any further action such as persisting the current state. + * + * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing + * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it + * could result in a revoked transaction being broadcast, allowing the counterparty to claim all + * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle + * multiple instances. + * + * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure + */ export class Watch extends CommonBase { /* @internal */ public bindings_instance?: bindings.LDKWatch; @@ -303,7 +355,8 @@ export class Watch extends CommonBase { this.bindings_instance = null; } - static new_impl(arg: WatchInterface): Watch { + /** Creates a new instance of Watch from a given implementation */ + public static new_impl(arg: WatchInterface): Watch { const impl_holder: LDKWatchHolder = new LDKWatchHolder(); let structImplementation = { watch_channel (funding_txo: number, monitor: number): number { @@ -336,18 +389,52 @@ export class Watch extends CommonBase { impl_holder.held.bindings_instance = structImplementation; return impl_holder.held; } + + /** + * Watches a channel identified by `funding_txo` using `monitor`. + * + * Implementations are responsible for watching the chain for the funding transaction along + * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means + * calling [`block_connected`] and [`block_disconnected`] on the monitor. + * + * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if + * the given `funding_txo` has previously been registered via `watch_channel`. + * + * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch + * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected + * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected + */ public watch_channel(funding_txo: OutPoint, monitor: ChannelMonitor): Result_NoneChannelMonitorUpdateErrZ { const ret: number = bindings.Watch_watch_channel(this.ptr, funding_txo == null ? 0 : CommonBase.get_ptr_of(funding_txo) & ~1, monitor == null ? 0 : CommonBase.get_ptr_of(monitor) & ~1); const ret_hu_conv: Result_NoneChannelMonitorUpdateErrZ = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Updates a channel identified by `funding_txo` by applying `update` to its monitor. + * + * Implementations must call [`update_monitor`] with the given update. See + * [`ChannelMonitorUpdateErr`] for invariants around returning an error. + * + * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor + */ public update_channel(funding_txo: OutPoint, update: ChannelMonitorUpdate): Result_NoneChannelMonitorUpdateErrZ { const ret: number = bindings.Watch_update_channel(this.ptr, funding_txo == null ? 0 : CommonBase.get_ptr_of(funding_txo) & ~1, update == null ? 0 : CommonBase.get_ptr_of(update) & ~1); const ret_hu_conv: Result_NoneChannelMonitorUpdateErrZ = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); return ret_hu_conv; } + /** + * Returns any monitor events since the last call. Subsequent calls must only return new + * events. + * + * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no + * further events may be returned here until the [`ChannelMonitor`] has been fully persisted + * to disk. + * + * For details on asynchronous [`ChannelMonitor`] updating and returning + * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`]. + */ public release_pending_monitor_events(): MonitorEvent[] { const ret: number = bindings.Watch_release_pending_monitor_events(this.ptr); const ret_conv_14_len: number = bindings.getArrayLength(ret); @@ -358,6 +445,7 @@ export class Watch extends CommonBase { CommonBase.add_ref_from(ret_conv_14_hu_conv, this); ret_conv_14_arr[o] = ret_conv_14_hu_conv; } + bindings.freeWasmMemory(ret) return ret_conv_14_arr; } diff --git a/ts/structs/WatchedOutput.mts b/ts/structs/WatchedOutput.mts index 018efefb..f8e3d47e 100644 --- a/ts/structs/WatchedOutput.mts +++ b/ts/structs/WatchedOutput.mts @@ -281,22 +281,48 @@ import CommonBase from './CommonBase.mjs'; import * as bindings from '../bindings.mjs' +/** + * A transaction output watched by a [`ChannelMonitor`] for spends on-chain. + * + * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction + * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via + * the return value of [`Filter::register_output`]. + * + * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and + * may have been spent there. See [`Filter::register_output`] for details. + * + * [`ChannelMonitor`]: channelmonitor::ChannelMonitor + * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected + */ export class WatchedOutput extends CommonBase { /* @internal */ public constructor(_dummy: object, ptr: number) { super(ptr, bindings.WatchedOutput_free); } + /** + * First block where the transaction output may have been spent. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public get_block_hash(): Uint8Array { const ret: number = bindings.WatchedOutput_get_block_hash(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * First block where the transaction output may have been spent. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ public set_block_hash(val: Uint8Array): void { bindings.WatchedOutput_set_block_hash(this.ptr, bindings.encodeUint8Array(bindings.check_arr_len(val, 32))); } + /** + * Outpoint identifying the transaction output. + */ public get_outpoint(): OutPoint { const ret: number = bindings.WatchedOutput_get_outpoint(this.ptr); const ret_hu_conv: OutPoint = new OutPoint(null, ret); @@ -304,20 +330,32 @@ export class WatchedOutput extends CommonBase { return ret_hu_conv; } + /** + * Outpoint identifying the transaction output. + */ public set_outpoint(val: OutPoint): void { bindings.WatchedOutput_set_outpoint(this.ptr, val == null ? 0 : CommonBase.get_ptr_of(val) & ~1); } + /** + * Spending condition of the transaction output. + */ public get_script_pubkey(): Uint8Array { const ret: number = bindings.WatchedOutput_get_script_pubkey(this.ptr); const ret_conv: Uint8Array = bindings.decodeUint8Array(ret); return ret_conv; } + /** + * Spending condition of the transaction output. + */ public set_script_pubkey(val: Uint8Array): void { bindings.WatchedOutput_set_script_pubkey(this.ptr, bindings.encodeUint8Array(val)); } + /** + * Constructs a new WatchedOutput given each field + */ public static constructor_new(block_hash_arg: Uint8Array, outpoint_arg: OutPoint, script_pubkey_arg: Uint8Array): WatchedOutput { const ret: number = bindings.WatchedOutput_new(bindings.encodeUint8Array(bindings.check_arr_len(block_hash_arg, 32)), outpoint_arg == null ? 0 : CommonBase.get_ptr_of(outpoint_arg) & ~1, bindings.encodeUint8Array(script_pubkey_arg)); const ret_hu_conv: WatchedOutput = new WatchedOutput(null, ret); @@ -330,6 +368,9 @@ export class WatchedOutput extends CommonBase { return ret; } + /** + * Creates a copy of the WatchedOutput + */ public clone(): WatchedOutput { const ret: number = bindings.WatchedOutput_clone(this.ptr); const ret_hu_conv: WatchedOutput = new WatchedOutput(null, ret); @@ -337,6 +378,9 @@ export class WatchedOutput extends CommonBase { return ret_hu_conv; } + /** + * Checks if two WatchedOutputs contain equal inner contents. + */ public hash(): bigint { const ret: bigint = bindings.WatchedOutput_hash(this.ptr); return ret; diff --git a/ts/version.mts b/ts/version.mts deleted file mode 100644 index e69de29b..00000000