From 74d93461682559a36eecb4b7b0e5728cd7f5389f Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Sun, 7 Jan 2024 14:38:45 +0100 Subject: view-only support --- libbridge/src/main/cpp/wallet2_api_c.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libbridge/src/main/cpp/wallet2_api_c.cpp') diff --git a/libbridge/src/main/cpp/wallet2_api_c.cpp b/libbridge/src/main/cpp/wallet2_api_c.cpp index 31f3bd4..95931fc 100644 --- a/libbridge/src/main/cpp/wallet2_api_c.cpp +++ b/libbridge/src/main/cpp/wallet2_api_c.cpp @@ -1428,6 +1428,28 @@ void* MONERO_WalletManager_recoveryWallet(const char* path, const char* password std::string(seedOffset)); return reinterpret_cast(wallet); } +// virtual Wallet * createWalletFromKeys(const std::string &path, +// const std::string &password, +// const std::string &language, +// NetworkType nettype, +// uint64_t restoreHeight, +// const std::string &addressString, +// const std::string &viewKeyString, +// const std::string &spendKeyString = "", +// uint64_t kdf_rounds = 1) = 0; +void* MONERO_WalletManager_createWalletFromKeys(const char* path, const char* password, const char* language, int nettype, uint64_t restoreHeight, const char* addressString, const char* viewKeyString, const char* spendKeyString, uint64_t kdf_rounds) { + Monero::Wallet *wallet = + Monero::WalletManagerFactory::getWalletManager()->createWalletFromKeys( + std::string(path), + std::string(password), + std::string(language), + static_cast(nettype), + restoreHeight, + std::string(addressString), + std::string(viewKeyString), + std::string(spendKeyString)); + return reinterpret_cast(wallet); +} void* MONERO_WalletManager_createWalletFromPolyseed(const char* path, const char* password, int nettype, const char* mnemonic, const char* passphrase, -- cgit v1.2.3