summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--impls/monero.dart/lib/src/checksum_zano.dart2
-rw-r--r--impls/monero.ts/checksum_zano.ts2
-rw-r--r--monero_libwallet2_api_c/CMakeLists.txt16
-rw-r--r--patches/0007-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch22
-rw-r--r--zano_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp58
-rw-r--r--zano_libwallet2_api_c/src/main/cpp/zano_checksum.h2
6 files changed, 94 insertions, 8 deletions
diff --git a/impls/monero.dart/lib/src/checksum_zano.dart b/impls/monero.dart/lib/src/checksum_zano.dart
index 0739d29..80854c3 100644
--- a/impls/monero.dart/lib/src/checksum_zano.dart
+++ b/impls/monero.dart/lib/src/checksum_zano.dart
@@ -1,4 +1,4 @@
// ignore_for_file: constant_identifier_names
const String wallet2_api_c_h_sha256 = "8acaa95513b85a984c08e05cc3f2ac7530bb8f32946eeeb45357bd846aef33dd";
-const String wallet2_api_c_cpp_sha256 = "258e315ccc5f5ffa6d3d6608e9bfd7ac4f3b91b36424ad1633ed4440bf2986bc-59ea01339d958144736b614ab7d5f5e00fdf837b";
+const String wallet2_api_c_cpp_sha256 = "94c3f49fe8a8acd9693c08712b9c38ecdb3f1bfed0a22b6c3462228ed64b82ba-2817090c8ac7639d6f697d00fc8bcba2b3681d90";
const String wallet2_api_c_exp_sha256 = "66f3ff655bbfd11ad28c318ab707090b5a93276f436b06f7b1c0f329dba3c9c2";
diff --git a/impls/monero.ts/checksum_zano.ts b/impls/monero.ts/checksum_zano.ts
index 76e0106..1a38a57 100644
--- a/impls/monero.ts/checksum_zano.ts
+++ b/impls/monero.ts/checksum_zano.ts
@@ -1,5 +1,5 @@
export const zanoChecksum = {
wallet2_api_c_h_sha256: "8acaa95513b85a984c08e05cc3f2ac7530bb8f32946eeeb45357bd846aef33dd",
- wallet2_api_c_cpp_sha256: "258e315ccc5f5ffa6d3d6608e9bfd7ac4f3b91b36424ad1633ed4440bf2986bc-59ea01339d958144736b614ab7d5f5e00fdf837b",
+ wallet2_api_c_cpp_sha256: "94c3f49fe8a8acd9693c08712b9c38ecdb3f1bfed0a22b6c3462228ed64b82ba-2817090c8ac7639d6f697d00fc8bcba2b3681d90",
wallet2_api_c_exp_sha256: "66f3ff655bbfd11ad28c318ab707090b5a93276f436b06f7b1c0f329dba3c9c2",
}
diff --git a/monero_libwallet2_api_c/CMakeLists.txt b/monero_libwallet2_api_c/CMakeLists.txt
index 05c2827..199a71b 100644
--- a/monero_libwallet2_api_c/CMakeLists.txt
+++ b/monero_libwallet2_api_c/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.4.1)
+cmake_minimum_required(VERSION 3.5)
project(wallet2_api_c)
message(STATUS ABI_INFO = ${HOST_ABI})
@@ -94,15 +94,12 @@ endif()
add_subdirectory("${CMAKE_SOURCE_DIR}/../${MONERO_FLAVOR}" ${CMAKE_BINARY_DIR}/${MONERO_FLAVOR}_build EXCLUDE_FROM_ALL)
-if(${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" OR ${HOST_ABI} STREQUAL "host-apple-darwin" OR ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-ios" OR ${HOST_ABI} STREQUAL "aarch64-apple-ios")
+if(${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin11" OR ${HOST_ABI} STREQUAL "x86_64-apple-darwin" OR ${HOST_ABI} STREQUAL "aarch64-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-darwin" OR ${HOST_ABI} STREQUAL "x86_64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "aarch64-host-apple-darwin" OR ${HOST_ABI} STREQUAL "host-apple-ios" OR ${HOST_ABI} STREQUAL "aarch64-apple-ios")
if (${MONERO_FLAVOR} STREQUAL "monero")
- set(WALLET_TARGETS wallet_api) # wallet_api_LIB_DEPENDS
set(EXPORTED_SYMBOLS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/monero_libwallet2_api_c.exp)
elseif(${MONERO_FLAVOR} STREQUAL "wownero")
- set(WALLET_TARGETS wallet_api) # wallet_api_LIB_DEPENDS
set(EXPORTED_SYMBOLS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/wownero_libwallet2_api_c.exp)
elseif(${MONERO_FLAVOR} STREQUAL "zano")
- set(WALLET_TARGETS common crypto currency_core wallet)
set(EXPORTED_SYMBOLS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/zano_libwallet2_api_c.exp)
endif()
@@ -110,6 +107,14 @@ if(${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR ${HOST_ABI} STREQUAL "aarch64
set_target_properties(${TARGET} PROPERTIES LINK_DEPENDS ${EXPORTED_SYMBOLS_FILE})
endif()
+if (${MONERO_FLAVOR} STREQUAL "monero")
+ set(WALLET_TARGETS wallet_api ${wallet_api_LIB_DEPENDS}) # wallet_api_LIB_DEPENDS
+elseif(${MONERO_FLAVOR} STREQUAL "wownero")
+ set(WALLET_TARGETS wallet_api ${wallet_api_LIB_DEPENDS}) # wallet_api_LIB_DEPENDS
+elseif(${MONERO_FLAVOR} STREQUAL "zano")
+ set(WALLET_TARGETS wallet ${wallet_LIB_DEPENDS})
+endif()
+
if(${MONERO_FLAVOR} STREQUAL "wownero")
add_subdirectory(wownero-seed EXCLUDE_FROM_ALL)
set(EXTRA_LIBS_WOWNEROSEED wownero-seed)
@@ -120,6 +125,7 @@ endif()
#foreach (_variableName ${_variableNames})
# message(STATUS "${_variableName}=${${_variableName}}")
#endforeach()
+#message(SEND_ERROR noooo)
target_link_libraries( wallet2_api_c
diff --git a/patches/0007-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch b/patches/0007-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch
new file mode 100644
index 0000000..0ac7e50
--- /dev/null
+++ b/patches/0007-downgrade-cmake-version-so-LIB_DEPENDS-shows-up.patch
@@ -0,0 +1,22 @@
+From e6201106cd09416f96c8d83270c94565583cd356 Mon Sep 17 00:00:00 2001
+From: Czarek Nakamoto <cyjan@mrcyjanek.net>
+Date: Thu, 5 Dec 2024 09:36:34 -0600
+Subject: [PATCH] downgrade cmake version so LIB_DEPENDS shows up
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6ded9711..47d24a81 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-cmake_minimum_required(VERSION 3.16)
++cmake_minimum_required(VERSION 3.5)
+
+ PROJECT(Zano)
+
+--
+2.39.5 (Apple Git-154)
+
diff --git a/zano_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp b/zano_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp
index b860bbd..95e666b 100644
--- a/zano_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp
+++ b/zano_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp
@@ -17,230 +17,288 @@ extern "C"
// typedef int64_t hwallet;
// std::string init(const std::string& address, const std::string& working_dir, int log_level);
const char* ZANO_PlainWallet_init(const char* address, const char* working_dir, int log_level) {
+ DEBUG_START()
std::string str = plain_wallet::init(std::string(address), std::string(working_dir), log_level);
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string init(const std::string& ip, const std::string& port, const std::string& working_dir, int log_level);
const char* ZANO_PlainWallet_init2(const char* ip, const char* port, const char* working_dir, int log_level) {
+ DEBUG_START()
std::string str = plain_wallet::init(std::string(ip), std::string(port), std::string(working_dir), log_level);
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string reset();
const char* ZANO_PlainWallet_reset() {
+ DEBUG_START()
std::string str = plain_wallet::reset();
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string set_log_level(int log_level);
const char* ZANO_PlainWallet_setLogLevel(int log_level) {
+ DEBUG_START()
std::string str = plain_wallet::set_log_level(log_level);
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string get_version();
const char* ZANO_PlainWallet_getVersion() {
+ DEBUG_START()
std::string str = plain_wallet::get_version();
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string get_wallet_files();
const char* ZANO_PlainWallet_getWalletFiles() {
+ DEBUG_START()
std::string str = plain_wallet::get_wallet_files();
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string get_export_private_info(const std::string& target_dir);
const char* ZANO_PlainWallet_getExportPrivateInfo(const char* target_dir) {
+ DEBUG_START()
std::string str = plain_wallet::get_export_private_info(std::string(target_dir));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string delete_wallet(const std::string& file_name);
const char* ZANO_PlainWallet_deleteWallet(const char* file_name) {
+ DEBUG_START()
std::string str = plain_wallet::delete_wallet(std::string(file_name));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string get_address_info(const std::string& addr);
const char* ZANO_PlainWallet_getAddressInfo(const char* addr) {
+ DEBUG_START()
std::string str = plain_wallet::get_address_info(std::string(addr));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string get_appconfig(const std::string& encryption_key);
const char* ZANO_PlainWallet_getAppconfig(const char* encryption_key) {
+ DEBUG_START()
std::string str = plain_wallet::get_appconfig(std::string(encryption_key));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string set_appconfig(const std::string& conf_str, const std::string& encryption_key);
const char* ZANO_PlainWallet_setAppconfig(const char* conf_str, const char* encryption_key) {
+ DEBUG_START()
std::string str = plain_wallet::set_appconfig(std::string(conf_str), std::string(encryption_key));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string generate_random_key(uint64_t lenght);
const char* ZANO_PlainWallet_generateRandomKey(uint64_t lenght) {
+ DEBUG_START()
std::string str = plain_wallet::generate_random_key(lenght);
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string get_logs_buffer();
const char* ZANO_PlainWallet_getLogsBuffer() {
+ DEBUG_START()
std::string str = plain_wallet::get_logs_buffer();
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string truncate_log();
const char* ZANO_PlainWallet_truncateLog() {
+ DEBUG_START()
std::string str = plain_wallet::truncate_log();
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string get_connectivity_status();
const char* ZANO_PlainWallet_getConnectivityStatus() {
+ DEBUG_START()
std::string str = plain_wallet::get_connectivity_status();
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string open(const std::string& path, const std::string& password);
const char* ZANO_PlainWallet_open(const char* path, const char* password) {
+ DEBUG_START()
std::string str = plain_wallet::open(std::string(path), std::string(password));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string restore(const std::string& seed, const std::string& path, const std::string& password, const std::string& seed_password);
const char* ZANO_PlainWallet_restore(const char* seed, const char* path, const char* password, const char* seed_password) {
+ DEBUG_START()
std::string str = plain_wallet::restore(std::string(seed), std::string(path), std::string(password), std::string(seed_password));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string generate(const std::string& path, const std::string& password);
const char* ZANO_PlainWallet_generate(const char* path, const char* password) {
+ DEBUG_START()
std::string str = plain_wallet::generate(std::string(path), std::string(password));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string get_opened_wallets();
const char* ZANO_PlainWallet_getOpenWallets() {
+ DEBUG_START()
std::string str = plain_wallet::get_opened_wallets();
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string get_wallet_status(hwallet h);
const char* ZANO_PlainWallet_getWalletStatus(int64_t h) {
+ DEBUG_START()
std::string str = plain_wallet::get_wallet_status(h);
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string close_wallet(hwallet h);
const char* ZANO_PlainWallet_closeWallet(int64_t h) {
+ DEBUG_START()
std::string str = plain_wallet::close_wallet(h);
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string invoke(hwallet h, const std::string& params);
const char* ZANO_PlainWallet_invoke(int64_t h, const char* params) {
+ DEBUG_START()
std::string str = plain_wallet::invoke(h, std::string(params));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// //async api
// std::string async_call(const std::string& method_name, uint64_t instance_id, const std::string& params);
const char* ZANO_PlainWallet_asyncCall(const char* method_name, uint64_t instance_id, const char* params) {
+ DEBUG_START()
std::string str = plain_wallet::async_call(std::string(method_name), instance_id, std::string(params));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string try_pull_result(uint64_t);
const char* ZANO_PlainWallet_tryPullResult(uint64_t instance_id) {
+ DEBUG_START()
std::string str = plain_wallet::try_pull_result(instance_id);
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string sync_call(const std::string& method_name, uint64_t instance_id, const std::string& params);
const char* ZANO_PlainWallet_syncCall(const char* method_name, uint64_t instance_id, const char* params) {
+ DEBUG_START()
std::string str = plain_wallet::sync_call(std::string(method_name), instance_id, std::string(params));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// //cake wallet api extension
// bool is_wallet_exist(const std::string& path);
bool ZANO_PlainWallet_isWalletExist(const char* path) {
+ DEBUG_START()
return plain_wallet::is_wallet_exist(std::string(path));
+ DEBUG_END()
}
// std::string get_wallet_info(hwallet h);
const char* ZANO_PlainWallet_getWalletInfo(int64_t h) {
+ DEBUG_START()
std::string str = plain_wallet::get_wallet_info(h);
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// std::string reset_wallet_password(hwallet h, const std::string& password);
const char* ZANO_PlainWallet_resetWalletPassword(int64_t h, const char* password) {
+ DEBUG_START()
std::string str = plain_wallet::reset_wallet_password(h, std::string(password));
const std::string::size_type size = str.size();
char *buffer = new char[size + 1]; //we need extra char for NUL
memcpy(buffer, str.c_str(), size + 1);
return buffer;
+ DEBUG_END()
}
// uint64_t get_current_tx_fee(uint64_t priority); // 0 (default), 1 (unimportant), 2 (normal), 3 (elevated), 4 (priority)
uint64_t ZANO_PlainWallet_getCurrentTxFee(uint64_t priority) {
+ DEBUG_START()
return plain_wallet::get_current_tx_fee(priority);
+ DEBUG_END()
}
// }
diff --git a/zano_libwallet2_api_c/src/main/cpp/zano_checksum.h b/zano_libwallet2_api_c/src/main/cpp/zano_checksum.h
index 4651449..81de083 100644
--- a/zano_libwallet2_api_c/src/main/cpp/zano_checksum.h
+++ b/zano_libwallet2_api_c/src/main/cpp/zano_checksum.h
@@ -1,6 +1,6 @@
#ifndef MONEROC_CHECKSUMS
#define MONEROC_CHECKSUMS
const char * ZANO_wallet2_api_c_h_sha256 = "8acaa95513b85a984c08e05cc3f2ac7530bb8f32946eeeb45357bd846aef33dd";
-const char * ZANO_wallet2_api_c_cpp_sha256 = "258e315ccc5f5ffa6d3d6608e9bfd7ac4f3b91b36424ad1633ed4440bf2986bc-59ea01339d958144736b614ab7d5f5e00fdf837b";
+const char * ZANO_wallet2_api_c_cpp_sha256 = "94c3f49fe8a8acd9693c08712b9c38ecdb3f1bfed0a22b6c3462228ed64b82ba-2817090c8ac7639d6f697d00fc8bcba2b3681d90";
const char * ZANO_wallet2_api_c_exp_sha256 = "66f3ff655bbfd11ad28c318ab707090b5a93276f436b06f7b1c0f329dba3c9c2";
#endif