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)
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; \
}
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;
}
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) {
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;
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;
}
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;
}
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;
}
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;
}
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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) {
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);
}
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);
}
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;
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);
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;
}
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;
}
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;
}
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;
}
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) {
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) {
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){
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
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;
}
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) {
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;
}
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) {
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) {
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;
}
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;
}
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;
}
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;
}
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) {
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;
}
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;
}
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;
}
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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) {
}
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;
}
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);
}
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;
}
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;
}
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){
}
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;
}
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) {
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);
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);
}
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);
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);
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);
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);
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);
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);
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);
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;
}
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;
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;
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;
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));
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;
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;
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;
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;
}
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) {
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;
}
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;
}
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;
}
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){
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
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) {
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;
}
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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) {
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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){
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);
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){
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;
}
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;
}
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){
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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);
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) {
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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){
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;
}
}
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;
}
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;
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;
}
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;
}
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;
}
}
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);
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;
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;
}
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);
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;
}
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){
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;
}
}
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;
}
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;
}
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) {
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;
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;
}
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;
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;
}
}
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;
}
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;
}
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;
}
}
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;
}
}
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;
}
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){
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;
}
}
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;
}
}
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;
}
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){
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){
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;
}
}
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;
}
}
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;
}
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;
}
}
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;
}
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;
}
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);
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);
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);
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;
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;
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;
}
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);
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);
}
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) {
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) {
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);
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);
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);
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) {
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;
}
}
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;
}
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);
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;
}
}
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;
}
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;
}
}
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;
}
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;
}
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);
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;
}
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;
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;
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;
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);
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);
}
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);
}
}
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);
}
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);
}
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;
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;
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;
}
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);
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);
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;
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;
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 {
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
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);
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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);
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);
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);
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);
}
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;
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;
}
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;
}
}
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);
}
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);
}
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);
}
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);
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;
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;
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;
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);
}
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;
}
}
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;
}
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);
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);
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);
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);
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 {
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);
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 {
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);
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);
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);
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);
}
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;
*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);
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;
}
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;
}
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;
}
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) {
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;
}
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;
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;
}
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;
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;
}
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;
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
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() {
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);
}
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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);
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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);
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;
}
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;
}
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) {
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) {
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);
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;
}
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() {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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);
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
// 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) {
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);
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) {
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) {
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);
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;
}
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) {
// 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) {
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);
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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);
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) {
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) {
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);
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;
}
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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);
_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);
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
}
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);
_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);
_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);
_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);
_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;
}
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;
}
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);
_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);
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;
}
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);
_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);
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;
}
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);
_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);
_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);
_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);
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;
}
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);
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);
}
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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;
_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;
_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;
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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;
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);
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;
}
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;
}
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) {
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) {
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);
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;
}
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) {
_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;
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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;
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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;
}
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);
_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);
_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);
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) {
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) {
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);
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;
}
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;
}
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) {
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);
_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);
_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;
_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);
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);
}
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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;
}
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);
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;
}
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);
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;
}
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) {
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) {
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);
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;
}
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);
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;
}
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;
}
_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);
}
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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);
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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);
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) {
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) {
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);
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;
}
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) {
_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;
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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);
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;
}
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;
}
// 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) {
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) {
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);
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) {
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) {
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);
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) {
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) {
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);
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) {
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) {
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);
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) {
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) {
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);
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) {
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) {
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);
}
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) {
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) {
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);
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;
}
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) {
_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;
_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;
_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;
_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;
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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;
}
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);
}
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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);
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;
}
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) {
_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);
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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);
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) {
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);
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;
}
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);
// 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) {
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);
_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;
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) {
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);
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;
}
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);
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;
}
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;
}
_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);
_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);
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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;
}
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;
}
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);
}
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) {
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);
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;
}
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;
}
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);
}
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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;
}
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) {
_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;
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);
// 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);
}
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) {
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) {
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);
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);
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;
}
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);
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;
}
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;
}
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;
}
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;
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);
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;
}
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;
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);
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;
}
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;
}
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;
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);
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;
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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;
}
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;
}
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;
}
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);
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);
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);
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);
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);
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);
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);
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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);
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);
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);
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);
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;
}
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);
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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);
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);
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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) {
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;
}
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) {
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) {
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) {
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) {
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) {
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;
}
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;
}
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;
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
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);
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;
}
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;
}
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;
}
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;
}
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;
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) {
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) {
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);
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);
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;
}
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;
}
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;
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;
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);
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);
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;
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);
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);
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);
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;
}
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;
}
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;
}
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) {
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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);
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
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);
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;
}
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;
}
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;
}
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;
}
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;
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);
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);
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);
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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));
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;
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));
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) {
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) {
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) {
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;
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) {
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;
}
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;
}
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;
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) {
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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);
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
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;
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;
}
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;
}
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);
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) {
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;
}
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;
}
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) {
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) {
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) {
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) {
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) {
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);
}
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) {
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) {
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;
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;
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;
}
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;
}
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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;
}
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) {
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;
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;
}
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);
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;
}
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);
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;
}
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);
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;
}
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);
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;
}
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);
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;
}
}
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;
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;
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;
}
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);
// 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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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);
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
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) {
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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);
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
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;
}
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;
}
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;
}
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;
}
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);
}
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;
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
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;
}
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;
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;
}
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;
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;
}
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;
}
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;
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;
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;
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;
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;
}
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;
}
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;
}
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);
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);
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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;
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) {
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;
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) {
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;
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;
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);
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;
}
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) {
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) {
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) {
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) {
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;
}
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) {
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) {
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;
}
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);
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;
}
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;
}
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);
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;
}
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;
}
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;
}
// 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;
}
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;
}
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) {
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) {
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) {
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) {
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);
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);
}
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;
}
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;
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) {
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
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;
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;
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
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;
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));
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;
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
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) {
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;
}
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;
}
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;
}
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;
}
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);
}
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);
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;
}
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;
}
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;
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) {
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;
}
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;
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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) {
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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) {
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;
}
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;
}
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;
}
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));
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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) {
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;
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;
}
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);
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);
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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);
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;
}
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;
}
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;
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) {
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) {
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;
}
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
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) {
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) {
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;
}
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);
}
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;
}
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;
}
}
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);
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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);
}
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;
}
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);
}
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);
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;
}
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;
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;
}
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;
}
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;
}
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;
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) {
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;
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
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) {
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;
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;
}
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;
}
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) {
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) {
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
}
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) {
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
}
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) {
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);
}
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) {
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) {
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;
}
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;
}
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);
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
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;
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;
}
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;
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;
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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);
}
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;
}
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;
}
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;
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;
}
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);
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;
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
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;
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;
}
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;
}
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;
}
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;
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) {
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;
}
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);
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
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;
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;
}
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);
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);
}
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;
}
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;
}
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;
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;
}
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)
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; \
}
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;
}
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) {
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;
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;
}
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;
}
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;
}
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;
}
}
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;
}
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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) {
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);
}
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);
}
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;
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);
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;
}
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;
}
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;
}
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;
}
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) {
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) {
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){
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
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;
}
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) {
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;
}
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) {
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) {
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;
}
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;
}
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;
}
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;
}
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) {
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;
}
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;
}
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;
}
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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) {
}
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;
}
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);
}
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;
}
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;
}
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){
}
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;
}
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) {
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);
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);
}
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);
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);
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);
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);
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);
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);
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);
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;
}
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;
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;
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;
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));
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;
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;
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;
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;
}
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) {
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;
}
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;
}
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;
}
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){
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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;
}
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) {
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;
}
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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) {
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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){
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);
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){
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;
}
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;
}
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){
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
}
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);
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) {
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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){
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;
}
}
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;
}
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;
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;
}
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;
}
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;
}
}
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);
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;
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;
}
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);
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;
}
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){
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;
}
}
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;
}
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;
}
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) {
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;
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;
}
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;
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;
}
}
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;
}
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;
}
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;
}
}
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;
}
}
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;
}
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){
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;
}
}
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;
}
}
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;
}
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){
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){
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;
}
}
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;
}
}
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;
}
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;
}
}
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;
}
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;
}
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);
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);
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);
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;
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;
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;
}
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);
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);
}
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) {
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) {
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);
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);
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);
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) {
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;
}
}
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;
}
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);
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;
}
}
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;
}
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;
}
}
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;
}
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;
}
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);
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;
}
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;
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;
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;
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);
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);
}
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);
}
}
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);
}
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);
}
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;
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;
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;
}
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);
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);
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;
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;
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 {
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
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);
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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);
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);
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);
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);
}
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;
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;
}
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;
}
}
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);
}
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);
}
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);
}
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);
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;
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;
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;
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);
}
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;
}
}
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;
}
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);
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);
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);
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);
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 {
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);
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 {
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);
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);
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);
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);
}
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;
*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);
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;
}
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;
}
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;
}
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) {
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;
}
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;
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;
}
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;
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;
}
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;
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
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() {
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);
}
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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);
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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);
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;
}
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;
}
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) {
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) {
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);
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;
}
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() {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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);
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
// 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) {
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);
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) {
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) {
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);
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;
}
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) {
// 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) {
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);
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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);
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) {
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) {
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);
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;
}
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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);
_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);
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
}
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);
_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);
_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);
_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);
_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;
}
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;
}
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);
_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);
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;
}
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);
_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);
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;
}
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);
_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);
_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);
_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);
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;
}
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);
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);
}
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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;
_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;
_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;
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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;
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);
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;
}
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;
}
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) {
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) {
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);
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;
}
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) {
_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;
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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;
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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;
}
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);
_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);
_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);
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) {
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) {
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);
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;
}
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;
}
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) {
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);
_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);
_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;
_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);
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);
}
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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;
}
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);
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;
}
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);
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;
}
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) {
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) {
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);
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;
}
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);
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;
}
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;
}
_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);
}
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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);
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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);
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) {
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) {
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);
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;
}
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) {
_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;
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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);
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;
}
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;
}
// 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) {
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) {
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);
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) {
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) {
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);
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) {
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) {
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);
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) {
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) {
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);
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) {
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) {
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);
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) {
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) {
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);
}
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) {
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) {
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);
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;
}
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) {
_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;
_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;
_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;
_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;
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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;
}
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);
}
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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) {
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);
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;
}
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) {
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);
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;
}
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) {
_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);
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) {
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);
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;
}
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) {
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) {
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) {
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);
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;
}
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) {
_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);
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) {
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);
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;
}
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);
// 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) {
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);
_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;
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) {
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);
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;
}
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);
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;
}
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;
}
_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);
_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);
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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;
}
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;
}
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);
}
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) {
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);
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;
}
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;
}
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);
}
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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;
}
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) {
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);
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;
}
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) {
_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;
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);
// 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);
}
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) {
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) {
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);
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);
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;
}
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);
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;
}
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;
}
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;
}
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;
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);
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;
}
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;
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);
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;
}
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;
}
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;
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);
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;
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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;
}
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;
}
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;
}
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);
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);
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);
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);
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);
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);
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);
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
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);
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);
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);
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);
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;
}
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);
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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);
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);
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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) {
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;
}
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) {
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) {
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) {
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) {
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) {
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;
}
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;
}
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;
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
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);
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;
}
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;
}
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;
}
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;
}
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;
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) {
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) {
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);
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);
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;
}
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;
}
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;
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;
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);
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);
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;
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);
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);
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);
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;
}
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;
}
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;
}
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) {
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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);
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
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);
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;
}
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;
}
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;
}
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;
}
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;
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);
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);
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);
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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));
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;
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));
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) {
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) {
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) {
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;
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) {
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;
}
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;
}
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;
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) {
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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);
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
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;
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;
}
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;
}
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);
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) {
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;
}
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;
}
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) {
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) {
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) {
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) {
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) {
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);
}
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) {
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) {
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;
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;
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;
}
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;
}
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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;
}
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) {
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;
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;
}
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);
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;
}
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);
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;
}
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);
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;
}
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);
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;
}
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);
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;
}
}
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;
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;
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;
}
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);
// 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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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);
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
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;
}
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;
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) {
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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);
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
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;
}
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;
}
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;
}
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;
}
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);
}
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;
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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;
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;
}
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;
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;
}
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;
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;
}
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;
}
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;
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;
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;
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;
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;
}
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;
}
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;
}
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);
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);
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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;
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) {
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;
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) {
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;
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;
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);
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;
}
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) {
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) {
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) {
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) {
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;
}
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) {
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) {
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;
}
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);
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;
}
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;
}
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);
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;
}
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;
}
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;
}
// 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;
}
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;
}
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) {
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) {
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) {
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) {
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);
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);
}
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;
}
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;
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) {
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
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;
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;
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
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;
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));
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;
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
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) {
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;
}
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;
}
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;
}
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;
}
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);
}
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);
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;
}
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;
}
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;
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) {
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;
}
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;
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);
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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) {
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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) {
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;
}
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;
}
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;
}
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));
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
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) {
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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) {
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;
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;
}
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);
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);
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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);
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;
}
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;
}
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;
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) {
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) {
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;
}
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
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) {
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) {
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;
}
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);
}
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;
}
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;
}
}
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);
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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);
}
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;
}
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);
}
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);
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;
}
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;
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;
}
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;
}
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;
}
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;
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) {
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;
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
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) {
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;
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;
}
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;
}
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) {
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) {
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
}
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) {
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
}
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) {
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);
}
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) {
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) {
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;
}
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;
}
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);
}
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;
}
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;
}
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);
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
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;
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;
}
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;
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;
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;
}
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;
}
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;
}
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;
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) {
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;
}
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;
}
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;
}
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;
}
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;
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) {
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;
}
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);
}
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;
}
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;
}
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;
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;
}
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);
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;
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;
}
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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
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;
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;
}
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;
}
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;
}
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;
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) {
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;
}
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);
}
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;
}
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;
}
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);
}
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;
}
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;
}
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;
}
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;
}
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;
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;
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;
}
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);
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);
}
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;
}
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;
}
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;
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;
}
+import * as version from './version.mjs';
+
const imports: any = {};
imports.env = {};
}
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);
// 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");
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;
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
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);
arrayMemoryView.set(inputArray);
return cArrayPointer;
}
+/* @internal */
export function encodeUint32Array (inputArray: Uint32Array|Array<number>): number {
const cArrayPointer = wasm.TS_malloc((inputArray.length + 1) * 4);
const arrayMemoryView = new Uint32Array(wasm.memory.buffer, cArrayPointer, inputArray.length);
arrayMemoryView[0] = inputArray.length;
return cArrayPointer;
}
+/* @internal */
export function encodeUint64Array (inputArray: BigUint64Array|Array<bigint>): number {
const cArrayPointer = wasm.TS_malloc(inputArray.length * 8 + 1);
const arrayLengthView = new Uint32Array(wasm.memory.buffer, cArrayPointer, 1);
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);
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);
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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;
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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;
get_inbound_payment_key_material (): number;
}
+/* @internal */
export function LDKKeysInterface_new(impl: LDKKeysInterface): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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;
get_relevant_txids (): number;
}
+/* @internal */
export function LDKConfirm_new(impl: LDKConfirm): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
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;
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!");
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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
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;
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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;
hash (): bigint;
}
+/* @internal */
export function LDKSocketDescriptor_new(impl: LDKSocketDescriptor): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
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!");
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!");
// 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!");
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;
write (): number;
}
+/* @internal */
export function LDKScore_new(impl: LDKScore): number {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
// 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!");
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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
return nativeResponseValue;
}
// enum LDKLevel Level_gossip(void);
+/* @internal */
export function Level_gossip(): Level {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
return nativeResponseValue;
}
// enum LDKLevel Level_trace(void);
+/* @internal */
export function Level_trace(): Level {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
return nativeResponseValue;
}
// enum LDKLevel Level_debug(void);
+/* @internal */
export function Level_debug(): Level {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
return nativeResponseValue;
}
// enum LDKLevel Level_info(void);
+/* @internal */
export function Level_info(): Level {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
return nativeResponseValue;
}
// enum LDKLevel Level_warn(void);
+/* @internal */
export function Level_warn(): Level {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
return nativeResponseValue;
}
// enum LDKLevel Level_error(void);
+/* @internal */
export function Level_error(): Level {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
return nativeResponseValue;
}
// enum LDKConfirmationTarget ConfirmationTarget_background(void);
+/* @internal */
export function ConfirmationTarget_background(): ConfirmationTarget {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
return nativeResponseValue;
}
// enum LDKConfirmationTarget ConfirmationTarget_normal(void);
+/* @internal */
export function ConfirmationTarget_normal(): ConfirmationTarget {
if(!isWasmInitialized) {
throw new Error("initializeWasm() must be awaited first!");
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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
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!");
// 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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
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!");
// 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!");
// 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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
// 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!");
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!");
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!");
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!");
+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';
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 */
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);
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);
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);
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);
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);
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);
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);
}
}
+/** A APIError of type APIMisuseError */
export class APIError_APIMisuseError extends APIError {
+ /**
+ * A human-readable error message
+ */
public err: string;
/* @internal */
public constructor(ptr: number) {
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) {
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) {
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) {
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) {
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)));
}
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);
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);
+/** 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;
}
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;
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 {
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);
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);
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);
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);
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 */
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);
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);
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);
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);
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);
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) {
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) {
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) {
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) {
+/** 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;
}
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;
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 {
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);
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);
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);
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);
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);
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);
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);
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);
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) {
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);
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);
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);
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;
+/** An implementation of BroadcasterInterface */
export interface BroadcasterInterfaceInterface {
+ /**Sends a transaction out to (hopefully) be mined.
+ */
broadcast_transaction(tx: Uint8Array): void;
}
held: BroadcasterInterface;
}
+/**
+ * An interface to send a transaction to the Bitcoin network.
+ */
export class BroadcasterInterface extends CommonBase {
/* @internal */
public bindings_instance?: bindings.LDKBroadcasterInterface;
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 {
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));
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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/<type>::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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
+/** 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;
}
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;
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 {
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);
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) {
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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;
}
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);
}
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);
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);
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);
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);
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);
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);
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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) {
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);
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);
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);
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);
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 */
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
}
}
+/** 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) {
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) {
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) {
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);
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);
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);
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) {
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
+/** 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[];
}
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;
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 {
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 {
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);
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;
}
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);
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);
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);
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);
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);
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);
+/** 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[];
}
held: CustomMessageHandler;
}
+/**
+ * Handler for BOLT1-compliant messages.
+ */
export class CustomMessageHandler extends CommonBase {
/* @internal */
public bindings_instance?: bindings.LDKCustomMessageHandler;
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 {
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);
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);
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;
}
+/** 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;
}
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;
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 {
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);
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);
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);
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) {
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);
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);
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);
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);
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);
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);
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);
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);
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;
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);
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);
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);
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);
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);
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);
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 */
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);
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);
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);
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);
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);
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);
}
}
+/** 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) {
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 */
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) {
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);
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);
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);
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);
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);
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);
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 */
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
}
}
+/** 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) {
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) {
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) {
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) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
+ *
+ * [`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) {
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);
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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;
}
}
+/** 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;
}
held: EventHandler;
}
+/**
+ * A trait implemented for objects handling events from [`EventsProvider`].
+ */
export class EventHandler extends CommonBase {
/* @internal */
public bindings_instance?: bindings.LDKEventHandler;
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 {
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);
}
+/** 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;
}
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;
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 {
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);
+/** 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;
}
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;
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 {
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;
+/** 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;
}
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;
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 {
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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) {
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);
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);
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));
}
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);
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);
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);
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);
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);
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);
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);
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)));
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
+/** 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 `<Self::Signer as Writeable>::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;
}
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;
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 {
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);
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);
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 `<Self::Signer as Writeable>::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);
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);
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);
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);
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);
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);
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);
+/** 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;
}
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;
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 {
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);
}
+/** An implementation of LockableScore */
export interface LockableScoreInterface {
+ /**Returns the locked scorer.
+ */
lock(): Score;
}
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;
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 {
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);
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) {
+/** An implementation of Logger */
export interface LoggerInterface {
+ /**Logs the `Record`
+ */
log(record: Record): void;
}
held: Logger;
}
+/**
+ * A trait encapsulating the operations required of a logger
+ */
export class Logger extends CommonBase {
/* @internal */
public bindings_instance?: bindings.LDKLogger;
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 {
impl_holder.held.bindings_instance = structImplementation;
return impl_holder.held;
}
+
}
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);
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);
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);
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 */
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
}
}
+/** 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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
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) {
+/** 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[];
}
held: MessageSendEventsProvider;
}
+/**
+ * A trait indicating an object may generate message send events
+ */
export class MessageSendEventsProvider extends CommonBase {
/* @internal */
public bindings_instance?: bindings.LDKMessageSendEventsProvider;
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 {
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);
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;
}
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 */
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);
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);
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);
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);
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);
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);
}
}
+/** A MonitorEvent of type HTLCEvent */
export class MonitorEvent_HTLCEvent extends MonitorEvent {
public htlc_event: HTLCUpdate;
/* @internal */
this.htlc_event = htlc_event_hu_conv;
}
}
+/** A MonitorEvent of type CommitmentTxConfirmed */
export class MonitorEvent_CommitmentTxConfirmed extends MonitorEvent {
public commitment_tx_confirmed: OutPoint;
/* @internal */
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) {
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 */
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) {
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);
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);
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);
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 */
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);
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);
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);
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);
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);
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);
}
}
+/** 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) {
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) {
this.port = bindings.LDKNetAddress_IPv6_get_port(ptr);
}
}
+/** A NetAddress of type OnionV2 */
export class NetAddress_OnionV2 extends NetAddress {
public onion_v2: Uint8Array;
/* @internal */
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) {
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);
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);
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);
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);
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) {
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);
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);
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);
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);
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);
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);
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);
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);
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);
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 */
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);
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);
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);
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);
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);
}
}
+/** 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) {
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) {
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) {
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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) {
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
}
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);
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);
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 */
}
}
+ /**
+ * 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);
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);
}
}
+/** A Option_AccessZ of type Some */
export class Option_AccessZ_Some extends Option_AccessZ {
public some: Access;
/* @internal */
this.some = ret_hu_conv;
}
}
+/** A Option_AccessZ of type None */
export class Option_AccessZ_None extends Option_AccessZ {
/* @internal */
public constructor(ptr: number) {
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 */
}
}
+ /**
+ * 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);
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);
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);
}
}
+/** A Option_C2Tuple_usizeTransactionZZ of type Some */
export class Option_C2Tuple_usizeTransactionZZ_Some extends Option_C2Tuple_usizeTransactionZZ {
public some: TwoTuple_usizeTransactionZ;
/* @internal */
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) {
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 */
}
}
+ /**
+ * 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);
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);
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);
}
}
+/** A Option_CVec_NetAddressZZ of type Some */
export class Option_CVec_NetAddressZZ_Some extends Option_CVec_NetAddressZZ {
public some: NetAddress[];
/* @internal */
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) {
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 */
}
}
+ /**
+ * 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);
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);
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);
}
}
+/** A Option_ClosureReasonZ of type Some */
export class Option_ClosureReasonZ_Some extends Option_ClosureReasonZ {
public some: ClosureReason;
/* @internal */
this.some = some_hu_conv;
}
}
+/** A Option_ClosureReasonZ of type None */
export class Option_ClosureReasonZ_None extends Option_ClosureReasonZ {
/* @internal */
public constructor(ptr: number) {
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 */
}
}
+ /**
+ * 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);
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);
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);
}
}
+/** A Option_EventZ of type Some */
export class Option_EventZ_Some extends Option_EventZ {
public some: Event;
/* @internal */
this.some = some_hu_conv;
}
}
+/** A Option_EventZ of type None */
export class Option_EventZ_None extends Option_EventZ {
/* @internal */
public constructor(ptr: number) {
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 */
}
}
+ /**
+ * 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);
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);
}
}
+/** A Option_FilterZ of type Some */
export class Option_FilterZ_Some extends Option_FilterZ {
public some: Filter;
/* @internal */
this.some = ret_hu_conv;
}
}
+/** A Option_FilterZ of type None */
export class Option_FilterZ_None extends Option_FilterZ {
/* @internal */
public constructor(ptr: number) {
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 */
}
}
+ /**
+ * 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);
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);
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);
}
}
+/** A Option_MonitorEventZ of type Some */
export class Option_MonitorEventZ_Some extends Option_MonitorEventZ {
public some: MonitorEvent;
/* @internal */
this.some = some_hu_conv;
}
}
+/** A Option_MonitorEventZ of type None */
export class Option_MonitorEventZ_None extends Option_MonitorEventZ {
/* @internal */
public constructor(ptr: number) {
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 */
}
}
+ /**
+ * 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);
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);
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);
}
}
+/** A Option_NetworkUpdateZ of type Some */
export class Option_NetworkUpdateZ_Some extends Option_NetworkUpdateZ {
public some: NetworkUpdate;
/* @internal */
this.some = some_hu_conv;
}
}
+/** A Option_NetworkUpdateZ of type None */
export class Option_NetworkUpdateZ_None extends Option_NetworkUpdateZ {
/* @internal */
public constructor(ptr: number) {
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 */
}
}
+ /**
+ * 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);
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);
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);
}
}
+/** A Option_TypeZ of type Some */
export class Option_TypeZ_Some extends Option_TypeZ {
public some: Type;
/* @internal */
this.some = ret_hu_conv;
}
}
+/** A Option_TypeZ of type None */
export class Option_TypeZ_None extends Option_TypeZ {
/* @internal */
public constructor(ptr: number) {
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 */
}
}
+ /**
+ * 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);
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);
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);
}
}
+/** A Option_u16Z of type Some */
export class Option_u16Z_Some extends Option_u16Z {
public some: number;
/* @internal */
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) {
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 */
}
}
+ /**
+ * 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);
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);
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);
}
}
+/** A Option_u32Z of type Some */
export class Option_u32Z_Some extends Option_u32Z {
public some: number;
/* @internal */
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) {
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 */
}
}
+ /**
+ * 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);
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);
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);
}
}
+/** A Option_u64Z of type Some */
export class Option_u64Z_Some extends Option_u64Z {
public some: bigint;
/* @internal */
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) {
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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 */
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);
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);
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);
}
}
+/** 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) {
this.payment_secret = payment_secret_conv;
}
}
+/** A PaymentPurpose of type SpontaneousPayment */
export class PaymentPurpose_SpontaneousPayment extends PaymentPurpose {
public spontaneous_payment: Uint8Array;
/* @internal */
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 */
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);
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);
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);
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);
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);
}
}
+/** A PaymentSendFailure of type ParameterError */
export class PaymentSendFailure_ParameterError extends PaymentSendFailure {
public parameter_error: APIError;
/* @internal */
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 */
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 */
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) {
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);
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);
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);
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);
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);
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);
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);
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);
}
+/** 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;
}
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;
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 {
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
}
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);
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);
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);
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);
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);
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);
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);
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;
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);
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;
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);
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;
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);
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;
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
}
}
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;
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);
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;
}
}
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;
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);
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;
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);
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;
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);
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;
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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;
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);
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;
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;
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);
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;
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);
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;
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);
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;
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);
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;
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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;
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;
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);
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;
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);
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;
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);
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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;
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);
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);
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;
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);
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;
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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;
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);
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);
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);
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);
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);
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);
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);
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);
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);
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) {
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;
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
+/** 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 <PublicKey as Ord>::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;
}
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;
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 {
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);
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);
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);
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);
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 <PublicKey as Ord>::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);
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);
+/** 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;
}
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;
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 {
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 {
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 {
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);
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);
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);
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);
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);
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);
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);
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) {
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);
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);
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);
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);
+/** An implementation of Sign */
export interface SignInterface {
+ /**Serialize the object into a byte array
+ */
write(): Uint8Array;
}
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;
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 {
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);
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);
+/** 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;
}
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;
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 {
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;
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);
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 */
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);
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);
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);
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);
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);
}
}
+/** 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) {
this.output = output_conv;
}
}
+/** A SpendableOutputDescriptor of type DelayedPaymentOutput */
export class SpendableOutputDescriptor_DelayedPaymentOutput extends SpendableOutputDescriptor {
public delayed_payment_output: DelayedPaymentOutputDescriptor;
/* @internal */
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 */
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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;
}
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);
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);
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);
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);
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);
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;
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
+/** 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;
}
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;
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 {
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);
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);
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);
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)));
}
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);
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);
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);
}
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);
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);
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);
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));
}
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);
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);
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);
}
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);
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);
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);
}
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);
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);
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);
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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:
+ * <BIP 143 funding_signature>
+ * 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);
+/** 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[];
}
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;
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 {
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);
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;
}
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);
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);
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);
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;