Merge pull request #39 from TheBlueMatt/main
[ldk-java] / ts / bindings.c.body
index dd99fe3c31ea39728b58a8bc922cd80e90d27a73..90ea56c0052200bbb6fb00dfd186eca908e03efa 100644 (file)
@@ -197,23 +197,21 @@ static inline int32_t LDKIOError_to_js(LDKIOError val) {
 }
 static inline LDKLevel LDKLevel_from_js(int32_t ord) {
        switch (ord) {
-               case 0: return LDKLevel_Off;
-               case 1: return LDKLevel_Error;
-               case 2: return LDKLevel_Warn;
-               case 3: return LDKLevel_Info;
-               case 4: return LDKLevel_Debug;
-               case 5: return LDKLevel_Trace;
+               case 0: return LDKLevel_Trace;
+               case 1: return LDKLevel_Debug;
+               case 2: return LDKLevel_Info;
+               case 3: return LDKLevel_Warn;
+               case 4: return LDKLevel_Error;
        }
        abort();
 }
 static inline int32_t LDKLevel_to_js(LDKLevel val) {
        switch (val) {
-               case LDKLevel_Off: return 0;
-               case LDKLevel_Error: return 1;
-               case LDKLevel_Warn: return 2;
-               case LDKLevel_Info: return 3;
-               case LDKLevel_Debug: return 4;
-               case LDKLevel_Trace: return 5;
+               case LDKLevel_Trace: return 0;
+               case LDKLevel_Debug: return 1;
+               case LDKLevel_Info: return 2;
+               case LDKLevel_Warn: return 3;
+               case LDKLevel_Error: return 4;
                default: abort();
        }
 }
@@ -326,6 +324,21 @@ static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
        memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
        return ret;
 }
+struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) {  return CVec_u8Z_clone(&thing->script_pubkey);}int8_tArray  __attribute__((visibility("default"))) 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_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+       CVec_u8Z_free(ret_var);
+       return ret_arr;
+}
+
+uint64_t TxOut_get_value (struct LDKTxOut* thing) {    return thing->value;}int64_t  __attribute__((visibility("default"))) TS_TxOut_get_value(uint32_t thing) {
+       LDKTxOut* thing_conv = (LDKTxOut*)(thing & ~1);
+       int64_t ret_val = TxOut_get_value(thing_conv);
+       return ret_val;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_LDKCResult_SecretKeyErrorZ_result_ok(uint32_t arg) {
        return ((LDKCResult_SecretKeyErrorZ*)arg)->result_ok;
 }
@@ -594,6 +607,48 @@ void  __attribute__((visibility("default"))) TS_LDKCResult_CVec_SignatureZNoneZ_
        CHECK(!val->result_ok);
        return *val->contents.err;
 }
