summaryrefslogtreecommitdiff
path: root/monero_libwallet2_api_c/src/main/cpp
diff options
context:
space:
mode:
authorKonstantin Ullrich <konstantinullrich12@gmail.com>2024-10-07 12:26:48 +0200
committerKonstantin Ullrich <konstantinullrich12@gmail.com>2024-10-07 12:26:48 +0200
commit04b29d84a2c368c677cf5ec946269203622ca170 (patch)
treefd135b090bd5d93c89f71df6934a3a8d2c857563 /monero_libwallet2_api_c/src/main/cpp
parent817787df2e40677325bc3c5531bbd0bc6ec94567 (diff)
Implement monero queryWalletDevice
Diffstat (limited to 'monero_libwallet2_api_c/src/main/cpp')
-rw-r--r--monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp11
-rw-r--r--monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h4
2 files changed, 10 insertions, 5 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 13f99d5..f577f57 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
@@ -1768,10 +1768,15 @@ bool MONERO_WalletManager_verifyWalletPassword(void* wm_ptr, const char* keys_fi
Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
return wm->verifyWalletPassword(std::string(keys_file_name), std::string(password), no_spend_key, kdf_rounds);
}
+
// virtual bool queryWalletDevice(Wallet::Device& device_type, const std::string &keys_file_name, const std::string &password, uint64_t kdf_rounds = 1) const = 0;
-// bool MONERO_WalletManager_queryWalletDevice(int device_type, const char* keys_file_name, const char* password, uint64_t kdf_rounds) {
-// return Monero::WalletManagerFactory::getWalletManager()->queryWalletDevice(device_type, std::string(keys_file_name), std::string(password), kdf_rounds);
-//}
+int MONERO_WalletManager_queryWalletDevice(void* wm_ptr, const char* keys_file_name, const char* password, uint64_t kdf_rounds) {
+ Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_ptr);
+ Monero::Wallet::Device device_type;
+ wm->queryWalletDevice(device_type, std::string(keys_file_name), std::string(password), kdf_rounds);
+ return device_type;
+}
+
// virtual std::vector<std::string> findWallets(const std::string &path) = 0;
const char* MONERO_WalletManager_findWallets(void* wm_ptr, const char* path, const char* separator) {
Monero::WalletManager *wm = reinterpret_cast<Monero::WalletManager*>(wm_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 6e691c8..143da40 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
@@ -948,7 +948,7 @@ extern ADDAPI bool MONERO_WalletManager_walletExists(void* wm_ptr, const char* p
// virtual bool verifyWalletPassword(const std::string &keys_file_name, const std::string &password, bool no_spend_key, uint64_t kdf_rounds = 1) const = 0;
extern ADDAPI bool MONERO_WalletManager_verifyWalletPassword(void* wm_ptr, const char* keys_file_name, const char* password, bool no_spend_key, uint64_t kdf_rounds);
// virtual bool queryWalletDevice(Wallet::Device& device_type, const std::string &keys_file_name, const std::string &password, uint64_t kdf_rounds = 1) const = 0;
-extern ADDAPI bool MONERO_WalletManager_queryWalletDevice(int device_type, const char* keys_file_name, const char* password, uint64_t kdf_rounds);
+extern ADDAPI int MONERO_WalletManager_queryWalletDevice(void* wm_ptr, const char* keys_file_name, const char* password, uint64_t kdf_rounds);
// virtual std::vector<std::string> findWallets(const std::string &path) = 0;
extern ADDAPI const char* MONERO_WalletManager_findWallets(void* wm_ptr, const char* path, const char* separator);
// virtual std::string errorString() const = 0;
@@ -1039,4 +1039,4 @@ extern ADDAPI const char* MONERO_checksum_wallet2_api_c_exp();
#ifdef __cplusplus
}
-#endif \ No newline at end of file
+#endif