diff options
Diffstat (limited to 'monero_libwallet2_api_c/src/main')
| -rw-r--r-- | monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp | 12 | ||||
| -rw-r--r-- | monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h | 2 |
2 files changed, 14 insertions, 0 deletions
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); |
