long msg_ref = (long)msg_var.inner & ~1;
return 0 /* LDKMessageSendEvent - SendShortIdsQuery */; (void) node_id_arr; (void) msg_ref;
}
+ case LDKMessageSendEvent_SendReplyChannelRange: {
+ int8_tArray node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(node_id_arr + 4), obj->send_reply_channel_range.node_id.compressed_form, 33);
+ LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
+ CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long msg_ref = (long)msg_var.inner & ~1;
+ return 0 /* LDKMessageSendEvent - SendReplyChannelRange */; (void) node_id_arr; (void) msg_ref;
+ }
default: abort();
}
}
long err_ref = (long)err_var.inner & ~1;
return err_ref;
}
+jboolean __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_result_ok(uint32_t arg) {
+ return ((LDKCResult_InvoiceFeaturesDecodeErrorZ*)arg)->result_ok;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint32_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+ CHECK(val->result_ok);
+ LDKInvoiceFeatures res_var = (*val->contents.result);
+ CHECK((((long)res_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&res_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long res_ref = (long)res_var.inner & ~1;
+ return res_ref;
+}
+uint32_t __attribute__((visibility("default"))) TS_LDKCResult_InvoiceFeaturesDecodeErrorZ_get_err(uint32_t arg) {
+ LDKCResult_InvoiceFeaturesDecodeErrorZ *val = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)(arg & ~1);
+ CHECK(!val->result_ok);
+ LDKDecodeError err_var = (*val->contents.err);
+ CHECK((((long)err_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&err_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long err_ref = (long)err_var.inner & ~1;
+ return err_ref;
+}
jboolean __attribute__((visibility("default"))) TS_LDKCResult_ChannelConfigDecodeErrorZ_result_ok(uint32_t arg) {
return ((LDKCResult_ChannelConfigDecodeErrorZ*)arg)->result_ok;
}
FREE(j_calls);
}
}
-LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
+LDKPublicKey get_per_commitment_point_LDKSign_jcall(const void* this_arg, uint64_t idx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_1(j_calls->get_per_commitment_point_meth, idx);
LDKPublicKey ret_ref;
memcpy(ret_ref.compressed_form, (uint8_t*)(ret + 4), 33);
return ret_ref;
}
-LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
+LDKThirtyTwoBytes release_commitment_secret_LDKSign_jcall(const void* this_arg, uint64_t idx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_1(j_calls->release_commitment_secret_meth, idx);
LDKThirtyTwoBytes ret_ref;
memcpy(ret_ref.data, (uint8_t*)(ret + 4), 32);
return ret_ref;
}
-LDKThirtyTwoBytes channel_keys_id_jcall(const void* this_arg) {
+LDKThirtyTwoBytes channel_keys_id_LDKSign_jcall(const void* this_arg) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->channel_keys_id_meth);
LDKThirtyTwoBytes ret_ref;
memcpy(ret_ref.data, (uint8_t*)(ret + 4), 32);
return ret_ref;
}
-LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx) {
+LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
commitment_tx_var = CommitmentTransaction_clone(commitment_tx);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)ret);
return ret_conv;
}
-LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
+LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx);
ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_justice_transaction_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) {
+LDKCResult_SignatureNoneZ sign_justice_transaction_LDKSign_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKTransaction justice_tx_var = justice_tx;
int8_tArray justice_tx_arr = init_arr(justice_tx_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) {
+LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKSign_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKTransaction htlc_tx_var = htlc_tx;
int8_tArray htlc_tx_arr = init_arr(htlc_tx_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
+LDKCResult_SignatureNoneZ sign_closing_transaction_LDKSign_jcall(const void* this_arg, LDKTransaction closing_tx) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKTransaction closing_tx_var = closing_tx;
int8_tArray closing_tx_arr = init_arr(closing_tx_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
+LDKCResult_SignatureNoneZ sign_channel_announcement_LDKSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKUnsignedChannelAnnouncement msg_var = *msg;
msg_var = UnsignedChannelAnnouncement_clone(msg);
ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)ret);
return ret_conv;
}
-void ready_channel_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
+void ready_channel_LDKSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters);
}
js_invoke_function_1(j_calls->ready_channel_meth, channel_parameters_ref);
}
-LDKCVec_u8Z write_jcall(const void* this_arg) {
+LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->write_meth);
LDKCVec_u8Z ret_ref;
LDKSign ret = {
.this_arg = (void*) calls,
- .get_per_commitment_point = get_per_commitment_point_jcall,
- .release_commitment_secret = release_commitment_secret_jcall,
- .channel_keys_id = channel_keys_id_jcall,
- .sign_counterparty_commitment = sign_counterparty_commitment_jcall,
- .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_jcall,
- .sign_justice_transaction = sign_justice_transaction_jcall,
- .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall,
- .sign_closing_transaction = sign_closing_transaction_jcall,
- .sign_channel_announcement = sign_channel_announcement_jcall,
- .ready_channel = ready_channel_jcall,
+ .get_per_commitment_point = get_per_commitment_point_LDKSign_jcall,
+ .release_commitment_secret = release_commitment_secret_LDKSign_jcall,
+ .channel_keys_id = channel_keys_id_LDKSign_jcall,
+ .sign_counterparty_commitment = sign_counterparty_commitment_LDKSign_jcall,
+ .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKSign_jcall,
+ .sign_justice_transaction = sign_justice_transaction_LDKSign_jcall,
+ .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKSign_jcall,
+ .sign_closing_transaction = sign_closing_transaction_LDKSign_jcall,
+ .sign_channel_announcement = sign_channel_announcement_LDKSign_jcall,
+ .ready_channel = ready_channel_LDKSign_jcall,
.clone = LDKSign_JCalls_clone,
- .write = write_jcall,
+ .write = write_LDKSign_jcall,
.free = LDKSign_JCalls_free,
.pubkeys = pubkeys_conv,
.set_pubkeys = NULL,
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
+LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
LDKOutPoint funding_txo_var = funding_txo;
CHECK((((long)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)ret);
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
+LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
LDKOutPoint funding_txo_var = funding_txo;
CHECK((((long)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)ret);
return ret_conv;
}
-LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) {
+LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
uint32_tArray ret = js_invoke_function_0(j_calls->release_pending_monitor_events_meth);
LDKCVec_MonitorEventZ ret_constr;
LDKWatch ret = {
.this_arg = (void*) calls,
- .watch_channel = watch_channel_jcall,
- .update_channel = update_channel_jcall,
- .release_pending_monitor_events = release_pending_monitor_events_jcall,
+ .watch_channel = watch_channel_LDKWatch_jcall,
+ .update_channel = update_channel_LDKWatch_jcall,
+ .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
.free = LDKWatch_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
+void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
LDKTransaction tx_var = tx;
int8_tArray tx_arr = init_arr(tx_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
LDKBroadcasterInterface ret = {
.this_arg = (void*) calls,
- .broadcast_transaction = broadcast_transaction_jcall,
+ .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
.free = LDKBroadcasterInterface_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKSecretKey get_node_secret_jcall(const void* this_arg) {
+LDKSecretKey get_node_secret_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->get_node_secret_meth);
LDKSecretKey ret_ref;
memcpy(ret_ref.bytes, (uint8_t*)(ret + 4), 32);
return ret_ref;
}
-LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
+LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->get_destination_script_meth);
LDKCVec_u8Z ret_ref;
memcpy(ret_ref.data, (uint8_t*)(ret + 4), ret_ref.datalen);
return ret_ref;
}
-LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
+LDKPublicKey get_shutdown_pubkey_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;
memcpy(ret_ref.compressed_form, (uint8_t*)(ret + 4), 33);
return ret_ref;
}
-LDKSign get_channel_signer_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
+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);
LDKSign ret_conv = *(LDKSign*)(((uint64_t)ret) & ~1);
ret_conv = Sign_clone(ret);
return ret_conv;
}
-LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
+LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
int8_tArray ret = js_invoke_function_0(j_calls->get_secure_random_bytes_meth);
LDKThirtyTwoBytes ret_ref;
memcpy(ret_ref.data, (uint8_t*)(ret + 4), 32);
return ret_ref;
}
-LDKCResult_SignDecodeErrorZ read_chan_signer_jcall(const void* this_arg, LDKu8slice reader) {
+LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
LDKu8slice reader_var = reader;
int8_tArray reader_arr = init_arr(reader_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
LDKKeysInterface ret = {
.this_arg = (void*) calls,
- .get_node_secret = get_node_secret_jcall,
- .get_destination_script = get_destination_script_jcall,
- .get_shutdown_pubkey = get_shutdown_pubkey_jcall,
- .get_channel_signer = get_channel_signer_jcall,
- .get_secure_random_bytes = get_secure_random_bytes_jcall,
- .read_chan_signer = read_chan_signer_jcall,
+ .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_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,
.free = LDKKeysInterface_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
+uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) 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);
LDKFeeEstimator ret = {
.this_arg = (void*) calls,
- .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall,
+ .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
.free = LDKFeeEstimator_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void log_jcall(const void* this_arg, const char* record) {
+void log_LDKLogger_jcall(const void* this_arg, const char* record) {
LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
const char* record_str = record;
jstring record_conv = str_ref_to_ts(record_str, strlen(record_str));
LDKLogger ret = {
.this_arg = (void*) calls,
- .log = log_jcall,
+ .log = log_LDKLogger_jcall,
.free = LDKLogger_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
+LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
uint32_tArray ret = js_invoke_function_0(j_calls->get_and_clear_pending_msg_events_meth);
LDKCVec_MessageSendEventZ ret_constr;
LDKMessageSendEventsProvider ret = {
.this_arg = (void*) calls,
- .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall,
+ .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
.free = LDKMessageSendEventsProvider_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
+LDKCVec_EventZ get_and_clear_pending_events_LDKEventsProvider_jcall(const void* this_arg) {
LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
uint32_tArray ret = js_invoke_function_0(j_calls->get_and_clear_pending_events_meth);
LDKCVec_EventZ ret_constr;
LDKEventsProvider ret = {
.this_arg = (void*) calls,
- .get_and_clear_pending_events = get_and_clear_pending_events_jcall,
+ .get_and_clear_pending_events = get_and_clear_pending_events_LDKEventsProvider_jcall,
.free = LDKEventsProvider_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
+LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
int8_tArray genesis_hash_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(genesis_hash_arr + 4), *genesis_hash, 32);
LDKAccess ret = {
.this_arg = (void*) calls,
- .get_utxo = get_utxo_jcall,
+ .get_utxo = get_utxo_LDKAccess_jcall,
.free = LDKAccess_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void block_connected_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
+void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
LDKu8slice block_var = block;
int8_tArray block_arr = init_arr(block_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(block_arr + 4), block_var.data, block_var.datalen);
js_invoke_function_2(j_calls->block_connected_meth, block_arr, height);
}
-void block_disconnected_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
+void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
int8_tArray header_arr = init_arr(80, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(header_arr + 4), *header, 80);
LDKListen ret = {
.this_arg = (void*) calls,
- .block_connected = block_connected_jcall,
- .block_disconnected = block_disconnected_jcall,
+ .block_connected = block_connected_LDKListen_jcall,
+ .block_disconnected = block_disconnected_LDKListen_jcall,
.free = LDKListen_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-void register_tx_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
+void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
int8_tArray txid_arr = init_arr(32, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(txid_arr + 4), *txid, 32);
memcpy((uint8_t*)(script_pubkey_arr + 4), script_pubkey_var.data, script_pubkey_var.datalen);
js_invoke_function_2(j_calls->register_tx_meth, txid_arr, script_pubkey_arr);
}
-void register_output_jcall(const void* this_arg, const LDKOutPoint * outpoint, LDKu8slice script_pubkey) {
+void register_output_LDKFilter_jcall(const void* this_arg, const LDKOutPoint * outpoint, LDKu8slice script_pubkey) {
LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
LDKOutPoint outpoint_var = *outpoint;
outpoint_var = OutPoint_clone(outpoint);
LDKFilter ret = {
.this_arg = (void*) calls,
- .register_tx = register_tx_jcall,
- .register_output = register_output_jcall,
+ .register_tx = register_tx_LDKFilter_jcall,
+ .register_output = register_output_LDKFilter_jcall,
.free = LDKFilter_JCalls_free,
};
return ret;
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitor * data) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
LDKOutPoint id_var = id;
CHECK((((long)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)ret);
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data) {
+LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
LDKOutPoint id_var = id;
CHECK((((long)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
LDKPersist ret = {
.this_arg = (void*) calls,
- .persist_new_channel = persist_new_channel_jcall,
- .update_persisted_channel = update_persisted_channel_jcall,
+ .persist_new_channel = persist_new_channel_LDKPersist_jcall,
+ .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
.free = LDKPersist_JCalls_free,
};
return ret;
uint32_t peer_disconnected_meth;
uint32_t peer_connected_meth;
uint32_t handle_channel_reestablish_meth;
+ uint32_t handle_channel_update_meth;
uint32_t handle_error_meth;
} LDKChannelMessageHandler_JCalls;
static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
js_free(j_calls->peer_disconnected_meth);
js_free(j_calls->peer_connected_meth);
js_free(j_calls->handle_channel_reestablish_meth);
+ js_free(j_calls->handle_channel_update_meth);
js_free(j_calls->handle_error_meth);
FREE(j_calls);
}
}
-void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
+void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_3(j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
}
-void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
+void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_3(j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref);
}
-void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
+void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref);
}
-void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
+void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref);
}
-void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked * msg) {
+void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref);
}
-void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
+void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_3(j_calls->handle_shutdown_meth, their_node_id_arr, their_features_ref, msg_ref);
}
-void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
+void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref);
}
-void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
+void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
+void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
+void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
+void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref);
}
-void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
+void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref);
}
-void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
+void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref);
}
-void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
+void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref);
}
-void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
+void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref);
}
-void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
+void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
js_invoke_function_2(j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible);
}
-void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
+void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
}
-void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
+void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref);
}
-void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
+void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
+ LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
+ int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
+ memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
+ LDKChannelUpdate msg_var = *msg;
+ msg_var = ChannelUpdate_clone(msg);
+ CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long msg_ref = (long)msg_var.inner;
+ if (msg_var.is_owned) {
+ msg_ref |= 1;
+ }
+ js_invoke_function_2(j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref);
+}
+void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKChannelMessageHandler ret = {
.this_arg = (void*) calls,
- .handle_open_channel = handle_open_channel_jcall,
- .handle_accept_channel = handle_accept_channel_jcall,
- .handle_funding_created = handle_funding_created_jcall,
- .handle_funding_signed = handle_funding_signed_jcall,
- .handle_funding_locked = handle_funding_locked_jcall,
- .handle_shutdown = handle_shutdown_jcall,
- .handle_closing_signed = handle_closing_signed_jcall,
- .handle_update_add_htlc = handle_update_add_htlc_jcall,
- .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall,
- .handle_update_fail_htlc = handle_update_fail_htlc_jcall,
- .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall,
- .handle_commitment_signed = handle_commitment_signed_jcall,
- .handle_revoke_and_ack = handle_revoke_and_ack_jcall,
- .handle_update_fee = handle_update_fee_jcall,
- .handle_announcement_signatures = handle_announcement_signatures_jcall,
- .peer_disconnected = peer_disconnected_jcall,
- .peer_connected = peer_connected_jcall,
- .handle_channel_reestablish = handle_channel_reestablish_jcall,
- .handle_error = handle_error_jcall,
+ .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
+ .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
+ .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
+ .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
+ .handle_funding_locked = handle_funding_locked_LDKChannelMessageHandler_jcall,
+ .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
+ .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
+ .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
+ .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
+ .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
+ .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
+ .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
+ .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
+ .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
+ .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
+ .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
+ .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
+ .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
+ .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
+ .handle_error = handle_error_LDKChannelMessageHandler_jcall,
.free = LDKChannelMessageHandler_JCalls_free,
.MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
};
(this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
}
+void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_channel_update(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
+ LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
+ LDKPublicKey their_node_id_ref;
+ CHECK(*((uint32_t*)their_node_id) == 33);
+ memcpy(their_node_id_ref.compressed_form, (uint8_t*)(their_node_id + 4), 33);
+ LDKChannelUpdate msg_conv;
+ msg_conv.inner = (void*)(msg & (~1));
+ msg_conv.is_owned = false;
+ (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
+}
+
void __attribute__((visibility("default"))) TS_ChannelMessageHandler_handle_error(uint32_t this_arg, int8_tArray their_node_id, uint32_t msg) {
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
LDKPublicKey their_node_id_ref;
FREE(j_calls);
}
}
-LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
+LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
LDKNodeAnnouncement msg_var = *msg;
msg_var = NodeAnnouncement_clone(msg);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
+LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
LDKChannelAnnouncement msg_var = *msg;
msg_var = ChannelAnnouncement_clone(msg);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
+LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
LDKChannelUpdate msg_var = *msg;
msg_var = ChannelUpdate_clone(msg);
ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)ret);
return ret_conv;
}
-void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate * update) {
+void handle_htlc_fail_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate * update) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
long ret_update = (long)update;
js_invoke_function_1(j_calls->handle_htlc_fail_channel_update_meth, ret_update);
}
-LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
+LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
uint32_tArray ret = js_invoke_function_2(j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr;
}
return ret_constr;
}
-LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
+LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int8_tArray starting_point_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(starting_point_arr + 4), starting_point.compressed_form, 33);
}
return ret_constr;
}
-void sync_routing_table_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
+void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
}
js_invoke_function_2(j_calls->sync_routing_table_meth, their_node_id_arr, init_ref);
}
-LDKCResult_NoneLightningErrorZ handle_reply_channel_range_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
+LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
+LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_NoneLightningErrorZ handle_query_channel_range_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
+LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)ret);
return ret_conv;
}
-LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
+LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
int8_tArray their_node_id_arr = init_arr(33, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(their_node_id_arr + 4), their_node_id.compressed_form, 33);
LDKRoutingMessageHandler ret = {
.this_arg = (void*) calls,
- .handle_node_announcement = handle_node_announcement_jcall,
- .handle_channel_announcement = handle_channel_announcement_jcall,
- .handle_channel_update = handle_channel_update_jcall,
- .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
- .get_next_channel_announcements = get_next_channel_announcements_jcall,
- .get_next_node_announcements = get_next_node_announcements_jcall,
- .sync_routing_table = sync_routing_table_jcall,
- .handle_reply_channel_range = handle_reply_channel_range_jcall,
- .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_jcall,
- .handle_query_channel_range = handle_query_channel_range_jcall,
- .handle_query_short_channel_ids = handle_query_short_channel_ids_jcall,
+ .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
+ .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
+ .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
+ .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_LDKRoutingMessageHandler_jcall,
+ .get_next_channel_announcements = get_next_channel_announcements_LDKRoutingMessageHandler_jcall,
+ .get_next_node_announcements = get_next_node_announcements_LDKRoutingMessageHandler_jcall,
+ .sync_routing_table = sync_routing_table_LDKRoutingMessageHandler_jcall,
+ .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
+ .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
+ .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
+ .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
.free = LDKRoutingMessageHandler_JCalls_free,
.MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
};
FREE(j_calls);
}
}
-uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
+uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
LDKu8slice data_var = data;
int8_tArray data_arr = init_arr(data_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
memcpy((uint8_t*)(data_arr + 4), data_var.data, data_var.datalen);
return js_invoke_function_2(j_calls->send_data_meth, data_arr, resume_read);
}
-void disconnect_socket_jcall(void* this_arg) {
+void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
js_invoke_function_0(j_calls->disconnect_socket_meth);
}
-bool eq_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
+bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
*other_arg_clone = SocketDescriptor_clone(other_arg);
return js_invoke_function_1(j_calls->eq_meth, (long)other_arg_clone);
}
-uint64_t hash_jcall(const void* this_arg) {
+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);
}
LDKSocketDescriptor ret = {
.this_arg = (void*) calls,
- .send_data = send_data_jcall,
- .disconnect_socket = disconnect_socket_jcall,
- .eq = eq_jcall,
- .hash = hash_jcall,
+ .send_data = send_data_LDKSocketDescriptor_jcall,
+ .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
+ .eq = eq_LDKSocketDescriptor_jcall,
+ .hash = hash_LDKSocketDescriptor_jcall,
.clone = LDKSocketDescriptor_JCalls_clone,
.free = LDKSocketDescriptor_JCalls_free,
};
CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
}
+uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint32_t o) {
+ LDKInvoiceFeatures o_conv;
+ o_conv.inner = (void*)(o & (~1));
+ o_conv.is_owned = (o & 1) || (o == 0);
+ o_conv = InvoiceFeatures_clone(&o_conv);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
+ return (long)ret_conv;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_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_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
+ return (long)ret_conv;
+}
+
+void __attribute__((visibility("default"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint32_t _res) {
+ if ((_res & 1) != 0) return;
+ LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(((uint64_t)_res) & ~1);
+ FREE((void*)_res);
+ CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
+}
+
uint32_t __attribute__((visibility("default"))) TS_CResult_ChannelConfigDecodeErrorZ_ok(uint32_t o) {
LDKChannelConfig o_conv;
o_conv.inner = (void*)(o & (~1));
ChannelConfig_set_fee_proportional_millionths(&this_ptr_conv, val);
}
+int16_t __attribute__((visibility("default"))) TS_ChannelConfig_get_cltv_expiry_delta(uint32_t this_ptr) {
+ LDKChannelConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ int16_t ret_val = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
+ return ret_val;
+}
+
+void __attribute__((visibility("default"))) TS_ChannelConfig_set_cltv_expiry_delta(uint32_t this_ptr, int16_t val) {
+ LDKChannelConfig this_ptr_conv;
+ this_ptr_conv.inner = (void*)(this_ptr & (~1));
+ this_ptr_conv.is_owned = false;
+ ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
+}
+
jboolean __attribute__((visibility("default"))) TS_ChannelConfig_get_announced_channel(uint32_t this_ptr) {
LDKChannelConfig this_ptr_conv;
this_ptr_conv.inner = (void*)(this_ptr & (~1));
ChannelConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
}
-uint32_t __attribute__((visibility("default"))) TS_ChannelConfig_new(int32_t fee_proportional_millionths_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) {
- LDKChannelConfig ret_var = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+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);
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
long ret_ref = (long)ret_var.inner;
return ret_arr;
}
+int32_t __attribute__((visibility("default"))) TS_QueryChannelRange_end_blocknum(uint32_t this_arg) {
+ LDKQueryChannelRange this_arg_conv;
+ this_arg_conv.inner = (void*)(this_arg & (~1));
+ this_arg_conv.is_owned = false;
+ int32_t ret_val = QueryChannelRange_end_blocknum(&this_arg_conv);
+ return ret_val;
+}
+
uint32_t __attribute__((visibility("default"))) TS_QueryChannelRange_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
}
-void __attribute__((visibility("default"))) TS_PeerManager_timer_tick_occured(uint32_t this_arg) {
+void __attribute__((visibility("default"))) TS_PeerManager_timer_tick_occurred(uint32_t this_arg) {
LDKPeerManager this_arg_conv;
this_arg_conv.inner = (void*)(this_arg & (~1));
this_arg_conv.is_owned = false;
- PeerManager_timer_tick_occured(&this_arg_conv);
+ PeerManager_timer_tick_occurred(&this_arg_conv);
}
int8_tArray __attribute__((visibility("default"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) {
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_clone(uint32_t orig) {
+ LDKInvoiceFeatures orig_conv;
+ orig_conv.inner = (void*)(orig & (~1));
+ orig_conv.is_owned = false;
+ LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
void __attribute__((visibility("default"))) TS_InitFeatures_free(uint32_t this_obj) {
LDKInitFeatures this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
ChannelFeatures_free(this_obj_conv);
}
+void __attribute__((visibility("default"))) TS_InvoiceFeatures_free(uint32_t this_obj) {
+ LDKInvoiceFeatures this_obj_conv;
+ this_obj_conv.inner = (void*)(this_obj & (~1));
+ this_obj_conv.is_owned = (this_obj & 1) || (this_obj == 0);
+ InvoiceFeatures_free(this_obj_conv);
+}
+
uint32_t __attribute__((visibility("default"))) TS_InitFeatures_empty() {
LDKInitFeatures ret_var = InitFeatures_empty();
CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
return ret_ref;
}
+uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_empty() {
+ LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
+uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_known() {
+ LDKInvoiceFeatures ret_var = InvoiceFeatures_known();
+ CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
+ CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this.
+ long ret_ref = (long)ret_var.inner;
+ if (ret_var.is_owned) {
+ ret_ref |= 1;
+ }
+ return ret_ref;
+}
+
int8_tArray __attribute__((visibility("default"))) TS_InitFeatures_write(uint32_t obj) {
LDKInitFeatures obj_conv;
obj_conv.inner = (void*)(obj & (~1));
return ret_arr;
}
+int8_tArray __attribute__((visibility("default"))) TS_InvoiceFeatures_write(uint32_t obj) {
+ LDKInvoiceFeatures obj_conv;
+ obj_conv.inner = (void*)(obj & (~1));
+ obj_conv.is_owned = false;
+ LDKCVec_u8Z ret_var = InvoiceFeatures_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_InitFeatures_read(int8_tArray ser) {
LDKu8slice ser_ref;
ser_ref.datalen = *((uint32_t*)ser);
return (long)ret_conv;
}
+uint32_t __attribute__((visibility("default"))) TS_InvoiceFeatures_read(int8_tArray ser) {
+ LDKu8slice ser_ref;
+ ser_ref.datalen = *((uint32_t*)ser);
+ ser_ref.data = (int8_t*)(ser + 4);
+ LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
+ *ret_conv = InvoiceFeatures_read(ser_ref);
+ return (long)ret_conv;
+}
+
void __attribute__((visibility("default"))) TS_RouteHop_free(uint32_t this_obj) {
LDKRouteHop this_obj_conv;
this_obj_conv.inner = (void*)(this_obj & (~1));
return ret_ref;
}
-uint32_t __attribute__((visibility("default"))) TS_get_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) {
+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);
memcpy(our_node_id_ref.compressed_form, (uint8_t*)(our_node_id + 4), 33);
LDKPublicKey payee_ref;
CHECK(*((uint32_t*)payee) == 33);
memcpy(payee_ref.compressed_form, (uint8_t*)(payee + 4), 33);
+ LDKInvoiceFeatures payee_features_conv;
+ payee_features_conv.inner = (void*)(payee_features & (~1));
+ 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)
}
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, &first_hops_constr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
+ *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);
return (long)ret_conv;
}