aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2_api.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/wallet2_api.h')
-rw-r--r--src/wallet/wallet2_api.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index 6cabcd849..563f16eaa 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -435,6 +435,7 @@ struct Wallet
static std::string genPaymentId();
static bool paymentIdValid(const std::string &paiment_id);
static bool addressValid(const std::string &str, bool testnet);
+ static bool keyValid(const std::string &secret_key_string, const std::string &address_string, bool isViewKey, bool testnet, std::string &error);
static std::string paymentIdFromAddress(const std::string &str, bool testnet);
static uint64_t maximumAllowedAmount();
@@ -614,6 +615,25 @@ struct WalletManager
*/
virtual Wallet * recoveryWallet(const std::string &path, const std::string &memo, bool testnet = false, uint64_t restoreHeight = 0) = 0;
+ /*!
+ * \brief recovers existing wallet using keys. Creates a view only wallet if spend key is omitted
+ * \param path Name of wallet file to be created
+ * \param language language
+ * \param testnet testnet
+ * \param restoreHeight restore from start height
+ * \param addressString public address
+ * \param viewKeyString view key
+ * \param spendKeyString spend key (optional)
+ * \return Wallet instance (Wallet::status() needs to be called to check if recovered successfully)
+ */
+ virtual Wallet * createWalletFromKeys(const std::string &path,
+ const std::string &language,
+ bool testnet,
+ uint64_t restoreHeight,
+ const std::string &addressString,
+ const std::string &viewKeyString,
+ const std::string &spendKeyString = "") = 0;
+
/*!
* \brief Closes wallet. In case operation succeded, wallet object deleted. in case operation failed, wallet object not deleted
* \param wallet previously opened / created wallet instance