2016-02-23 17:59:26 +02:00
|
|
|
#ifndef WALLET_H
|
|
|
|
#define WALLET_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2016-02-24 12:25:20 +02:00
|
|
|
struct WalletImpl;
|
2016-02-23 17:59:26 +02:00
|
|
|
class Wallet : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2016-02-24 12:25:20 +02:00
|
|
|
Q_PROPERTY(QString seed READ getSeed)
|
2016-02-23 17:59:26 +02:00
|
|
|
public:
|
|
|
|
explicit Wallet(QObject *parent = 0);
|
2016-02-24 12:25:20 +02:00
|
|
|
|
2016-02-29 16:39:39 +02:00
|
|
|
//! returns mnemonic seed
|
|
|
|
Q_INVOKABLE QString getSeed() const;
|
2016-02-24 12:25:20 +02:00
|
|
|
|
2016-02-29 16:39:39 +02:00
|
|
|
//! returns seed language
|
|
|
|
Q_INVOKABLE QString getSeedLanguage() const;
|
2016-02-24 12:25:20 +02:00
|
|
|
|
|
|
|
|
2016-02-29 16:39:39 +02:00
|
|
|
//! changes the password using existing parameters (path, seed, seed lang)
|
|
|
|
Q_INVOKABLE bool setPassword(const QString &password);
|
|
|
|
//! returns curret wallet password
|
|
|
|
Q_INVOKABLE QString getPassword() const;
|
|
|
|
|
|
|
|
//! renames/moves wallet files
|
|
|
|
Q_INVOKABLE bool rename(const QString &name);
|
|
|
|
|
|
|
|
//! returns current wallet name (basename, as wallet consists of several files)
|
|
|
|
Q_INVOKABLE QString getBasename() const;
|
2016-02-24 12:25:20 +02:00
|
|
|
|
2016-02-29 16:39:39 +02:00
|
|
|
Q_INVOKABLE int error() const;
|
|
|
|
Q_INVOKABLE QString errorString() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Wallet(const QString &path, const QString &password, const QString &language);
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend class WalletManager;
|
|
|
|
//! pimpl wrapper for libwallet;
|
|
|
|
WalletImpl * m_pimpl;
|
2016-02-23 17:59:26 +02:00
|
|
|
};
|
|
|
|
|
2016-02-24 12:25:20 +02:00
|
|
|
#endif // WALLET_H
|