aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2_api.h
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-03-10 19:43:10 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-03-16 14:27:57 +0300
commit57d7ffc4d612cdc2095d1f9075eecafaf027e928 (patch)
tree2ae5fd18efa2283d7c6eb7115420f1447cc3ecca /src/wallet/wallet2_api.h
parentget_seed() included to interface (diff)
downloadmonero-57d7ffc4d612cdc2095d1f9075eecafaf027e928.tar.xz
changes in wallet2_api + implemented WalletManager::openWallet
Diffstat (limited to '')
-rw-r--r--src/wallet/wallet2_api.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index 41b64d276..b89c74e28 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -44,11 +44,26 @@ namespace Bitmonero {
struct Wallet
{
// TODO define wallet interface (decide what needed from wallet2)
+
+ enum Status {
+ Status_Ok,
+ Status_Error
+ };
+
+ struct Listener
+ {
+ // TODO
+ };
+
virtual ~Wallet() = 0;
virtual std::string seed() const = 0;
virtual std::string getSeedLanguage() const = 0;
virtual void setSeedLanguage(const std::string &arg) = 0;
-
+ virtual void setListener(Listener * listener) = 0;
+ //! returns wallet status (Status_Ok | Status_Error)
+ virtual int status() const = 0;
+ //! in case error status, returns error string
+ virtual std::string errorString() const = 0;
};
/**
@@ -58,12 +73,20 @@ struct WalletManager
{
//! creates new wallet
virtual Wallet * createWallet(const std::string &path, const std::string &password, const std::string &language) = 0;
+
//! opens existing wallet
virtual Wallet * openWallet(const std::string &path, const std::string &password) = 0;
+ //! recovers existing wallet using memo (electrum words)
+ virtual Wallet * recoveryWallet(const std::string &path, const std::string &memo, const std::string &language) = 0;
+ //! closes wallet. in case operation succeded, wallet object deleted. in case operation failed, wallet object not deleted
+ virtual bool closeWallet(Wallet *wallet) = 0;
+
+ //! checks if wallet with the given name already exists
virtual bool walletExists(const std::string &path) = 0;
- virtual int lastError() const = 0;
+ virtual std::string errorString() const = 0;
+
};