#ifndef WALLETMANAGER_H
#define WALLETMANAGER_H
-#include <QVariant>
-#include <QObject>
-#include <QUrl>
#include <wallet/api/wallet2_api.h>
+
+#include <QObject>
#include <QMutex>
#include <QPointer>
-#include <QWaitCondition>
+
#include "utils/scheduler.h"
#include "utils/networktype.h"
#include "PassphraseHelper.h"
Q_OBJECT
public:
- enum LogLevel {
- LogLevel_Silent = Monero::WalletManagerFactory::LogLevel_Silent,
- LogLevel_0 = Monero::WalletManagerFactory::LogLevel_0,
- LogLevel_1 = Monero::WalletManagerFactory::LogLevel_1,
- LogLevel_2 = Monero::WalletManagerFactory::LogLevel_2,
- LogLevel_3 = Monero::WalletManagerFactory::LogLevel_3,
- LogLevel_4 = Monero::WalletManagerFactory::LogLevel_4,
- LogLevel_Min = Monero::WalletManagerFactory::LogLevel_Min,
- LogLevel_Max = Monero::WalletManagerFactory::LogLevel_Max,
- };
-
- static WalletManager * instance();
- // wizard: createWallet path;
- Wallet * createWallet(const QString &path, const QString &password,
- const QString &language, NetworkType::Type nettype = NetworkType::MAINNET, quint64 kdfRounds = 1);
+ static WalletManager *instance();
+
+ Wallet * createWallet(const QString &path, const QString &password, const QString &language, NetworkType::Type nettype = NetworkType::MAINNET, quint64 kdfRounds = 1);
/*!
* \brief openWallet - opens wallet by given path
*/
void openWalletAsync(const QString &path, const QString &password, NetworkType::Type nettype = NetworkType::MAINNET, quint64 kdfRounds = 1);
- // wizard: recoveryWallet path; hint: internally it recorvers wallet and set password = ""
Wallet * recoveryWallet(const QString &path, const QString &password, const QString &seed, const QString &seed_offset,
- NetworkType::Type nettype = NetworkType::MAINNET, quint64 restoreHeight = 0, quint64 kdfRounds = 1);
+ NetworkType::Type nettype = NetworkType::MAINNET, quint64 restoreHeight = 0, quint64 kdfRounds = 1);
Wallet * createWalletFromKeys(const QString &path,
- const QString &password,
- const QString &language,
- NetworkType::Type nettype,
- const QString &address,
- const QString &viewkey,
- const QString &spendkey = "",
- quint64 restoreHeight = 0,
- quint64 kdfRounds = 1);
+ const QString &password,
+ const QString &language,
+ NetworkType::Type nettype,
+ const QString &address,
+ const QString &viewkey,
+ const QString &spendkey = "",
+ quint64 restoreHeight = 0,
+ quint64 kdfRounds = 1);
Wallet * createDeterministicWalletFromSpendKey(const QString &path,
- const QString &password,
- const QString &language,
- NetworkType::Type nettype,
- const QString &spendkey,
- quint64 restoreHeight,
- quint64 kdfRounds,
- const QString &offset_passphrase = "");
+ const QString &password,
+ const QString &language,
+ NetworkType::Type nettype,
+ const QString &spendkey,
+ quint64 restoreHeight,
+ quint64 kdfRounds,
+ const QString &offset_passphrase = "");
Wallet * createWalletFromDevice(const QString &path,
- const QString &password,
- NetworkType::Type nettype,
- const QString &deviceName,
- quint64 restoreHeight = 0,
- const QString &subaddressLookahead = "");
+ const QString &password,
+ NetworkType::Type nettype,
+ const QString &deviceName,
+ quint64 restoreHeight = 0,
+ const QString &subaddressLookahead = "");
void createWalletFromDeviceAsync(const QString &path,
- const QString &password,
- NetworkType::Type nettype,
- const QString &deviceName,
- quint64 restoreHeight = 0,
- const QString &subaddressLookahead = "");
-
+ const QString &password,
+ NetworkType::Type nettype,
+ const QString &deviceName,
+ quint64 restoreHeight = 0,
+ const QString &subaddressLookahead = "");
//! checks is given filename is a wallet;
bool walletExists(const QString &path) const;
//! returns list with wallet's filenames, if found by given path
QStringList findWallets(const QString &path);
- //! since we can't call static method from QML, move it to this class
static QString displayAmount(quint64 amount, bool trailing_zeroes = true, int decimals = 12);
static quint64 amountFromString(const QString &amount);
static quint64 amountFromDouble(double amount);
virtual void onWalletPassphraseNeeded(bool on_device) override;
signals:
- void walletOpened(Wallet * wallet);
- void walletCreated(Wallet * wallet);
+ void walletOpened(Wallet *wallet);
+ void walletCreated(Wallet *wallet);
void walletPassphraseNeeded(bool onDevice);
void deviceButtonRequest(quint64 buttonCode);
void deviceButtonPressed();