2016-02-23 16:59:26 +01:00
|
|
|
#ifndef WALLET_H
|
|
|
|
#define WALLET_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2016-06-07 15:26:25 +02:00
|
|
|
namespace Bitmonero {
|
|
|
|
class Wallet; // forward declaration
|
|
|
|
}
|
2016-02-23 16:59:26 +01:00
|
|
|
class Wallet : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2016-02-24 11:25:20 +01:00
|
|
|
Q_PROPERTY(QString seed READ getSeed)
|
2016-02-23 16:59:26 +01:00
|
|
|
public:
|
2016-06-07 15:26:25 +02:00
|
|
|
enum Status {
|
|
|
|
Status_Ok = 0,
|
|
|
|
Status_Error = 1
|
|
|
|
};
|
2016-02-24 11:25:20 +01:00
|
|
|
|
2016-02-29 15:39:39 +01:00
|
|
|
//! returns mnemonic seed
|
|
|
|
Q_INVOKABLE QString getSeed() const;
|
2016-02-24 11:25:20 +01:00
|
|
|
|
2016-02-29 15:39:39 +01:00
|
|
|
//! returns seed language
|
|
|
|
Q_INVOKABLE QString getSeedLanguage() const;
|
2016-02-24 11:25:20 +01:00
|
|
|
|
2016-06-07 15:26:25 +02:00
|
|
|
//! returns last operation's status
|
|
|
|
Q_INVOKABLE int status() const;
|
|
|
|
|
|
|
|
//! returns last operation's error message
|
|
|
|
Q_INVOKABLE QString errorString() const;
|
2016-02-24 11:25:20 +01:00
|
|
|
|
2016-02-29 15:39:39 +01:00
|
|
|
//! changes the password using existing parameters (path, seed, seed lang)
|
|
|
|
Q_INVOKABLE bool setPassword(const QString &password);
|
|
|
|
|
2016-06-07 15:26:25 +02:00
|
|
|
//! returns wallet's public address
|
|
|
|
Q_INVOKABLE QString address() const;
|
|
|
|
|
|
|
|
//! saves wallet to the file by given path
|
|
|
|
Q_INVOKABLE bool store(const QString &path);
|
2016-02-29 15:39:39 +01:00
|
|
|
|
2016-02-24 11:25:20 +01:00
|
|
|
|
2016-02-29 15:39:39 +01:00
|
|
|
|
|
|
|
private:
|
2016-06-07 15:26:25 +02:00
|
|
|
Wallet(Bitmonero::Wallet *w, QObject * parent = 0);
|
|
|
|
~Wallet();
|
2016-02-29 15:39:39 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
friend class WalletManager;
|
2016-06-07 15:26:25 +02:00
|
|
|
//! libwallet's
|
|
|
|
Bitmonero::Wallet * m_walletImpl;
|
2016-02-23 16:59:26 +01:00
|
|
|
};
|
|
|
|
|
2016-02-24 11:25:20 +01:00
|
|
|
#endif // WALLET_H
|