summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--monero_libwallet2_api_c/CMakeLists.txt11
-rw-r--r--monero_libwallet2_api_c/monero_libwallet2_api_c.exp2
-rw-r--r--monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp12
-rw-r--r--monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h2
4 files changed, 27 insertions, 0 deletions
diff --git a/monero_libwallet2_api_c/CMakeLists.txt b/monero_libwallet2_api_c/CMakeLists.txt
index d3b9c06..d6dd7b5 100644
--- a/monero_libwallet2_api_c/CMakeLists.txt
+++ b/monero_libwallet2_api_c/CMakeLists.txt
@@ -164,6 +164,15 @@ set_target_properties(utf8proc PROPERTIES IMPORTED_LOCATION
${MONERO_DIR}/build/${HOST_ABI}/external/utf8proc/libutf8proc.a)
#############
+# bc-ur
+#############
+
+add_library(bc-ur STATIC IMPORTED)
+set_target_properties(bc-ur PROPERTIES IMPORTED_LOCATION
+ ${MONERO_DIR}/build/${HOST_ABI}/external/bc-ur/libbc-ur.a)
+
+
+#############
# Monero
#############
@@ -405,6 +414,8 @@ target_link_libraries( wallet2_api_c
${EXTRA_LIBS_WOWNEROSEED}
utf8proc
+ bc-ur
+
ssl
crypto
diff --git a/monero_libwallet2_api_c/monero_libwallet2_api_c.exp b/monero_libwallet2_api_c/monero_libwallet2_api_c.exp
index 232354c..6e47988 100644
--- a/monero_libwallet2_api_c/monero_libwallet2_api_c.exp
+++ b/monero_libwallet2_api_c/monero_libwallet2_api_c.exp
@@ -178,6 +178,7 @@ _MONERO_Wallet_errorString
_MONERO_Wallet_estimateBlockChainHeight
_MONERO_Wallet_exportKeyImages
_MONERO_Wallet_exportOutputs
+_MONERO_Wallet_exportOutputsUR
_MONERO_Wallet_filename
_MONERO_Wallet_genPaymentId
_MONERO_Wallet_getBackgroundSyncType
@@ -197,6 +198,7 @@ _MONERO_Wallet_hasUnknownKeyImages
_MONERO_Wallet_history
_MONERO_Wallet_importKeyImages
_MONERO_Wallet_importOutputs
+_MONERO_Wallet_importOutputsUR
_MONERO_Wallet_init
_MONERO_Wallet_init3
_MONERO_Wallet_integratedAddress
diff --git a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp
index 1445c0c..3049a1a 100644
--- a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp
+++ b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp
@@ -1358,10 +1358,22 @@ bool MONERO_Wallet_exportOutputs(void* wallet_ptr, const char* filename, bool al
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
return wallet->exportOutputs(std::string(filename), all);
}
+const char* MONERO_Wallet_exportOutputsUR(void* wallet_ptr, size_t max_fragment_length, bool all) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ std::string str = wallet->exportOutputsUR(max_fragment_length, all);
+ 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;
+}
bool MONERO_Wallet_importOutputs(void* wallet_ptr, const char* filename) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
return wallet->importOutputs(std::string(filename));
}
+bool MONERO_Wallet_importOutputsUR(void* wallet_ptr, const char* input) {
+ Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
+ return wallet->importOutputsUR(std::string(input));
+}
// virtual bool setupBackgroundSync(const BackgroundSyncType background_sync_type, const std::string &wallet_password, const optional<std::string> &background_cache_password) = 0;
bool MONERO_Wallet_setupBackgroundSync(void* wallet_ptr, int background_sync_type, const char* wallet_password, const char* background_cache_password) {
Monero::Wallet *wallet = reinterpret_cast<Monero::Wallet*>(wallet_ptr);
diff --git a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h
index e768764..d272137 100644
--- a/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h
+++ b/monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h
@@ -730,8 +730,10 @@ extern ADDAPI bool MONERO_Wallet_exportKeyImages(void* wallet_ptr, const char* f
extern ADDAPI bool MONERO_Wallet_importKeyImages(void* wallet_ptr, const char* filename);
// virtual bool exportOutputs(const std::string &filename, bool all = false) = 0;
extern ADDAPI bool MONERO_Wallet_exportOutputs(void* wallet_ptr, const char* filename, bool all);
+extern ADDAPI const char* MONERO_Wallet_exportOutputsUR(void* wallet_ptr, size_t max_fragment_length, bool all);
// virtual bool importOutputs(const std::string &filename) = 0;
extern ADDAPI bool MONERO_Wallet_importOutputs(void* wallet_ptr, const char* filename);
+extern ADDAPI bool MONERO_Wallet_importOutputsUR(void* wallet_ptr, const char* input);
// virtual bool scanTransactions(const std::vector<std::string> &txids) = 0;
// virtual bool setupBackgroundSync(const BackgroundSyncType background_sync_type, const std::string &wallet_password, const optional<std::string> &background_cache_password) = 0;
extern ADDAPI bool MONERO_Wallet_setupBackgroundSync(void* wallet_ptr, int background_sync_type, const char* wallet_password, const char* background_cache_password);