aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2_api.h
diff options
context:
space:
mode:
authorJaquee <jaquee.monero@gmail.com>2017-01-26 21:33:36 +0100
committerJaquee <jaquee.monero@gmail.com>2017-01-30 23:28:09 +0100
commit774a21394ab95bb3303bb99beb236570bafd5731 (patch)
treebf11d1355b6f726392441feb7d8eff360ae92d2e /src/wallet/wallet2_api.h
parentMerge pull request #1618 (diff)
downloadmonero-774a21394ab95bb3303bb99beb236570bafd5731.tar.xz
Wallet API: Create wallet from keys
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