+jboolean  __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDecodeErrorZ_result_ok(uint32_t arg) {
+       return ((LDKCResult_ShutdownScriptDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t  __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDecodeErrorZ_get_ok(uint32_t arg) {
+       LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1);
+       CHECK(val->result_ok);
+       LDKShutdownScript res_var = (*val->contents.result);
+       CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+       return res_ref;
+}
+uint32_t  __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptDecodeErrorZ_get_err(uint32_t arg) {
+       LDKCResult_ShutdownScriptDecodeErrorZ *val = (LDKCResult_ShutdownScriptDecodeErrorZ*)(arg & ~1);
+       CHECK(!val->result_ok);
+       LDKDecodeError err_var = (*val->contents.err);
+       CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+       return err_ref;
+}
+jboolean  __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInvalidShutdownScriptZ_result_ok(uint32_t arg) {
+       return ((LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)arg)->result_ok;
+}
+uint32_t  __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(uint32_t arg) {
+       LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
+       CHECK(val->result_ok);
+       LDKShutdownScript res_var = (*val->contents.result);
+       CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+       return res_ref;
+}
+uint32_t  __attribute__((visibility("default"))) TS_LDKCResult_ShutdownScriptInvalidShutdownScriptZ_get_err(uint32_t arg) {
+       LDKCResult_ShutdownScriptInvalidShutdownScriptZ *val = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(arg & ~1);
+       CHECK(!val->result_ok);
+       LDKInvalidShutdownScript err_var = (*val->contents.err);
+       CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+       return err_ref;
+}
 jboolean  __attribute__((visibility("default"))) TS_LDKCResult_NoneErrorZ_result_ok(uint32_t arg) {
        return ((LDKCResult_NoneErrorZ*)arg)->result_ok;
 }
@@ -972,6 +1027,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKErrorAction_ref_from_ptr(u
                case LDKErrorAction_IgnoreError: {
                        return 0 /* LDKErrorAction - IgnoreError */;
                }
+               case LDKErrorAction_IgnoreAndLog: {
+                       uint32_t ignore_and_log_conv = LDKLevel_to_js(obj->ignore_and_log);
+                       return 0 /* LDKErrorAction - IgnoreAndLog */; (void) ignore_and_log_conv;
+               }
                case LDKErrorAction_SendErrorMessage: {
                        LDKErrorMessage msg_var = obj->send_error_message.msg;
                        CHECK((((uint64_t)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
@@ -1130,6 +1189,15 @@ uint32_t __attribute__((visibility("default"))) TS_LDKMessageSendEvent_ref_from_
                        uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
                        return 0 /* LDKMessageSendEvent - BroadcastChannelUpdate */; (void) msg_ref;
                }
+               case LDKMessageSendEvent_SendChannelUpdate: {
+                       int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+                       memcpy((uint8_t*)(node_id_arr + 4), obj->send_channel_update.node_id.compressed_form, 33);
+                       LDKChannelUpdate msg_var = obj->send_channel_update.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.
+                       uint64_t msg_ref = (uint64_t)msg_var.inner & ~1;
+                       return 0 /* LDKMessageSendEvent - SendChannelUpdate */; (void) node_id_arr; (void) msg_ref;
+               }
                case LDKMessageSendEvent_HandleError: {
                        int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
                        memcpy((uint8_t*)(node_id_arr + 4), obj->handle_error.node_id.compressed_form, 33);
@@ -1473,7 +1541,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L
        if (commitment_tx_var.is_owned) {
                commitment_tx_ref |= 1;
        }
-       LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)js_invoke_function_1(j_calls->sign_counterparty_commitment_meth, commitment_tx_ref);
+       uint32_t ret = js_invoke_function_1(j_calls->sign_counterparty_commitment_meth, commitment_tx_ref);
        LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -1488,7 +1556,7 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl
        if (commitment_tx_var.is_owned) {
                commitment_tx_ref |= 1;
        }
-       LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)js_invoke_function_1(j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref);
+       uint32_t ret = js_invoke_function_1(j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref);
        LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -1501,7 +1569,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo
        Transaction_free(justice_tx_var);
        int8_tArray per_commitment_key_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
        memcpy((uint8_t*)(per_commitment_key_arr + 4), *per_commitment_key, 32);
-       LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)js_invoke_function_4(j_calls->sign_justice_revoked_output_meth, justice_tx_arr, input, amount, per_commitment_key_arr);
+       uint32_t ret = js_invoke_function_4(j_calls->sign_justice_revoked_output_meth, justice_tx_arr, input, amount, per_commitment_key_arr);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -1522,7 +1590,7 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void
        if (htlc_var.is_owned) {
                htlc_ref |= 1;
        }
-       LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)js_invoke_function_5(j_calls->sign_justice_revoked_htlc_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref);
+       uint32_t ret = js_invoke_function_5(j_calls->sign_justice_revoked_htlc_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -1543,7 +1611,7 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c
        if (htlc_var.is_owned) {
                htlc_ref |= 1;
        }
-       LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)js_invoke_function_5(j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref);
+       uint32_t ret = js_invoke_function_5(j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -1554,7 +1622,7 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void*
        int8_tArray closing_tx_arr = init_arr(closing_tx_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
        memcpy((uint8_t*)(closing_tx_arr + 4), closing_tx_var.data, closing_tx_var.datalen);
        Transaction_free(closing_tx_var);
-       LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)js_invoke_function_1(j_calls->sign_closing_transaction_meth, closing_tx_arr);
+       uint32_t ret = js_invoke_function_1(j_calls->sign_closing_transaction_meth, closing_tx_arr);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -1569,7 +1637,7 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void
        if (msg_var.is_owned) {
                msg_ref |= 1;
        }
-       LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)js_invoke_function_1(j_calls->sign_channel_announcement_meth, msg_ref);
+       uint32_t ret = js_invoke_function_1(j_calls->sign_channel_announcement_meth, msg_ref);
        LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -1586,10 +1654,9 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction
        }
        js_invoke_function_1(j_calls->ready_channel_meth, channel_parameters_ref);
 }
-static void* LDKBaseSign_JCalls_clone(const void* this_arg) {
-       LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) {
+       LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKBaseSign LDKBaseSign_init (/*TODO: JS Object Reference */void* o, uint32_t pubkeys) {
        LDKBaseSign_JCalls *calls = MALLOC(sizeof(LDKBaseSign_JCalls), "LDKBaseSign_JCalls");
@@ -1787,11 +1854,10 @@ LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
        memcpy(ret_ref.data, (uint8_t*)(ret + 4), ret_ref.datalen);
        return ret_ref;
 }
-static void* LDKSign_JCalls_clone(const void* this_arg) {
-       LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
+static void LDKSign_JCalls_cloned(LDKSign* new_obj) {
+       LDKSign_JCalls *j_calls = (LDKSign_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
        atomic_fetch_add_explicit(&j_calls->BaseSign->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKSign LDKSign_init (/*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */void* BaseSign, uint32_t pubkeys) {
        LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
@@ -1806,7 +1872,7 @@ static inline LDKSign LDKSign_init (/*TODO: JS Object Reference */void* o, /*TOD
        LDKSign ret = {
                .this_arg = (void*) calls,
                .write = write_LDKSign_jcall,
-               .clone = LDKSign_JCalls_clone,
+               .cloned = LDKSign_JCalls_cloned,
                .free = LDKSign_JCalls_free,
                .BaseSign = LDKBaseSign_init(BaseSign, pubkeys),
        };
@@ -2016,6 +2082,18 @@ uint32_t  __attribute__((visibility("default"))) TS_LDKCResult_CVec_C2Tuple_Bloc
        uint32_t err_conv = LDKIOError_to_js((*val->contents.err));
        return err_conv;
 }
+uint32_t __attribute__((visibility("default"))) TS_LDKCOption_u16Z_ref_from_ptr(uint32_t ptr) {
+       LDKCOption_u16Z *obj = (LDKCOption_u16Z*)(ptr & ~1);
+       switch(obj->tag) {
+               case LDKCOption_u16Z_Some: {
+                       return 0 /* LDKCOption_u16Z - Some */; (void) obj->some;
+               }
+               case LDKCOption_u16Z_None: {
+                       return 0 /* LDKCOption_u16Z - None */;
+               }
+               default: abort();
+       }
+}
 uint32_t __attribute__((visibility("default"))) TS_LDKAPIError_ref_from_ptr(uint32_t ptr) {
        LDKAPIError *obj = (LDKAPIError*)(ptr & ~1);
        switch(obj->tag) {
@@ -2042,6 +2120,13 @@ uint32_t __attribute__((visibility("default"))) TS_LDKAPIError_ref_from_ptr(uint
                case LDKAPIError_MonitorUpdateFailed: {
                        return 0 /* LDKAPIError - MonitorUpdateFailed */;
                }
+               case LDKAPIError_IncompatibleShutdownScript: {
+                       LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
+                       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.
+                       uint64_t script_ref = (uint64_t)script_var.inner & ~1;
+                       return 0 /* LDKAPIError - IncompatibleShutdownScript */; (void) script_ref;
+               }
                default: abort();
        }
 }
@@ -2165,6 +2250,22 @@ uint32_t  __attribute__((visibility("default"))) TS_LDKCResult_NonePaymentSendFa
        uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
        return err_ref;
 }
+jboolean  __attribute__((visibility("default"))) TS_LDKCResult_PaymentHashPaymentSendFailureZ_result_ok(uint32_t arg) {
+       return ((LDKCResult_PaymentHashPaymentSendFailureZ*)arg)->result_ok;
+}
+int8_tArray  __attribute__((visibility("default"))) TS_LDKCResult_PaymentHashPaymentSendFailureZ_get_ok(uint32_t arg) {
+       LDKCResult_PaymentHashPaymentSendFailureZ *val = (LDKCResult_PaymentHashPaymentSendFailureZ*)(arg & ~1);
+       CHECK(val->result_ok);
+       int8_tArray res_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(res_arr + 4), (*val->contents.result).data, 32);
+       return res_arr;
+}
+uint32_t  __attribute__((visibility("default"))) TS_LDKCResult_PaymentHashPaymentSendFailureZ_get_err(uint32_t arg) {
+       LDKCResult_PaymentHashPaymentSendFailureZ *val = (LDKCResult_PaymentHashPaymentSendFailureZ*)(arg & ~1);
+       CHECK(!val->result_ok);
+       uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
+       return err_ref;
+}
 uint32_t __attribute__((visibility("default"))) TS_LDKNetAddress_ref_from_ptr(uint32_t ptr) {
        LDKNetAddress *obj = (LDKNetAddress*)(ptr & ~1);
        switch(obj->tag) {
@@ -2312,7 +2413,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void*
        if (monitor_var.is_owned) {
                monitor_ref |= 1;
        }
-       LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)js_invoke_function_2(j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
+       uint32_t ret = js_invoke_function_2(j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
        LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -2333,7 +2434,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void
        if (update_var.is_owned) {
                update_ref |= 1;
        }
-       LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)js_invoke_function_2(j_calls->update_channel_meth, funding_txo_ref, update_ref);
+       uint32_t ret = js_invoke_function_2(j_calls->update_channel_meth, funding_txo_ref, update_ref);
        LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -2356,10 +2457,9 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void*
        }
        return ret_constr;
 }
-static void* LDKWatch_JCalls_clone(const void* this_arg) {
-       LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
+static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
+       LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKWatch LDKWatch_init (/*TODO: JS Object Reference */void* o) {
        LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
@@ -2444,10 +2544,9 @@ void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, L
        Transaction_free(tx_var);
        js_invoke_function_1(j_calls->broadcast_transaction_meth, tx_arr);
 }
-static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
-       LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
+static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
+       LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (/*TODO: JS Object Reference */void* o) {
        LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
@@ -2480,7 +2579,7 @@ typedef struct LDKKeysInterface_JCalls {
        atomic_size_t refcnt;
        uint32_t get_node_secret_meth;
        uint32_t get_destination_script_meth;
-       uint32_t get_shutdown_pubkey_meth;
+       uint32_t get_shutdown_scriptpubkey_meth;
        uint32_t get_channel_signer_meth;
        uint32_t get_secure_random_bytes_meth;
        uint32_t read_chan_signer_meth;
@@ -2491,7 +2590,7 @@ static void LDKKeysInterface_JCalls_free(void* this_arg) {
        if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
                js_free(j_calls->get_node_secret_meth);
                js_free(j_calls->get_destination_script_meth);
-               js_free(j_calls->get_shutdown_pubkey_meth);
+               js_free(j_calls->get_shutdown_scriptpubkey_meth);
                js_free(j_calls->get_channel_signer_meth);
                js_free(j_calls->get_secure_random_bytes_meth);
                js_free(j_calls->read_chan_signer_meth);
@@ -2516,19 +2615,20 @@ LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg)
        memcpy(ret_ref.data, (uint8_t*)(ret + 4), ret_ref.datalen);
        return ret_ref;
 }
-LDKPublicKey get_shutdown_pubkey_LDKKeysInterface_jcall(const void* this_arg) {
+LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) {
        LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
-       int8_tArray ret = js_invoke_function_0(j_calls->get_shutdown_pubkey_meth);
-       LDKPublicKey ret_ref;
-       CHECK(*((uint32_t*)ret) == 33);
-       memcpy(ret_ref.compressed_form, (uint8_t*)(ret + 4), 33);
-       return ret_ref;
+       uint32_t ret = js_invoke_function_0(j_calls->get_shutdown_scriptpubkey_meth);
+       LDKShutdownScript ret_conv;
+       ret_conv.inner = (void*)(ret & (~1));
+       ret_conv.is_owned = (ret & 1) || (ret == 0);
+       ret_conv = ShutdownScript_clone(&ret_conv);
+       return ret_conv;
 }
 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;
-       LDKSign* ret = (LDKSign*)js_invoke_function_2(j_calls->get_channel_signer_meth, inbound, channel_value_satoshis);
+       uint32_t ret = js_invoke_function_2(j_calls->get_channel_signer_meth, inbound, channel_value_satoshis);
        LDKSign ret_conv = *(LDKSign*)(((uint64_t)ret) & ~1);
-       ret_conv = Sign_clone(ret);
+       ret_conv = Sign_clone(&ret_conv);
        return ret_conv;
 }
 LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
@@ -2544,7 +2644,7 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void*
        LDKu8slice reader_var = reader;
        int8_tArray reader_arr = init_arr(reader_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
        memcpy((uint8_t*)(reader_arr + 4), reader_var.data, reader_var.datalen);
-       LDKCResult_SignDecodeErrorZ* ret = (LDKCResult_SignDecodeErrorZ*)js_invoke_function_1(j_calls->read_chan_signer_meth, reader_arr);
+       uint32_t ret = js_invoke_function_1(j_calls->read_chan_signer_meth, reader_arr);
        LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -2555,15 +2655,14 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v
        int8_tArray invoice_preimage_arr = init_arr(invoice_preimage_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
        memcpy((uint8_t*)(invoice_preimage_arr + 4), invoice_preimage_var.data, invoice_preimage_var.datalen);
        CVec_u8Z_free(invoice_preimage_var);
-       LDKCResult_RecoverableSignatureNoneZ* ret = (LDKCResult_RecoverableSignatureNoneZ*)js_invoke_function_1(j_calls->sign_invoice_meth, invoice_preimage_arr);
+       uint32_t ret = js_invoke_function_1(j_calls->sign_invoice_meth, invoice_preimage_arr);
        LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
 }
-static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
-       LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
+       LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKKeysInterface LDKKeysInterface_init (/*TODO: JS Object Reference */void* o) {
        LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
@@ -2574,7 +2673,7 @@ static inline LDKKeysInterface LDKKeysInterface_init (/*TODO: JS Object Referenc
                .this_arg = (void*) calls,
                .get_node_secret = get_node_secret_LDKKeysInterface_jcall,
                .get_destination_script = get_destination_script_LDKKeysInterface_jcall,
-               .get_shutdown_pubkey = get_shutdown_pubkey_LDKKeysInterface_jcall,
+               .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall,
                .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall,
                .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
                .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
@@ -2604,11 +2703,16 @@ int8_tArray  __attribute__((visibility("default"))) TS_KeysInterface_get_destina
        return ret_arr;
 }
 
-int8_tArray  __attribute__((visibility("default"))) TS_KeysInterface_get_shutdown_pubkey(uint32_t this_arg) {
+uint32_t  __attribute__((visibility("default"))) TS_KeysInterface_get_shutdown_scriptpubkey(uint32_t this_arg) {
        LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)(((uint64_t)this_arg) & ~1);
-       int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
-       memcpy((uint8_t*)(ret_arr + 4), (this_arg_conv->get_shutdown_pubkey)(this_arg_conv->this_arg).compressed_form, 33);
-       return ret_arr;
+       LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
 }
 
 uint32_t  __attribute__((visibility("default"))) TS_KeysInterface_get_channel_signer(uint32_t this_arg, jboolean inbound, int64_t channel_value_satoshis) {
@@ -2662,10 +2766,9 @@ uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg,
        uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
        return js_invoke_function_1(j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
 }
-static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
-       LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
+static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
+       LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKFeeEstimator LDKFeeEstimator_init (/*TODO: JS Object Reference */void* o) {
        LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
@@ -2708,10 +2811,9 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) {
        jstring record_conv = str_ref_to_ts(record_str, strlen(record_str));
        js_invoke_function_1(j_calls->log_meth, record_conv);
 }
-static void* LDKLogger_JCalls_clone(const void* this_arg) {
-       LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
+static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
+       LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKLogger LDKLogger_init (/*TODO: JS Object Reference */void* o) {
        LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
@@ -3265,6 +3367,24 @@ static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCV
        }
        return ret;
 }
+uint32_t __attribute__((visibility("default"))) TS_LDKPaymentPurpose_ref_from_ptr(uint32_t ptr) {
+       LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1);
+       switch(obj->tag) {
+               case LDKPaymentPurpose_InvoicePayment: {
+                       int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+                       memcpy((uint8_t*)(payment_preimage_arr + 4), obj->invoice_payment.payment_preimage.data, 32);
+                       int8_tArray payment_secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+                       memcpy((uint8_t*)(payment_secret_arr + 4), obj->invoice_payment.payment_secret.data, 32);
+                       return 0 /* LDKPaymentPurpose - InvoicePayment */; (void) payment_preimage_arr; (void) payment_secret_arr; (void) obj->invoice_payment.user_payment_id;
+               }
+               case LDKPaymentPurpose_SpontaneousPayment: {
+                       int8_tArray spontaneous_payment_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+                       memcpy((uint8_t*)(spontaneous_payment_arr + 4), obj->spontaneous_payment.data, 32);
+                       return 0 /* LDKPaymentPurpose - SpontaneousPayment */; (void) spontaneous_payment_arr;
+               }
+               default: abort();
+       }
+}
 uint32_t __attribute__((visibility("default"))) TS_LDKEvent_ref_from_ptr(uint32_t ptr) {
        LDKEvent *obj = (LDKEvent*)(ptr & ~1);
        switch(obj->tag) {
@@ -3279,11 +3399,8 @@ uint32_t __attribute__((visibility("default"))) TS_LDKEvent_ref_from_ptr(uint32_
                case LDKEvent_PaymentReceived: {
                        int8_tArray payment_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
                        memcpy((uint8_t*)(payment_hash_arr + 4), obj->payment_received.payment_hash.data, 32);
-                       int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
-                       memcpy((uint8_t*)(payment_preimage_arr + 4), obj->payment_received.payment_preimage.data, 32);
-                       int8_tArray payment_secret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
-                       memcpy((uint8_t*)(payment_secret_arr + 4), obj->payment_received.payment_secret.data, 32);
-                       return 0 /* LDKEvent - PaymentReceived */; (void) payment_hash_arr; (void) payment_preimage_arr; (void) payment_secret_arr; (void) obj->payment_received.amt; (void) obj->payment_received.user_payment_id;
+                       uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1;
+                       return 0 /* LDKEvent - PaymentReceived */; (void) payment_hash_arr; (void) obj->payment_received.amt; (void) purpose_ref;
                }
                case LDKEvent_PaymentSent: {
                        int8_tArray payment_preimage_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
@@ -3308,6 +3425,10 @@ uint32_t __attribute__((visibility("default"))) TS_LDKEvent_ref_from_ptr(uint32_
                        }
                        return 0 /* LDKEvent - SpendableOutputs */; (void) outputs_arr;
                }
+               case LDKEvent_PaymentForwarded: {
+                       uint64_t fee_earned_msat_ref = ((uint64_t)&obj->payment_forwarded.fee_earned_msat) | 1;
+                       return 0 /* LDKEvent - PaymentForwarded */; (void) fee_earned_msat_ref; (void) obj->payment_forwarded.claim_from_onchain_tx;
+               }
                default: abort();
        }
 }
@@ -4023,6 +4144,27 @@ uint32_t  __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedDeco
        uint64_t err_ref = (uint64_t)err_var.inner & ~1;
        return err_ref;
 }
+jboolean  __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_result_ok(uint32_t arg) {
+       return ((LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t  __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(uint32_t arg) {
+       LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1);
+       CHECK(val->result_ok);
+       LDKClosingSignedFeeRange res_var = (*val->contents.result);
+       CHECK((((uint64_t)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t res_ref = (uint64_t)res_var.inner & ~1;
+       return res_ref;
+}
+uint32_t  __attribute__((visibility("default"))) TS_LDKCResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint32_t arg) {
+       LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *val = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(arg & ~1);
+       CHECK(!val->result_ok);
+       LDKDecodeError err_var = (*val->contents.err);
+       CHECK((((uint64_t)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t err_ref = (uint64_t)err_var.inner & ~1;
+       return err_ref;
+}
 jboolean  __attribute__((visibility("default"))) TS_LDKCResult_CommitmentSignedDecodeErrorZ_result_ok(uint32_t arg) {
        return ((LDKCResult_CommitmentSignedDecodeErrorZ*)arg)->result_ok;
 }
@@ -4650,10 +4792,9 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP
        }
        return ret_constr;
 }
-static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
-       LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
+static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
+       LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (/*TODO: JS Object Reference */void* o) {
        LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
@@ -4705,10 +4846,9 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) {
        uint64_t event_ref = (uint64_t)event_copy;
        js_invoke_function_1(j_calls->handle_event_meth, event_ref);
 }
-static void* LDKEventHandler_JCalls_clone(const void* this_arg) {
-       LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
+static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
+       LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKEventHandler LDKEventHandler_init (/*TODO: JS Object Reference */void* o) {
        LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
@@ -4750,10 +4890,9 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve
        *ret = handler;
        js_invoke_function_1(j_calls->process_pending_events_meth, (uint64_t)ret);
 }
-static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
-       LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
+static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
+       LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKEventsProvider LDKEventsProvider_init (/*TODO: JS Object Reference */void* o) {
        LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
@@ -4793,15 +4932,14 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons
        LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
        int8_tArray genesis_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
        memcpy((uint8_t*)(genesis_hash_arr + 4), *genesis_hash, 32);
-       LDKCResult_TxOutAccessErrorZ* ret = (LDKCResult_TxOutAccessErrorZ*)js_invoke_function_2(j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id);
+       uint32_t ret = js_invoke_function_2(j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id);
        LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
 }
-static void* LDKAccess_JCalls_clone(const void* this_arg) {
-       LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
+static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) {
+       LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKAccess LDKAccess_init (/*TODO: JS Object Reference */void* o) {
        LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
@@ -4857,10 +4995,9 @@ void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* h
        memcpy((uint8_t*)(header_arr + 4), *header, 80);
        js_invoke_function_2(j_calls->block_disconnected_meth, header_arr, height);
 }
-static void* LDKListen_JCalls_clone(const void* this_arg) {
-       LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
+static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
+       LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKListen LDKListen_init (/*TODO: JS Object Reference */void* o) {
        LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
@@ -4960,10 +5097,9 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
        }
        return ret_constr;
 }
-static void* LDKConfirm_JCalls_clone(const void* this_arg) {
-       LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
+static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
+       LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKConfirm LDKConfirm_init (/*TODO: JS Object Reference */void* o) {
        LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
@@ -5070,15 +5206,14 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void
        if (output_var.is_owned) {
                output_ref |= 1;
        }
-       LDKCOption_C2Tuple_usizeTransactionZZ* ret = (LDKCOption_C2Tuple_usizeTransactionZZ*)js_invoke_function_1(j_calls->register_output_meth, output_ref);
+       uint32_t ret = js_invoke_function_1(j_calls->register_output_meth, output_ref);
        LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1);
        ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
 }
-static void* LDKFilter_JCalls_clone(const void* this_arg) {
-       LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
+static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
+       LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKFilter LDKFilter_init (/*TODO: JS Object Reference */void* o) {
        LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
@@ -5152,7 +5287,7 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con
        if (data_var.is_owned) {
                data_ref |= 1;
        }
-       LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)js_invoke_function_2(j_calls->persist_new_channel_meth, id_ref, data_ref);
+       uint32_t ret = js_invoke_function_2(j_calls->persist_new_channel_meth, id_ref, data_ref);
        LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -5182,15 +5317,14 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal
        if (data_var.is_owned) {
                data_ref |= 1;
        }
-       LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)js_invoke_function_3(j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref);
+       uint32_t ret = js_invoke_function_3(j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref);
        LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
 }
-static void* LDKPersist_JCalls_clone(const void* this_arg) {
-       LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
+static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
+       LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKPersist LDKPersist_init (/*TODO: JS Object Reference */void* o) {
        LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
@@ -5585,11 +5719,10 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic
        }
        js_invoke_function_2(j_calls->handle_error_meth, their_node_id_arr, msg_ref);
 }
-static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
-       LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
+static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
+       LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
        atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (/*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */void* MessageSendEventsProvider) {
        LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
@@ -5899,7 +6032,7 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler
        if (msg_var.is_owned) {
                msg_ref |= 1;
        }
-       LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)js_invoke_function_1(j_calls->handle_node_announcement_meth, msg_ref);
+       uint32_t ret = js_invoke_function_1(j_calls->handle_node_announcement_meth, msg_ref);
        LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -5914,7 +6047,7 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand
        if (msg_var.is_owned) {
                msg_ref |= 1;
        }
-       LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)js_invoke_function_1(j_calls->handle_channel_announcement_meth, msg_ref);
+       uint32_t ret = js_invoke_function_1(j_calls->handle_channel_announcement_meth, msg_ref);
        LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -5929,7 +6062,7 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc
        if (msg_var.is_owned) {
                msg_ref |= 1;
        }
-       LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)js_invoke_function_1(j_calls->handle_channel_update_meth, msg_ref);
+       uint32_t ret = js_invoke_function_1(j_calls->handle_channel_update_meth, msg_ref);
        LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -6004,7 +6137,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl
        if (msg_var.is_owned) {
                msg_ref |= 1;
        }
-       LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)js_invoke_function_2(j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref);
+       uint32_t ret = js_invoke_function_2(j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref);
        LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -6020,7 +6153,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess
        if (msg_var.is_owned) {
                msg_ref |= 1;
        }
-       LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)js_invoke_function_2(j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref);
+       uint32_t ret = js_invoke_function_2(j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref);
        LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -6036,7 +6169,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl
        if (msg_var.is_owned) {
                msg_ref |= 1;
        }
-       LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)js_invoke_function_2(j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref);
+       uint32_t ret = js_invoke_function_2(j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref);
        LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
@@ -6052,16 +6185,15 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH
        if (msg_var.is_owned) {
                msg_ref |= 1;
        }
-       LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)js_invoke_function_2(j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref);
+       uint32_t ret = js_invoke_function_2(j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref);
        LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
 }
-static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
-       LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
+static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
+       LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
        atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (/*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */void* MessageSendEventsProvider) {
        LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
@@ -6269,10 +6401,9 @@ uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
        LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
        return js_invoke_function_0(j_calls->hash_meth);
 }
-static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
-       LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
+static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
+       LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKSocketDescriptor LDKSocketDescriptor_init (/*TODO: JS Object Reference */void* o) {
        LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
@@ -6285,7 +6416,7 @@ static inline LDKSocketDescriptor LDKSocketDescriptor_init (/*TODO: JS Object Re
                .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
                .eq = eq_LDKSocketDescriptor_jcall,
                .hash = hash_LDKSocketDescriptor_jcall,
-               .clone = LDKSocketDescriptor_JCalls_clone,
+               .cloned = LDKSocketDescriptor_JCalls_cloned,
                .free = LDKSocketDescriptor_JCalls_free,
        };
        return ret;
@@ -6336,15 +6467,14 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi
        if (channel_manager_var.is_owned) {
                channel_manager_ref |= 1;
        }
-       LDKCResult_NoneErrorZ* ret = (LDKCResult_NoneErrorZ*)js_invoke_function_1(j_calls->persist_manager_meth, channel_manager_ref);
+       uint32_t ret = js_invoke_function_1(j_calls->persist_manager_meth, channel_manager_ref);
        LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1);
        ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1));
        return ret_conv;
 }
-static void* LDKChannelManagerPersister_JCalls_clone(const void* this_arg) {
-       LDKChannelManagerPersister_JCalls *j_calls = (LDKChannelManagerPersister_JCalls*) this_arg;
+static void LDKChannelManagerPersister_JCalls_cloned(LDKChannelManagerPersister* new_obj) {
+       LDKChannelManagerPersister_JCalls *j_calls = (LDKChannelManagerPersister_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKChannelManagerPersister LDKChannelManagerPersister_init (/*TODO: JS Object Reference */void* o) {
        LDKChannelManagerPersister_JCalls *calls = MALLOC(sizeof(LDKChannelManagerPersister_JCalls), "LDKChannelManagerPersister_JCalls");
@@ -6399,12 +6529,14 @@ uint32_t __attribute__((visibility("default"))) TS_LDKFallback_ref_from_ptr(uint
 jstring  __attribute__((visibility("default"))) TS__ldk_get_compiled_version() {
        LDKStr ret_str = _ldk_get_compiled_version();
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
 jstring  __attribute__((visibility("default"))) TS__ldk_c_bindings_get_compiled_version() {
        LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -6417,6 +6549,16 @@ void  __attribute__((visibility("default"))) TS_Transaction_free(int8_tArray _re
        Transaction_free(_res_ref);
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_TxOut_new(int8_tArray script_pubkey, int64_t value) {
+       LDKCVec_u8Z script_pubkey_ref;
+       script_pubkey_ref.datalen = *((uint32_t*)script_pubkey);
+       script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
+       memcpy(script_pubkey_ref.data, (uint8_t*)(script_pubkey + 4), script_pubkey_ref.datalen);
+       LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
+       *ret_ref = TxOut_new(script_pubkey_ref, value);
+       return (uint64_t)ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_TxOut_free(uint32_t _res) {
        if ((_res & 1) != 0) return;
        LDKTxOut _res_conv = *(LDKTxOut*)(((uint64_t)_res) & ~1);
@@ -6902,6 +7044,67 @@ uint32_t  __attribute__((visibility("default"))) TS_CResult_CVec_SignatureZNoneZ
        return (uint64_t)ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_ok(uint32_t o) {
+       LDKShutdownScript o_conv;
+       o_conv.inner = (void*)(o & (~1));
+       o_conv.is_owned = (o & 1) || (o == 0);
+       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;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_err(uint32_t e) {
+       LDKDecodeError e_conv;
+       e_conv.inner = (void*)(e & (~1));
+       e_conv.is_owned = (e & 1) || (e == 0);
+       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;
+}
+
+void  __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint32_t _res) {
+       if ((_res & 1) != 0) return;
+       LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(((uint64_t)_res) & ~1);
+       FREE((void*)_res);
+       CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone(uint32_t orig) {
+       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;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(uint32_t o) {
+       LDKShutdownScript o_conv;
+       o_conv.inner = (void*)(o & (~1));
+       o_conv.is_owned = (o & 1) || (o == 0);
+       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;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err(uint32_t e) {
+       LDKInvalidShutdownScript e_conv;
+       e_conv.inner = (void*)(e & (~1));
+       e_conv.is_owned = (e & 1) || (e == 0);
+       // Warning: we need a move here but no clone is available for LDKInvalidShutdownScript
+       LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
+       *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
+       return (uint64_t)ret_conv;
+}
+
+void  __attribute__((visibility("default"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint32_t _res) {
+       if ((_res & 1) != 0) return;
+       LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(((uint64_t)_res) & ~1);
+       FREE((void*)_res);
+       CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_CResult_NoneErrorZ_ok() {
        LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
        *ret_conv = CResult_NoneErrorZ_ok();
@@ -7919,6 +8122,35 @@ void  __attribute__((visibility("default"))) TS_CResult_CVec_C2Tuple_BlockHashCh
        CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv);
 }
 
+uint32_t  __attribute__((visibility("default"))) 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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) 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;
+       return ret_ref;
+}
+
+void  __attribute__((visibility("default"))) TS_COption_u16Z_free(uint32_t _res) {
+       if ((_res & 1) != 0) return;
+       LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(((uint64_t)_res) & ~1);
+       FREE((void*)_res);
+       COption_u16Z_free(_res_conv);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_COption_u16Z_clone(uint32_t orig) {
+       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;
+       return ret_ref;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_CResult_NoneAPIErrorZ_ok() {
        LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
        *ret_conv = CResult_NoneAPIErrorZ_ok();
@@ -8007,6 +8239,36 @@ uint32_t  __attribute__((visibility("default"))) TS_CResult_NonePaymentSendFailu
        return (uint64_t)ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_CResult_PaymentHashPaymentSendFailureZ_ok(int8_tArray o) {
+       LDKThirtyTwoBytes o_ref;
+       CHECK(*((uint32_t*)o) == 32);
+       memcpy(o_ref.data, (uint8_t*)(o + 4), 32);
+       LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+       *ret_conv = CResult_PaymentHashPaymentSendFailureZ_ok(o_ref);
+       return (uint64_t)ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CResult_PaymentHashPaymentSendFailureZ_err(uint32_t e) {
+       LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+       LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+       *ret_conv = CResult_PaymentHashPaymentSendFailureZ_err(e_conv);
+       return (uint64_t)ret_conv;
+}
+
+void  __attribute__((visibility("default"))) TS_CResult_PaymentHashPaymentSendFailureZ_free(uint32_t _res) {
+       if ((_res & 1) != 0) return;
+       LDKCResult_PaymentHashPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentHashPaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+       FREE((void*)_res);
+       CResult_PaymentHashPaymentSendFailureZ_free(_res_conv);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CResult_PaymentHashPaymentSendFailureZ_clone(uint32_t orig) {
+       LDKCResult_PaymentHashPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)(orig & ~1);
+       LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+       *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(orig_conv);
+       return (uint64_t)ret_conv;
+}
+
 void  __attribute__((visibility("default"))) TS_CVec_NetAddressZ_free(uint32_tArray _res) {
        LDKCVec_NetAddressZ _res_constr;
        _res_constr.datalen = *((uint32_t*)_res);
@@ -9707,6 +9969,40 @@ uint32_t  __attribute__((visibility("default"))) TS_CResult_ClosingSignedDecodeE
        return (uint64_t)ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(uint32_t o) {
+       LDKClosingSignedFeeRange o_conv;
+       o_conv.inner = (void*)(o & (~1));
+       o_conv.is_owned = (o & 1) || (o == 0);
+       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;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err(uint32_t e) {
+       LDKDecodeError e_conv;
+       e_conv.inner = (void*)(e & (~1));
+       e_conv.is_owned = (e & 1) || (e == 0);
+       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;
+}
+
+void  __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint32_t _res) {
+       if ((_res & 1) != 0) return;
+       LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(((uint64_t)_res) & ~1);
+       FREE((void*)_res);
+       CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(uint32_t orig) {
+       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;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_CResult_CommitmentSignedDecodeErrorZ_ok(uint32_t o) {
        LDKCommitmentSigned o_conv;
        o_conv.inner = (void*)(o & (~1));
@@ -10656,6 +10952,44 @@ uint32_t  __attribute__((visibility("default"))) TS_CResult_InvoiceSignOrCreatio
        return (uint64_t)ret_conv;
 }
 
+void  __attribute__((visibility("default"))) TS_PaymentPurpose_free(uint32_t this_ptr) {
+       if ((this_ptr & 1) != 0) return;
+       LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(((uint64_t)this_ptr) & ~1);
+       FREE((void*)this_ptr);
+       PaymentPurpose_free(this_ptr_conv);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentPurpose_clone(uint32_t orig) {
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret, int64_t user_payment_id) {
+       LDKThirtyTwoBytes payment_preimage_ref;
+       CHECK(*((uint32_t*)payment_preimage) == 32);
+       memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
+       LDKThirtyTwoBytes payment_secret_ref;
+       CHECK(*((uint32_t*)payment_secret) == 32);
+       memcpy(payment_secret_ref.data, (uint8_t*)(payment_secret + 4), 32);
+       LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
+       *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref, user_payment_id);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentPurpose_spontaneous_payment(int8_tArray a) {
+       LDKThirtyTwoBytes a_ref;
+       CHECK(*((uint32_t*)a) == 32);
+       memcpy(a_ref.data, (uint8_t*)(a + 4), 32);
+       LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
+       *ret_copy = PaymentPurpose_spontaneous_payment(a_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_Event_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKEvent this_ptr_conv = *(LDKEvent*)(((uint64_t)this_ptr) & ~1);
@@ -10671,32 +11005,378 @@ uint32_t  __attribute__((visibility("default"))) TS_Event_clone(uint32_t orig) {
        return ret_ref;
 }
 
-int8_tArray  __attribute__((visibility("default"))) TS_Event_write(uint32_t obj) {
-       LDKEvent* obj_conv = (LDKEvent*)obj;
-       LDKCVec_u8Z ret_var = Event_write(obj_conv);
-       int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
-       memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
-       CVec_u8Z_free(ret_var);
-       return ret_arr;
-}
-
-void  __attribute__((visibility("default"))) TS_MessageSendEvent_free(uint32_t this_ptr) {
-       if ((this_ptr & 1) != 0) return;
-       LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(((uint64_t)this_ptr) & ~1);
-       FREE((void*)this_ptr);
-       MessageSendEvent_free(this_ptr_conv);
-}
-
-uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_clone(uint32_t orig) {
-       LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)orig;
-       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
-       *ret_copy = MessageSendEvent_clone(orig_conv);
+uint32_t  __attribute__((visibility("default"))) 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(*((uint32_t*)temporary_channel_id) == 32);
+       memcpy(temporary_channel_id_ref.data, (uint8_t*)(temporary_channel_id + 4), 32);
+       LDKCVec_u8Z output_script_ref;
+       output_script_ref.datalen = *((uint32_t*)output_script);
+       output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
+       memcpy(output_script_ref.data, (uint8_t*)(output_script + 4), output_script_ref.datalen);
+       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;
        return ret_ref;
 }
 
-void  __attribute__((visibility("default"))) TS_MessageSendEventsProvider_free(uint32_t this_ptr) {
-       if ((this_ptr & 1) != 0) return;
+uint32_t  __attribute__((visibility("default"))) TS_Event_payment_received(int8_tArray payment_hash, int64_t amt, uint32_t purpose) {
+       LDKThirtyTwoBytes payment_hash_ref;
+       CHECK(*((uint32_t*)payment_hash) == 32);
+       memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+       LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(((uint64_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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_payment_sent(int8_tArray payment_preimage) {
+       LDKThirtyTwoBytes payment_preimage_ref;
+       CHECK(*((uint32_t*)payment_preimage) == 32);
+       memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_sent(payment_preimage_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_payment_failed(int8_tArray payment_hash, jboolean rejected_by_dest) {
+       LDKThirtyTwoBytes payment_hash_ref;
+       CHECK(*((uint32_t*)payment_hash) == 32);
+       memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_failed(payment_hash_ref, rejected_by_dest);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) 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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_spendable_outputs(uint32_tArray outputs) {
+       LDKCVec_SpendableOutputDescriptorZ outputs_constr;
+       outputs_constr.datalen = *((uint32_t*)outputs);
+       if (outputs_constr.datalen > 0)
+               outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
+       else
+               outputs_constr.data = NULL;
+       uint32_t* outputs_vals = (uint32_t*)(outputs + 4);
+       for (size_t b = 0; b < outputs_constr.datalen; b++) {
+               uint32_t outputs_conv_27 = outputs_vals[b];
+               LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1);
+               outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_payment_forwarded(uint32_t fee_earned_msat, jboolean claim_from_onchain_tx) {
+       LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(((uint64_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;
+       return ret_ref;
+}
+
+int8_tArray  __attribute__((visibility("default"))) TS_Event_write(uint32_t obj) {
+       LDKEvent* obj_conv = (LDKEvent*)obj;
+       LDKCVec_u8Z ret_var = Event_write(obj_conv);
+       int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+       CVec_u8Z_free(ret_var);
+       return ret_arr;
+}
+
+void  __attribute__((visibility("default"))) TS_MessageSendEvent_free(uint32_t this_ptr) {
+       if ((this_ptr & 1) != 0) return;
+       LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(((uint64_t)this_ptr) & ~1);
+       FREE((void*)this_ptr);
+       MessageSendEvent_free(this_ptr_conv);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_clone(uint32_t orig) {
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_funding_locked(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint32_t updates) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_channel_announcement(uint32_t msg, uint32_t update_msg) {
+       LDKChannelAnnouncement msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelAnnouncement_clone(&msg_conv);
+       LDKChannelUpdate update_msg_conv;
+       update_msg_conv.inner = (void*)(update_msg & (~1));
+       update_msg_conv.is_owned = (update_msg & 1) || (update_msg == 0);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_node_announcement(uint32_t msg) {
+       LDKNodeAnnouncement msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_channel_update(uint32_t msg) {
+       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_broadcast_channel_update(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_channel_update(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint32_t action) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKErrorAction action_conv = *(LDKErrorAction*)(((uint64_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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_payment_failure_network_update(uint32_t update) {
+       LDKHTLCFailChannelUpdate update_conv = *(LDKHTLCFailChannelUpdate*)(((uint64_t)update) & ~1);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_payment_failure_network_update(update_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       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;
+       return ret_ref;
+}
+
+void  __attribute__((visibility("default"))) TS_MessageSendEventsProvider_free(uint32_t this_ptr) {
+       if ((this_ptr & 1) != 0) return;
        LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(((uint64_t)this_ptr) & ~1);
        FREE((void*)this_ptr);
        MessageSendEventsProvider_free(this_ptr_conv);
@@ -10731,13 +11411,64 @@ uint32_t  __attribute__((visibility("default"))) TS_APIError_clone(uint32_t orig
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_APIError_apimisuse_error(jstring err) {
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_fee_rate_too_high(jstring err, int32_t feerate) {
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_route_error(jstring err) {
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_channel_unavailable(jstring err) {
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) 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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_incompatible_shutdown_script(uint32_t script) {
+       LDKShutdownScript script_conv;
+       script_conv.inner = (void*)(script & (~1));
+       script_conv.is_owned = (script & 1) || (script == 0);
+       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;
+       return ret_ref;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_sign(int8_tArray msg, int8_tArray sk) {
        LDKu8slice msg_ref;
        msg_ref.datalen = *((uint32_t*)msg);
        msg_ref.data = (int8_t*)(msg + 4);
-       LDKSecretKey sk_ref;
+       unsigned char sk_arr[32];
        CHECK(*((uint32_t*)sk) == 32);
-       memcpy(sk_ref.bytes, (uint8_t*)(sk + 4), 32);
+       memcpy(sk_arr, (uint8_t*)(sk + 4), 32);
+       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;
@@ -10771,6 +11502,31 @@ uint32_t  __attribute__((visibility("default"))) TS_Level_clone(uint32_t orig) {
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_Level_trace() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_trace());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_debug() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_debug());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_info() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_info());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_warn() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_warn());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_error() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_error());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_Level_eq(uint32_t a, uint32_t b) {
        LDKLevel* a_conv = (LDKLevel*)(a & ~1);
        LDKLevel* b_conv = (LDKLevel*)(b & ~1);
@@ -11054,19 +11810,34 @@ void  __attribute__((visibility("default"))) TS_ChannelConfig_free(uint32_t this
        ChannelConfig_free(this_obj_conv);
 }
 
-int32_t  __attribute__((visibility("default"))) TS_ChannelConfig_get_fee_proportional_millionths(uint32_t this_ptr) {
+int32_t  __attribute__((visibility("default"))) TS_ChannelConfig_get_forwarding_fee_proportional_millionths(uint32_t this_ptr) {
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
-       int32_t ret_val = ChannelConfig_get_fee_proportional_millionths(&this_ptr_conv);
+       int32_t ret_val = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv);
        return ret_val;
 }
 
-void  __attribute__((visibility("default"))) TS_ChannelConfig_set_fee_proportional_millionths(uint32_t this_ptr, int32_t val) {
+void  __attribute__((visibility("default"))) TS_ChannelConfig_set_forwarding_fee_proportional_millionths(uint32_t this_ptr, int32_t val) {
        LDKChannelConfig this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
-       ChannelConfig_set_fee_proportional_millionths(&this_ptr_conv, val);
+       ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val);
+}
+
+int32_t  __attribute__((visibility("default"))) TS_ChannelConfig_get_forwarding_fee_base_msat(uint32_t this_ptr) {
+       LDKChannelConfig this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       int32_t ret_val = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv);
+       return ret_val;
+}
+
+void  __attribute__((visibility("default"))) TS_ChannelConfig_set_forwarding_fee_base_msat(uint32_t this_ptr, int32_t val) {
+       LDKChannelConfig this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val);
 }
 
 int16_t  __attribute__((visibility("default"))) TS_ChannelConfig_get_cltv_expiry_delta(uint32_t this_ptr) {
@@ -11114,8 +11885,38 @@ void  __attribute__((visibility("default"))) TS_ChannelConfig_set_commit_upfront
        ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
 }
 
-uint32_t  __attribute__((visibility("default"))) TS_ChannelConfig_new(int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) {
-       LDKChannelConfig ret_var = ChannelConfig_new(fee_proportional_millionths_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+int64_t  __attribute__((visibility("default"))) TS_ChannelConfig_get_max_dust_htlc_exposure_msat(uint32_t this_ptr) {
+       LDKChannelConfig this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       int64_t ret_val = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv);
+       return ret_val;
+}
+
+void  __attribute__((visibility("default"))) TS_ChannelConfig_set_max_dust_htlc_exposure_msat(uint32_t this_ptr, int64_t val) {
+       LDKChannelConfig this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val);
+}
+
+int64_t  __attribute__((visibility("default"))) TS_ChannelConfig_get_force_close_avoidance_max_fee_satoshis(uint32_t this_ptr) {
+       LDKChannelConfig this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       int64_t ret_val = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv);
+       return ret_val;
+}
+
+void  __attribute__((visibility("default"))) TS_ChannelConfig_set_force_close_avoidance_max_fee_satoshis(uint32_t this_ptr, int64_t val) {
+       LDKChannelConfig this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val);
+}
+
+uint32_t  __attribute__((visibility("default"))) 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);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
        uint64_t ret_ref = (uint64_t)ret_var.inner;
@@ -11252,7 +12053,22 @@ void  __attribute__((visibility("default"))) TS_UserConfig_set_channel_options(u
        UserConfig_set_channel_options(&this_ptr_conv, val_conv);
 }
 
-uint32_t  __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_channel_config_arg, uint32_t peer_channel_config_limits_arg, uint32_t channel_options_arg) {
+jboolean  __attribute__((visibility("default"))) TS_UserConfig_get_accept_forwards_to_priv_channels(uint32_t this_ptr) {
+       LDKUserConfig this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       jboolean ret_val = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv);
+       return ret_val;
+}
+
+void  __attribute__((visibility("default"))) TS_UserConfig_set_accept_forwards_to_priv_channels(uint32_t this_ptr, jboolean val) {
+       LDKUserConfig this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_channel_config_arg, uint32_t peer_channel_config_limits_arg, uint32_t channel_options_arg, jboolean accept_forwards_to_priv_channels_arg) {
        LDKChannelHandshakeConfig own_channel_config_arg_conv;
        own_channel_config_arg_conv.inner = (void*)(own_channel_config_arg & (~1));
        own_channel_config_arg_conv.is_owned = (own_channel_config_arg & 1) || (own_channel_config_arg == 0);
@@ -11265,7 +12081,21 @@ uint32_t  __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_
        channel_options_arg_conv.inner = (void*)(channel_options_arg & (~1));
        channel_options_arg_conv.is_owned = (channel_options_arg & 1) || (channel_options_arg == 0);
        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);
+       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);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_UserConfig_clone(uint32_t orig) {
+       LDKUserConfig orig_conv;
+       orig_conv.inner = (void*)(orig & (~1));
+       orig_conv.is_owned = false;
+       LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
        uint64_t ret_ref = (uint64_t)ret_var.inner;
@@ -11275,11 +12105,29 @@ uint32_t  __attribute__((visibility("default"))) TS_UserConfig_new(uint32_t own_
        return ret_ref;
 }
 
-uint32_t  __attribute__((visibility("default"))) TS_UserConfig_clone(uint32_t orig) {
-       LDKUserConfig orig_conv;
+uint32_t  __attribute__((visibility("default"))) TS_UserConfig_default() {
+       LDKUserConfig ret_var = UserConfig_default();
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+void  __attribute__((visibility("default"))) TS_BestBlock_free(uint32_t this_obj) {
+       LDKBestBlock this_obj_conv;
+       this_obj_conv.inner = (void*)(this_obj & (~1));
+       this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       BestBlock_free(this_obj_conv);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_BestBlock_clone(uint32_t orig) {
+       LDKBestBlock orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
        orig_conv.is_owned = false;
-       LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
+       LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
        uint64_t ret_ref = (uint64_t)ret_var.inner;
@@ -11289,8 +12137,23 @@ uint32_t  __attribute__((visibility("default"))) TS_UserConfig_clone(uint32_t or
        return ret_ref;
 }
 
-uint32_t  __attribute__((visibility("default"))) TS_UserConfig_default() {
-       LDKUserConfig ret_var = UserConfig_default();
+uint32_t  __attribute__((visibility("default"))) TS_BestBlock_from_genesis(uint32_t network) {
+       LDKNetwork network_conv = LDKNetwork_from_js(network);
+       LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_BestBlock_new(int8_tArray block_hash, int32_t height) {
+       LDKThirtyTwoBytes block_hash_ref;
+       CHECK(*((uint32_t*)block_hash) == 32);
+       memcpy(block_hash_ref.data, (uint8_t*)(block_hash + 4), 32);
+       LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
        uint64_t ret_ref = (uint64_t)ret_var.inner;
@@ -11300,12 +12163,39 @@ uint32_t  __attribute__((visibility("default"))) TS_UserConfig_default() {
        return ret_ref;
 }
 
+int8_tArray  __attribute__((visibility("default"))) TS_BestBlock_block_hash(uint32_t this_arg) {
+       LDKBestBlock this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = false;
+       int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(ret_arr + 4), BestBlock_block_hash(&this_arg_conv).data, 32);
+       return ret_arr;
+}
+
+int32_t  __attribute__((visibility("default"))) TS_BestBlock_height(uint32_t this_arg) {
+       LDKBestBlock this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = false;
+       int32_t ret_val = BestBlock_height(&this_arg_conv);
+       return ret_val;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_AccessError_clone(uint32_t orig) {
        LDKAccessError* orig_conv = (LDKAccessError*)(orig & ~1);
        uint32_t ret_conv = LDKAccessError_to_js(AccessError_clone(orig_conv));
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_AccessError_unknown_chain() {
+       uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_chain());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_AccessError_unknown_tx() {
+       uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_tx());
+       return ret_conv;
+}
+
 void  __attribute__((visibility("default"))) TS_Access_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKAccess this_ptr_conv = *(LDKAccess*)(((uint64_t)this_ptr) & ~1);
@@ -11470,6 +12360,28 @@ uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_clone(uin
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_background() {
+       uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_background());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_normal() {
+       uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_normal());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_high_priority() {
+       uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_high_priority());
+       return ret_conv;
+}
+
+jboolean  __attribute__((visibility("default"))) TS_ConfirmationTarget_eq(uint32_t a, uint32_t b) {
+       LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)(a & ~1);
+       LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)(b & ~1);
+       jboolean ret_val = ConfirmationTarget_eq(a_conv, b_conv);
+       return ret_val;
+}
+
 void  __attribute__((visibility("default"))) TS_FeeEstimator_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(((uint64_t)this_ptr) & ~1);
@@ -11604,6 +12516,16 @@ uint32_t  __attribute__((visibility("default"))) TS_ChannelMonitorUpdateErr_clon
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ChannelMonitorUpdateErr_temporary_failure() {
+       uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_temporary_failure());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ChannelMonitorUpdateErr_permanent_failure() {
+       uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_permanent_failure());
+       return ret_conv;
+}
+
 void  __attribute__((visibility("default"))) TS_MonitorUpdateError_free(uint32_t this_obj) {
        LDKMonitorUpdateError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -11640,6 +12562,28 @@ uint32_t  __attribute__((visibility("default"))) TS_MonitorEvent_clone(uint32_t
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_MonitorEvent_htlcevent(uint32_t a) {
+       LDKHTLCUpdate a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MonitorEvent_commitment_tx_broadcasted(uint32_t a) {
+       LDKOutPoint a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = OutPoint_clone(&a_conv);
+       LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+       *ret_copy = MonitorEvent_commitment_tx_broadcasted(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_HTLCUpdate_free(uint32_t this_obj) {
        LDKHTLCUpdate this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -11961,6 +12905,20 @@ ptrArray  __attribute__((visibility("default"))) TS_ChannelMonitor_get_relevant_
        return ret_arr;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ChannelMonitor_current_best_block(uint32_t this_arg) {
+       LDKChannelMonitor this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = false;
+       LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_Persist_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKPersist this_ptr_conv = *(LDKPersist*)(((uint64_t)this_ptr) & ~1);
@@ -12423,6 +13381,40 @@ uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_cl
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_static_output(uint32_t outpoint, uint32_t output) {
+       LDKOutPoint outpoint_conv;
+       outpoint_conv.inner = (void*)(outpoint & (~1));
+       outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0);
+       outpoint_conv = OutPoint_clone(&outpoint_conv);
+       LDKTxOut output_conv = *(LDKTxOut*)(((uint64_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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_delayed_payment_output(uint32_t a) {
+       LDKDelayedPaymentOutputDescriptor a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_static_payment_output(uint32_t a) {
+       LDKStaticPaymentOutputDescriptor a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       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;
+       return ret_ref;
+}
+
 int8_tArray  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_write(uint32_t obj) {
        LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj;
        LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
@@ -12947,30 +13939,37 @@ uint32_t  __attribute__((visibility("default"))) TS_ChainParameters_clone(uint32
        return ret_ref;
 }
 
-void  __attribute__((visibility("default"))) TS_BestBlock_free(uint32_t this_obj) {
-       LDKBestBlock this_obj_conv;
+void  __attribute__((visibility("default"))) TS_ChannelCounterparty_free(uint32_t this_obj) {
+       LDKChannelCounterparty this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
        this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
-       BestBlock_free(this_obj_conv);
+       ChannelCounterparty_free(this_obj_conv);
 }
 
-uint32_t  __attribute__((visibility("default"))) TS_BestBlock_clone(uint32_t orig) {
-       LDKBestBlock orig_conv;
-       orig_conv.inner = (void*)(orig & (~1));
-       orig_conv.is_owned = false;
-       LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
-       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
-       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       uint64_t ret_ref = (uint64_t)ret_var.inner;
-       if (ret_var.is_owned) {
-               ret_ref |= 1;
-       }
-       return ret_ref;
+int8_tArray  __attribute__((visibility("default"))) TS_ChannelCounterparty_get_node_id(uint32_t this_ptr) {
+       LDKChannelCounterparty this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(ret_arr + 4), ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33);
+       return ret_arr;
 }
 
-uint32_t  __attribute__((visibility("default"))) TS_BestBlock_from_genesis(uint32_t network) {
-       LDKNetwork network_conv = LDKNetwork_from_js(network);
-       LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
+void  __attribute__((visibility("default"))) TS_ChannelCounterparty_set_node_id(uint32_t this_ptr, int8_tArray val) {
+       LDKChannelCounterparty this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       LDKPublicKey val_ref;
+       CHECK(*((uint32_t*)val) == 33);
+       memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33);
+       ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ChannelCounterparty_get_features(uint32_t this_ptr) {
+       LDKChannelCounterparty this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
        uint64_t ret_ref = (uint64_t)ret_var.inner;
@@ -12980,11 +13979,37 @@ uint32_t  __attribute__((visibility("default"))) TS_BestBlock_from_genesis(uint3
        return ret_ref;
 }
 
-uint32_t  __attribute__((visibility("default"))) TS_BestBlock_new(int8_tArray block_hash, int32_t height) {
-       LDKThirtyTwoBytes block_hash_ref;
-       CHECK(*((uint32_t*)block_hash) == 32);
-       memcpy(block_hash_ref.data, (uint8_t*)(block_hash + 4), 32);
-       LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
+void  __attribute__((visibility("default"))) TS_ChannelCounterparty_set_features(uint32_t this_ptr, uint32_t val) {
+       LDKChannelCounterparty this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       LDKInitFeatures val_conv;
+       val_conv.inner = (void*)(val & (~1));
+       val_conv.is_owned = (val & 1) || (val == 0);
+       val_conv = InitFeatures_clone(&val_conv);
+       ChannelCounterparty_set_features(&this_ptr_conv, val_conv);
+}
+
+int64_t  __attribute__((visibility("default"))) TS_ChannelCounterparty_get_unspendable_punishment_reserve(uint32_t this_ptr) {
+       LDKChannelCounterparty this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       int64_t ret_val = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv);
+       return ret_val;
+}
+
+void  __attribute__((visibility("default"))) TS_ChannelCounterparty_set_unspendable_punishment_reserve(uint32_t this_ptr, int64_t val) {
+       LDKChannelCounterparty this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ChannelCounterparty_clone(uint32_t orig) {
+       LDKChannelCounterparty orig_conv;
+       orig_conv.inner = (void*)(orig & (~1));
+       orig_conv.is_owned = false;
+       LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
        uint64_t ret_ref = (uint64_t)ret_var.inner;
@@ -12994,23 +14019,6 @@ uint32_t  __attribute__((visibility("default"))) TS_BestBlock_new(int8_tArray bl
        return ret_ref;
 }
 
-int8_tArray  __attribute__((visibility("default"))) TS_BestBlock_block_hash(uint32_t this_arg) {
-       LDKBestBlock this_arg_conv;
-       this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = false;
-       int8_tArray ret_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
-       memcpy((uint8_t*)(ret_arr + 4), BestBlock_block_hash(&this_arg_conv).data, 32);
-       return ret_arr;
-}
-
-int32_t  __attribute__((visibility("default"))) TS_BestBlock_height(uint32_t this_arg) {
-       LDKBestBlock this_arg_conv;
-       this_arg_conv.inner = (void*)(this_arg & (~1));
-       this_arg_conv.is_owned = false;
-       int32_t ret_val = BestBlock_height(&this_arg_conv);
-       return ret_val;
-}
-
 void  __attribute__((visibility("default"))) TS_ChannelDetails_free(uint32_t this_obj) {
        LDKChannelDetails this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -13037,6 +14045,31 @@ void  __attribute__((visibility("default"))) TS_ChannelDetails_set_channel_id(ui
        ChannelDetails_set_channel_id(&this_ptr_conv, val_ref);
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ChannelDetails_get_counterparty(uint32_t this_ptr) {
+       LDKChannelDetails this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+void  __attribute__((visibility("default"))) TS_ChannelDetails_set_counterparty(uint32_t this_ptr, uint32_t val) {
+       LDKChannelDetails this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       LDKChannelCounterparty val_conv;
+       val_conv.inner = (void*)(val & (~1));
+       val_conv.is_owned = (val & 1) || (val == 0);
+       val_conv = ChannelCounterparty_clone(&val_conv);
+       ChannelDetails_set_counterparty(&this_ptr_conv, val_conv);
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_ChannelDetails_get_funding_txo(uint32_t this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
@@ -13080,63 +14113,37 @@ void  __attribute__((visibility("default"))) TS_ChannelDetails_set_short_channel
        ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
 }
 
-int8_tArray  __attribute__((visibility("default"))) TS_ChannelDetails_get_remote_network_id(uint32_t this_ptr) {
-       LDKChannelDetails this_ptr_conv;
-       this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = false;
-       int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
-       memcpy((uint8_t*)(ret_arr + 4), ChannelDetails_get_remote_network_id(&this_ptr_conv).compressed_form, 33);
-       return ret_arr;
-}
-
-void  __attribute__((visibility("default"))) TS_ChannelDetails_set_remote_network_id(uint32_t this_ptr, int8_tArray val) {
-       LDKChannelDetails this_ptr_conv;
-       this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = false;
-       LDKPublicKey val_ref;
-       CHECK(*((uint32_t*)val) == 33);
-       memcpy(val_ref.compressed_form, (uint8_t*)(val + 4), 33);
-       ChannelDetails_set_remote_network_id(&this_ptr_conv, val_ref);
-}
-
-uint32_t  __attribute__((visibility("default"))) TS_ChannelDetails_get_counterparty_features(uint32_t this_ptr) {
+int64_t  __attribute__((visibility("default"))) TS_ChannelDetails_get_channel_value_satoshis(uint32_t this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
-       LDKInitFeatures ret_var = ChannelDetails_get_counterparty_features(&this_ptr_conv);
-       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
-       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
-       uint64_t ret_ref = (uint64_t)ret_var.inner;
-       if (ret_var.is_owned) {
-               ret_ref |= 1;
-       }
-       return ret_ref;
+       int64_t ret_val = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
+       return ret_val;
 }
 
-void  __attribute__((visibility("default"))) TS_ChannelDetails_set_counterparty_features(uint32_t this_ptr, uint32_t val) {
+void  __attribute__((visibility("default"))) TS_ChannelDetails_set_channel_value_satoshis(uint32_t this_ptr, int64_t val) {
        LDKChannelDetails this_ptr_conv;
-       this_ptr_conv.inner = (void*)(this_ptr & (~1));
-       this_ptr_conv.is_owned = false;
-       LDKInitFeatures val_conv;
-       val_conv.inner = (void*)(val & (~1));
-       val_conv.is_owned = (val & 1) || (val == 0);
-       val_conv = InitFeatures_clone(&val_conv);
-       ChannelDetails_set_counterparty_features(&this_ptr_conv, val_conv);
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
 }
 
-int64_t  __attribute__((visibility("default"))) TS_ChannelDetails_get_channel_value_satoshis(uint32_t this_ptr) {
+uint32_t  __attribute__((visibility("default"))) TS_ChannelDetails_get_unspendable_punishment_reserve(uint32_t this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
-       int64_t ret_val = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
-       return ret_val;
+       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;
+       return ret_ref;
 }
 
-void  __attribute__((visibility("default"))) TS_ChannelDetails_set_channel_value_satoshis(uint32_t this_ptr, int64_t val) {
+void  __attribute__((visibility("default"))) TS_ChannelDetails_set_unspendable_punishment_reserve(uint32_t this_ptr, uint32_t val) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
        this_ptr_conv.is_owned = false;
-       ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
+       LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(((uint64_t)val) & ~1);
+       ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
 }
 
 int64_t  __attribute__((visibility("default"))) TS_ChannelDetails_get_user_id(uint32_t this_ptr) {
@@ -13184,6 +14191,42 @@ void  __attribute__((visibility("default"))) TS_ChannelDetails_set_inbound_capac
        ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ChannelDetails_get_confirmations_required(uint32_t this_ptr) {
+       LDKChannelDetails this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       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;
+       return ret_ref;
+}
+
+void  __attribute__((visibility("default"))) TS_ChannelDetails_set_confirmations_required(uint32_t this_ptr, uint32_t val) {
+       LDKChannelDetails this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(((uint64_t)val) & ~1);
+       ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ChannelDetails_get_force_close_spend_delay(uint32_t this_ptr) {
+       LDKChannelDetails this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       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;
+       return ret_ref;
+}
+
+void  __attribute__((visibility("default"))) TS_ChannelDetails_set_force_close_spend_delay(uint32_t this_ptr, uint32_t val) {
+       LDKChannelDetails this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(((uint64_t)val) & ~1);
+       ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
+}
+
 jboolean  __attribute__((visibility("default"))) TS_ChannelDetails_get_is_outbound(uint32_t this_ptr) {
        LDKChannelDetails this_ptr_conv;
        this_ptr_conv.inner = (void*)(this_ptr & (~1));
@@ -13244,6 +14287,32 @@ void  __attribute__((visibility("default"))) TS_ChannelDetails_set_is_public(uin
        ChannelDetails_set_is_public(&this_ptr_conv, val);
 }
 
+uint32_t  __attribute__((visibility("default"))) 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_id_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(*((uint32_t*)channel_id_arg) == 32);
+       memcpy(channel_id_arg_ref.data, (uint8_t*)(channel_id_arg + 4), 32);
+       LDKChannelCounterparty counterparty_arg_conv;
+       counterparty_arg_conv.inner = (void*)(counterparty_arg & (~1));
+       counterparty_arg_conv.is_owned = (counterparty_arg & 1) || (counterparty_arg == 0);
+       counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv);
+       LDKOutPoint funding_txo_arg_conv;
+       funding_txo_arg_conv.inner = (void*)(funding_txo_arg & (~1));
+       funding_txo_arg_conv.is_owned = (funding_txo_arg & 1) || (funding_txo_arg == 0);
+       funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
+       LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)short_channel_id_arg) & ~1);
+       LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(((uint64_t)unspendable_punishment_reserve_arg) & ~1);
+       LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(((uint64_t)confirmations_required_arg) & ~1);
+       LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(((uint64_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_id_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);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_ChannelDetails_clone(uint32_t orig) {
        LDKChannelDetails orig_conv;
        orig_conv.inner = (void*)(orig & (~1));
@@ -13273,6 +14342,74 @@ uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_clone(uin
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_parameter_error(uint32_t a) {
+       LDKAPIError a_conv = *(LDKAPIError*)(((uint64_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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_path_parameter_error(uint32_tArray a) {
+       LDKCVec_CResult_NoneAPIErrorZZ a_constr;
+       a_constr.datalen = *((uint32_t*)a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+       else
+               a_constr.data = NULL;
+       uint32_t* a_vals = (uint32_t*)(a + 4);
+       for (size_t w = 0; w < a_constr.datalen; w++) {
+               uint32_t a_conv_22 = a_vals[w];
+               LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+               a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_all_failed_retry_safe(uint32_tArray a) {
+       LDKCVec_APIErrorZ a_constr;
+       a_constr.datalen = *((uint32_t*)a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
+       else
+               a_constr.data = NULL;
+       uint32_t* a_vals = (uint32_t*)(a + 4);
+       for (size_t k = 0; k < a_constr.datalen; k++) {
+               uint32_t a_conv_10 = a_vals[k];
+               LDKAPIError a_conv_10_conv = *(LDKAPIError*)(((uint64_t)a_conv_10) & ~1);
+               a_conv_10_conv = APIError_clone((LDKAPIError*)(((uint64_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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_partial_failure(uint32_tArray a) {
+       LDKCVec_CResult_NoneAPIErrorZZ a_constr;
+       a_constr.datalen = *((uint32_t*)a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+       else
+               a_constr.data = NULL;
+       uint32_t* a_vals = (uint32_t*)(a + 4);
+       for (size_t w = 0; w < a_constr.datalen; w++) {
+               uint32_t a_conv_22 = a_vals[w];
+               LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+               a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
+               a_constr.data[w] = a_conv_22_conv;
+       }
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_partial_failure(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 uint32_t  __attribute__((visibility("default"))) 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) {
        LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(((uint64_t)fee_est) & ~1);
        LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
@@ -13382,6 +14519,19 @@ uint32_t  __attribute__((visibility("default"))) TS_ChannelManager_close_channel
        return (uint64_t)ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ChannelManager_close_channel_with_target_feerate(uint32_t this_arg, int8_tArray channel_id, int32_t target_feerate_sats_per_1000_weight) {
+       LDKChannelManager this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = false;
+       unsigned char channel_id_arr[32];
+       CHECK(*((uint32_t*)channel_id) == 32);
+       memcpy(channel_id_arr, (uint8_t*)(channel_id + 4), 32);
+       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;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_ChannelManager_force_close_channel(uint32_t this_arg, int8_tArray channel_id) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
@@ -13420,6 +14570,21 @@ uint32_t  __attribute__((visibility("default"))) TS_ChannelManager_send_payment(
        return (uint64_t)ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ChannelManager_send_spontaneous_payment(uint32_t this_arg, uint32_t route, int8_tArray payment_preimage) {
+       LDKChannelManager this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = false;
+       LDKRoute route_conv;
+       route_conv.inner = (void*)(route & (~1));
+       route_conv.is_owned = false;
+       LDKThirtyTwoBytes payment_preimage_ref;
+       CHECK(*((uint32_t*)payment_preimage) == 32);
+       memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
+       LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+       *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref);
+       return (uint64_t)ret_conv;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_ChannelManager_funding_transaction_generated(uint32_t this_arg, int8_tArray temporary_channel_id, int8_tArray funding_transaction) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
@@ -13593,6 +14758,20 @@ void  __attribute__((visibility("default"))) TS_ChannelManager_await_persistable
        ChannelManager_await_persistable_update(&this_arg_conv);
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ChannelManager_current_best_block(uint32_t this_arg) {
+       LDKChannelManager this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = false;
+       LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_ChannelManager_as_ChannelMessageHandler(uint32_t this_arg) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
@@ -13886,6 +15065,7 @@ jstring  __attribute__((visibility("default"))) TS_ErrorMessage_get_data(uint32_
        this_ptr_conv.is_owned = false;
        LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -14961,6 +16141,68 @@ uint32_t  __attribute__((visibility("default"))) TS_Shutdown_clone(uint32_t orig
        return ret_ref;
 }
 
+void  __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_free(uint32_t this_obj) {
+       LDKClosingSignedFeeRange this_obj_conv;
+       this_obj_conv.inner = (void*)(this_obj & (~1));
+       this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       ClosingSignedFeeRange_free(this_obj_conv);
+}
+
+int64_t  __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_get_min_fee_satoshis(uint32_t this_ptr) {
+       LDKClosingSignedFeeRange this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       int64_t ret_val = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv);
+       return ret_val;
+}
+
+void  __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_set_min_fee_satoshis(uint32_t this_ptr, int64_t val) {
+       LDKClosingSignedFeeRange this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val);
+}
+
+int64_t  __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_get_max_fee_satoshis(uint32_t this_ptr) {
+       LDKClosingSignedFeeRange this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       int64_t ret_val = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv);
+       return ret_val;
+}
+
+void  __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_set_max_fee_satoshis(uint32_t this_ptr, int64_t val) {
+       LDKClosingSignedFeeRange this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val);
+}
+
+uint32_t  __attribute__((visibility("default"))) 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);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_clone(uint32_t orig) {
+       LDKClosingSignedFeeRange orig_conv;
+       orig_conv.inner = (void*)(orig & (~1));
+       orig_conv.is_owned = false;
+       LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_ClosingSigned_free(uint32_t this_obj) {
        LDKClosingSigned this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -15021,14 +16263,43 @@ void  __attribute__((visibility("default"))) TS_ClosingSigned_set_signature(uint
        ClosingSigned_set_signature(&this_ptr_conv, val_ref);
 }
 
-uint32_t  __attribute__((visibility("default"))) TS_ClosingSigned_new(int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg) {
+uint32_t  __attribute__((visibility("default"))) TS_ClosingSigned_get_fee_range(uint32_t this_ptr) {
+       LDKClosingSigned this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+void  __attribute__((visibility("default"))) TS_ClosingSigned_set_fee_range(uint32_t this_ptr, uint32_t val) {
+       LDKClosingSigned this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       LDKClosingSignedFeeRange val_conv;
+       val_conv.inner = (void*)(val & (~1));
+       val_conv.is_owned = (val & 1) || (val == 0);
+       val_conv = ClosingSignedFeeRange_clone(&val_conv);
+       ClosingSigned_set_fee_range(&this_ptr_conv, val_conv);
+}
+
+uint32_t  __attribute__((visibility("default"))) 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(*((uint32_t*)channel_id_arg) == 32);
        memcpy(channel_id_arg_ref.data, (uint8_t*)(channel_id_arg + 4), 32);
        LDKSignature signature_arg_ref;
        CHECK(*((uint32_t*)signature_arg) == 64);
        memcpy(signature_arg_ref.compact_form, (uint8_t*)(signature_arg + 4), 64);
-       LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref);
+       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);
+       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);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
        CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
        uint64_t ret_ref = (uint64_t)ret_var.inner;
@@ -15924,6 +17195,46 @@ uint32_t  __attribute__((visibility("default"))) TS_NetAddress_clone(uint32_t or
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_ipv4(int8_tArray addr, int16_t port) {
+       LDKFourBytes addr_ref;
+       CHECK(*((uint32_t*)addr) == 4);
+       memcpy(addr_ref.data, (uint8_t*)(addr + 4), 4);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_ipv4(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_ipv6(int8_tArray addr, int16_t port) {
+       LDKSixteenBytes addr_ref;
+       CHECK(*((uint32_t*)addr) == 16);
+       memcpy(addr_ref.data, (uint8_t*)(addr + 4), 16);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_ipv6(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_onion_v2(int8_tArray addr, int16_t port) {
+       LDKTenBytes addr_ref;
+       CHECK(*((uint32_t*)addr) == 10);
+       memcpy(addr_ref.data, (uint8_t*)(addr + 4), 10);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_onion_v2(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_onion_v3(int8_tArray ed25519_pubkey, int16_t checksum, int8_t version, int16_t port) {
+       LDKThirtyTwoBytes ed25519_pubkey_ref;
+       CHECK(*((uint32_t*)ed25519_pubkey) == 32);
+       memcpy(ed25519_pubkey_ref.data, (uint8_t*)(ed25519_pubkey + 4), 32);
+       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;
+       return ret_ref;
+}
+
 int8_tArray  __attribute__((visibility("default"))) TS_NetAddress_write(uint32_t obj) {
        LDKNetAddress* obj_conv = (LDKNetAddress*)obj;
        LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
@@ -17168,6 +18479,43 @@ uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_clone(uint32_t o
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_disconnect_peer(uint32_t msg) {
+       LDKErrorMessage msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_ignore_error() {
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_ignore_error();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_ignore_and_log(uint32_t a) {
+       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;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_send_error_message(uint32_t msg) {
+       LDKErrorMessage msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       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;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_LightningError_free(uint32_t this_obj) {
        LDKLightningError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -17181,6 +18529,7 @@ jstring  __attribute__((visibility("default"))) TS_LightningError_get_err(uint32
        this_ptr_conv.is_owned = false;
        LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -17490,6 +18839,34 @@ uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_clone(
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_channel_update_message(uint32_t msg) {
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_channel_update_message(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_channel_closed(int64_t short_channel_id, jboolean is_permanent) {
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_channel_closed(short_channel_id, is_permanent);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_node_failure(node_id_ref, is_permanent);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_ChannelMessageHandler_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(((uint64_t)this_ptr) & ~1);
@@ -17564,23 +18941,43 @@ uint32_t  __attribute__((visibility("default"))) TS_ChannelReestablish_read(int8
        return (uint64_t)ret_conv;
 }
 
-int8_tArray  __attribute__((visibility("default"))) TS_ClosingSigned_write(uint32_t obj) {
-       LDKClosingSigned obj_conv;
+int8_tArray  __attribute__((visibility("default"))) TS_ClosingSigned_write(uint32_t obj) {
+       LDKClosingSigned obj_conv;
+       obj_conv.inner = (void*)(obj & (~1));
+       obj_conv.is_owned = false;
+       LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
+       int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+       CVec_u8Z_free(ret_var);
+       return ret_arr;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ClosingSigned_read(int8_tArray ser) {
+       LDKu8slice ser_ref;
+       ser_ref.datalen = *((uint32_t*)ser);
+       ser_ref.data = (int8_t*)(ser + 4);
+       LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
+       *ret_conv = ClosingSigned_read(ser_ref);
+       return (uint64_t)ret_conv;
+}
+
+int8_tArray  __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_write(uint32_t obj) {
+       LDKClosingSignedFeeRange obj_conv;
        obj_conv.inner = (void*)(obj & (~1));
        obj_conv.is_owned = false;
-       LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
+       LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv);
        int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
        memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
        CVec_u8Z_free(ret_var);
        return ret_arr;
 }
 
-uint32_t  __attribute__((visibility("default"))) TS_ClosingSigned_read(int8_tArray ser) {
+uint32_t  __attribute__((visibility("default"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) {
        LDKu8slice ser_ref;
        ser_ref.datalen = *((uint32_t*)ser);
        ser_ref.data = (int8_t*)(ser + 4);
-       LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
-       *ret_conv = ClosingSigned_read(ser_ref);
+       LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
+       *ret_conv = ClosingSignedFeeRange_read(ser_ref);
        return (uint64_t)ret_conv;
 }
 
@@ -20174,6 +21571,191 @@ uint32_t  __attribute__((visibility("default"))) TS_InvoiceFeatures_read(int8_tA
        return (uint64_t)ret_conv;
 }
 
+void  __attribute__((visibility("default"))) TS_ShutdownScript_free(uint32_t this_obj) {
+       LDKShutdownScript this_obj_conv;
+       this_obj_conv.inner = (void*)(this_obj & (~1));
+       this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       ShutdownScript_free(this_obj_conv);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ShutdownScript_clone(uint32_t orig) {
+       LDKShutdownScript orig_conv;
+       orig_conv.inner = (void*)(orig & (~1));
+       orig_conv.is_owned = false;
+       LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+void  __attribute__((visibility("default"))) TS_InvalidShutdownScript_free(uint32_t this_obj) {
+       LDKInvalidShutdownScript this_obj_conv;
+       this_obj_conv.inner = (void*)(this_obj & (~1));
+       this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+       InvalidShutdownScript_free(this_obj_conv);
+}
+
+int8_tArray  __attribute__((visibility("default"))) TS_InvalidShutdownScript_get_script(uint32_t this_ptr) {
+       LDKInvalidShutdownScript this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv);
+       int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+       return ret_arr;
+}
+
+void  __attribute__((visibility("default"))) TS_InvalidShutdownScript_set_script(uint32_t this_ptr, int8_tArray val) {
+       LDKInvalidShutdownScript this_ptr_conv;
+       this_ptr_conv.inner = (void*)(this_ptr & (~1));
+       this_ptr_conv.is_owned = false;
+       LDKCVec_u8Z val_ref;
+       val_ref.datalen = *((uint32_t*)val);
+       val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
+       memcpy(val_ref.data, (uint8_t*)(val + 4), val_ref.datalen);
+       InvalidShutdownScript_set_script(&this_ptr_conv, val_ref);
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_InvalidShutdownScript_new(int8_tArray script_arg) {
+       LDKCVec_u8Z script_arg_ref;
+       script_arg_ref.datalen = *((uint32_t*)script_arg);
+       script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
+       memcpy(script_arg_ref.data, (uint8_t*)(script_arg + 4), script_arg_ref.datalen);
+       LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+int8_tArray  __attribute__((visibility("default"))) TS_ShutdownScript_write(uint32_t obj) {
+       LDKShutdownScript obj_conv;
+       obj_conv.inner = (void*)(obj & (~1));
+       obj_conv.is_owned = false;
+       LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv);
+       int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+       CVec_u8Z_free(ret_var);
+       return ret_arr;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ShutdownScript_read(int8_tArray ser) {
+       LDKu8slice ser_ref;
+       ser_ref.datalen = *((uint32_t*)ser);
+       ser_ref.data = (int8_t*)(ser + 4);
+       LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
+       *ret_conv = ShutdownScript_read(ser_ref);
+       return (uint64_t)ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ShutdownScript_new_p2pkh(int8_tArray pubkey_hash) {
+       unsigned char pubkey_hash_arr[20];
+       CHECK(*((uint32_t*)pubkey_hash) == 20);
+       memcpy(pubkey_hash_arr, (uint8_t*)(pubkey_hash + 4), 20);
+       unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
+       LDKShutdownScript ret_var = ShutdownScript_new_p2pkh(pubkey_hash_ref);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ShutdownScript_new_p2sh(int8_tArray script_hash) {
+       unsigned char script_hash_arr[20];
+       CHECK(*((uint32_t*)script_hash) == 20);
+       memcpy(script_hash_arr, (uint8_t*)(script_hash + 4), 20);
+       unsigned char (*script_hash_ref)[20] = &script_hash_arr;
+       LDKShutdownScript ret_var = ShutdownScript_new_p2sh(script_hash_ref);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) {
+       unsigned char pubkey_hash_arr[20];
+       CHECK(*((uint32_t*)pubkey_hash) == 20);
+       memcpy(pubkey_hash_arr, (uint8_t*)(pubkey_hash + 4), 20);
+       unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
+       LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ShutdownScript_new_p2wsh(int8_tArray script_hash) {
+       unsigned char script_hash_arr[32];
+       CHECK(*((uint32_t*)script_hash) == 32);
+       memcpy(script_hash_arr, (uint8_t*)(script_hash + 4), 32);
+       unsigned char (*script_hash_ref)[32] = &script_hash_arr;
+       LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
+       CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+       CHECK((((uint64_t)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+       uint64_t ret_ref = (uint64_t)ret_var.inner;
+       if (ret_var.is_owned) {
+               ret_ref |= 1;
+       }
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ShutdownScript_new_witness_program(int8_t version, int8_tArray program) {
+       LDKu8slice program_ref;
+       program_ref.datalen = *((uint32_t*)program);
+       program_ref.data = (int8_t*)(program + 4);
+       LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
+       *ret_conv = ShutdownScript_new_witness_program(version, program_ref);
+       return (uint64_t)ret_conv;
+}
+
+int8_tArray  __attribute__((visibility("default"))) TS_ShutdownScript_into_inner(uint32_t this_arg) {
+       LDKShutdownScript this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       this_arg_conv = ShutdownScript_clone(&this_arg_conv);
+       LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv);
+       int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+       CVec_u8Z_free(ret_var);
+       return ret_arr;
+}
+
+int8_tArray  __attribute__((visibility("default"))) TS_ShutdownScript_as_legacy_pubkey(uint32_t this_arg) {
+       LDKShutdownScript this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = false;
+       int8_tArray ret_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(ret_arr + 4), ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33);
+       return ret_arr;
+}
+
+jboolean  __attribute__((visibility("default"))) TS_ShutdownScript_is_compatible(uint32_t this_arg, uint32_t features) {
+       LDKShutdownScript this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = false;
+       LDKInitFeatures features_conv;
+       features_conv.inner = (void*)(features & (~1));
+       features_conv.is_owned = false;
+       jboolean ret_val = ShutdownScript_is_compatible(&this_arg_conv, &features_conv);
+       return ret_val;
+}
+
 void  __attribute__((visibility("default"))) TS_RouteHop_free(uint32_t this_obj) {
        LDKRouteHop this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -20656,6 +22238,56 @@ uint32_t  __attribute__((visibility("default"))) TS_RouteHintHop_clone(uint32_t
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_get_keysend_route(int8_tArray our_node_id, uint32_t network, int8_tArray payee, uint32_tArray first_hops, uint32_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, uint32_t logger) {
+       LDKPublicKey our_node_id_ref;
+       CHECK(*((uint32_t*)our_node_id) == 33);
+       memcpy(our_node_id_ref.compressed_form, (uint8_t*)(our_node_id + 4), 33);
+       LDKNetworkGraph network_conv;
+       network_conv.inner = (void*)(network & (~1));
+       network_conv.is_owned = false;
+       LDKPublicKey payee_ref;
+       CHECK(*((uint32_t*)payee) == 33);
+       memcpy(payee_ref.compressed_form, (uint8_t*)(payee + 4), 33);
+       LDKCVec_ChannelDetailsZ first_hops_constr;
+       LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
+       if (first_hops != 0) {
+               first_hops_constr.datalen = *((uint32_t*)first_hops);
+               if (first_hops_constr.datalen > 0)
+                       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 = (uint32_t*)(first_hops + 4);
+               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_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
+                       first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+                       first_hops_constr.data[q] = first_hops_conv_16_conv;
+               }
+               first_hops_ptr = &first_hops_constr;
+       }
+       LDKCVec_RouteHintZ last_hops_constr;
+       last_hops_constr.datalen = *((uint32_t*)last_hops);
+       if (last_hops_constr.datalen > 0)
+               last_hops_constr.data = MALLOC(last_hops_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+       else
+               last_hops_constr.data = NULL;
+       uint32_t* last_hops_vals = (uint32_t*)(last_hops + 4);
+       for (size_t l = 0; l < last_hops_constr.datalen; l++) {
+               uint32_t last_hops_conv_11 = last_hops_vals[l];
+               LDKRouteHint last_hops_conv_11_conv;
+               last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
+               last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
+               last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
+               last_hops_constr.data[l] = last_hops_conv_11_conv;
+       }
+       LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+       LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+       *ret_conv = get_keysend_route(our_node_id_ref, &network_conv, payee_ref, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
+       if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
+       return (uint64_t)ret_conv;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_get_route(int8_tArray our_node_id, uint32_t network, int8_tArray payee, uint32_t payee_features, uint32_tArray first_hops, uint32_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, uint32_t logger) {
        LDKPublicKey our_node_id_ref;
        CHECK(*((uint32_t*)our_node_id) == 33);
@@ -20671,18 +22303,22 @@ uint32_t  __attribute__((visibility("default"))) TS_get_route(int8_tArray our_no
        payee_features_conv.is_owned = (payee_features & 1) || (payee_features == 0);
        payee_features_conv = InvoiceFeatures_clone(&payee_features_conv);
        LDKCVec_ChannelDetailsZ first_hops_constr;
-       first_hops_constr.datalen = *((uint32_t*)first_hops);
-       if (first_hops_constr.datalen > 0)
-               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 = (uint32_t*)(first_hops + 4);
-       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_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
-               first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
-               first_hops_constr.data[q] = first_hops_conv_16_conv;
+       LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
+       if (first_hops != 0) {
+               first_hops_constr.datalen = *((uint32_t*)first_hops);
+               if (first_hops_constr.datalen > 0)
+                       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 = (uint32_t*)(first_hops + 4);
+               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_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
+                       first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+                       first_hops_constr.data[q] = first_hops_conv_16_conv;
+               }
+               first_hops_ptr = &first_hops_constr;
        }
        LDKCVec_RouteHintZ last_hops_constr;
        last_hops_constr.datalen = *((uint32_t*)last_hops);
@@ -20701,8 +22337,8 @@ uint32_t  __attribute__((visibility("default"))) TS_get_route(int8_tArray our_no
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
-       *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, payee_features_conv, &first_hops_constr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
-       FREE(first_hops_constr.data);
+       *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
+       if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
        return (uint64_t)ret_conv;
 }
 
@@ -21851,6 +23487,7 @@ jstring  __attribute__((visibility("default"))) TS_FilesystemPersister_get_data_
        this_arg_conv.is_owned = false;
        LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -21920,6 +23557,16 @@ uint32_t  __attribute__((visibility("default"))) TS_BackgroundProcessor_start(ui
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_BackgroundProcessor_join(uint32_t this_arg) {
+       LDKBackgroundProcessor this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = (this_arg & 1) || (this_arg == 0);
+       // Warning: we need a move here but no clone is available for LDKBackgroundProcessor
+       LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
+       *ret_conv = BackgroundProcessor_join(this_arg_conv);
+       return (uint64_t)ret_conv;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_BackgroundProcessor_stop(uint32_t this_arg) {
        LDKBackgroundProcessor this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
@@ -22150,6 +23797,26 @@ uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_clone(uint32_t orig
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_milli() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_milli());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_micro() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_micro());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_nano() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_nano());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_pico() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_pico());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_SiPrefix_eq(uint32_t a, uint32_t b) {
        LDKSiPrefix* a_conv = (LDKSiPrefix*)(a & ~1);
        LDKSiPrefix* b_conv = (LDKSiPrefix*)(b & ~1);
@@ -22169,6 +23836,31 @@ uint32_t  __attribute__((visibility("default"))) TS_Currency_clone(uint32_t orig
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_Currency_bitcoin() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_bitcoin_testnet() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin_testnet());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_regtest() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_regtest());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_simnet() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_simnet());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_signet() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_signet());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_Currency_eq(uint32_t a, uint32_t b) {
        LDKCurrency* a_conv = (LDKCurrency*)(a & ~1);
        LDKCurrency* b_conv = (LDKCurrency*)(b & ~1);
@@ -22351,6 +24043,38 @@ uint32_t  __attribute__((visibility("default"))) TS_Fallback_clone(uint32_t orig
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_Fallback_seg_wit_program(int8_t version, int8_tArray program) {
+       
+       LDKCVec_u8Z program_ref;
+       program_ref.datalen = *((uint32_t*)program);
+       program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
+       memcpy(program_ref.data, (uint8_t*)(program + 4), program_ref.datalen);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Fallback_pub_key_hash(int8_tArray a) {
+       LDKTwentyBytes a_ref;
+       CHECK(*((uint32_t*)a) == 20);
+       memcpy(a_ref.data, (uint8_t*)(a + 4), 20);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_pub_key_hash(a_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Fallback_script_hash(int8_tArray a) {
+       LDKTwentyBytes a_ref;
+       CHECK(*((uint32_t*)a) == 20);
+       memcpy(a_ref.data, (uint8_t*)(a + 4), 20);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_script_hash(a_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_Fallback_eq(uint32_t a, uint32_t b) {
        LDKFallback* a_conv = (LDKFallback*)a;
        LDKFallback* b_conv = (LDKFallback*)b;
@@ -22851,6 +24575,7 @@ jstring  __attribute__((visibility("default"))) TS_Description_into_inner(uint32
        this_arg_conv = Description_clone(&this_arg_conv);
        LDKStr ret_str = Description_into_inner(this_arg_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -22913,6 +24638,26 @@ uint32_t  __attribute__((visibility("default"))) TS_CreationError_clone(uint32_t
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_description_too_long() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_description_too_long());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_route_too_long() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_route_too_long());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_timestamp_out_of_bounds() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_timestamp_out_of_bounds());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_expiry_time_out_of_bounds() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_expiry_time_out_of_bounds());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_CreationError_eq(uint32_t a, uint32_t b) {
        LDKCreationError* a_conv = (LDKCreationError*)(a & ~1);
        LDKCreationError* b_conv = (LDKCreationError*)(b & ~1);
@@ -22924,6 +24669,7 @@ jstring  __attribute__((visibility("default"))) TS_CreationError_to_str(uint32_t
        LDKCreationError* o_conv = (LDKCreationError*)(o & ~1);
        LDKStr ret_str = CreationError_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -22933,6 +24679,46 @@ uint32_t  __attribute__((visibility("default"))) TS_SemanticError_clone(uint32_t
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_no_payment_hash() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_hash());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_multiple_payment_hashes() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_hashes());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_no_description() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_description());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_multiple_descriptions() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_descriptions());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_multiple_payment_secrets() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_secrets());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_invalid_features() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_features());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_invalid_recovery_id() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_recovery_id());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_invalid_signature() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_signature());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_SemanticError_eq(uint32_t a, uint32_t b) {
        LDKSemanticError* a_conv = (LDKSemanticError*)(a & ~1);
        LDKSemanticError* b_conv = (LDKSemanticError*)(b & ~1);
@@ -22944,6 +24730,7 @@ jstring  __attribute__((visibility("default"))) TS_SemanticError_to_str(uint32_t
        LDKSemanticError* o_conv = (LDKSemanticError*)(o & ~1);
        LDKStr ret_str = SemanticError_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -22962,6 +24749,21 @@ uint32_t  __attribute__((visibility("default"))) TS_SignOrCreationError_clone(ui
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SignOrCreationError_sign_error() {
+       LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
+       *ret_copy = SignOrCreationError_sign_error();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SignOrCreationError_creation_error(uint32_t a) {
+       LDKCreationError a_conv = LDKCreationError_from_js(a);
+       LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
+       *ret_copy = SignOrCreationError_creation_error(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_SignOrCreationError_eq(uint32_t a, uint32_t b) {
        LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)a;
        LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)b;
@@ -22973,6 +24775,7 @@ jstring  __attribute__((visibility("default"))) TS_SignOrCreationError_to_str(ui
        LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)o;
        LDKStr ret_str = SignOrCreationError_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23016,6 +24819,7 @@ jstring  __attribute__((visibility("default"))) TS_Invoice_to_str(uint32_t o) {
        o_conv.is_owned = false;
        LDKStr ret_str = Invoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23025,6 +24829,7 @@ jstring  __attribute__((visibility("default"))) TS_SignedRawInvoice_to_str(uint3
        o_conv.is_owned = false;
        LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23032,6 +24837,7 @@ jstring  __attribute__((visibility("default"))) TS_Currency_to_str(uint32_t o) {
        LDKCurrency* o_conv = (LDKCurrency*)(o & ~1);
        LDKStr ret_str = Currency_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23039,6 +24845,7 @@ jstring  __attribute__((visibility("default"))) TS_SiPrefix_to_str(uint32_t o) {
        LDKSiPrefix* o_conv = (LDKSiPrefix*)(o & ~1);
        LDKStr ret_str = SiPrefix_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }