2016-02-23 17:59:26 +02:00
|
|
|
#include "Wallet.h"
|
2016-06-07 16:26:25 +03:00
|
|
|
#include "wallet/wallet2_api.h"
|
|
|
|
|
2016-02-29 16:39:39 +02:00
|
|
|
#include <QFile>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-06-07 16:26:25 +03:00
|
|
|
QString Wallet::getSeed() const
|
2016-02-29 16:39:39 +02:00
|
|
|
{
|
2016-06-07 16:26:25 +03:00
|
|
|
return QString::fromStdString(m_walletImpl->seed());
|
2016-02-29 16:39:39 +02:00
|
|
|
}
|
|
|
|
|
2016-06-07 16:26:25 +03:00
|
|
|
QString Wallet::getSeedLanguage() const
|
2016-02-29 16:39:39 +02:00
|
|
|
{
|
2016-06-07 16:26:25 +03:00
|
|
|
return QString::fromStdString(m_walletImpl->getSeedLanguage());
|
2016-02-29 16:39:39 +02:00
|
|
|
}
|
|
|
|
|
2016-06-07 16:26:25 +03:00
|
|
|
int Wallet::status() const
|
2016-02-24 12:25:20 +02:00
|
|
|
{
|
2016-06-07 16:26:25 +03:00
|
|
|
return m_walletImpl->status();
|
2016-02-24 12:25:20 +02:00
|
|
|
}
|
|
|
|
|
2016-06-07 16:26:25 +03:00
|
|
|
QString Wallet::errorString() const
|
2016-02-24 12:25:20 +02:00
|
|
|
{
|
2016-06-07 16:26:25 +03:00
|
|
|
return QString::fromStdString(m_walletImpl->errorString());
|
2016-02-24 12:25:20 +02:00
|
|
|
}
|
|
|
|
|
2016-02-29 16:39:39 +02:00
|
|
|
bool Wallet::setPassword(const QString &password)
|
2016-02-24 12:25:20 +02:00
|
|
|
{
|
2016-06-07 16:26:25 +03:00
|
|
|
return m_walletImpl->setPassword(password.toStdString());
|
2016-02-23 17:59:26 +02:00
|
|
|
}
|
2016-02-29 16:39:39 +02:00
|
|
|
|
2016-06-07 16:26:25 +03:00
|
|
|
QString Wallet::address() const
|
2016-02-29 16:39:39 +02:00
|
|
|
{
|
2016-06-07 16:26:25 +03:00
|
|
|
return QString::fromStdString(m_walletImpl->address());
|
2016-02-29 16:39:39 +02:00
|
|
|
}
|
|
|
|
|
2016-06-07 16:26:25 +03:00
|
|
|
bool Wallet::store(const QString &path)
|
2016-02-29 16:39:39 +02:00
|
|
|
{
|
2016-06-07 16:26:25 +03:00
|
|
|
return m_walletImpl->store(path.toStdString());
|
2016-02-29 16:39:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-07 16:26:25 +03:00
|
|
|
Wallet::Wallet(Bitmonero::Wallet *w, QObject *parent)
|
|
|
|
: QObject(parent), m_walletImpl(w)
|
2016-02-29 16:39:39 +02:00
|
|
|
{
|
2016-06-07 16:26:25 +03:00
|
|
|
|
2016-02-29 16:39:39 +02:00
|
|
|
}
|
|
|
|
|
2016-06-07 16:26:25 +03:00
|
|
|
Wallet::~Wallet()
|
2016-02-29 16:39:39 +02:00
|
|
|
{
|
2016-06-07 16:26:25 +03:00
|
|
|
Bitmonero::WalletManagerFactory::getWalletManager()->closeWallet(m_walletImpl);
|
2016-02-29 16:39:39 +02:00
|
|
|
}
|