This commit is contained in:
stoffu
2018-03-06 01:19:45 +09:00
parent c5363da1e8
commit c8f0cf3543
22 changed files with 161 additions and 112 deletions

View File

@@ -6,6 +6,7 @@
#include <wallet/api/wallet2_api.h>
#include <QMutex>
#include <QPointer>
#include "NetworkType.h"
class Wallet;
namespace Monero {
@@ -32,30 +33,30 @@ public:
static WalletManager * instance();
// wizard: createWallet path;
Q_INVOKABLE Wallet * createWallet(const QString &path, const QString &password,
const QString &language, bool testnet = false);
const QString &language, NetworkType::Type nettype = NetworkType::MAINNET);
/*!
* \brief openWallet - opens wallet by given path
* \param path - wallet filename
* \param password - wallet password. Empty string in wallet isn't password protected
* \param testnet - determines if we running testnet
* \param nettype - type of network the wallet is running on
* \return wallet object pointer
*/
Q_INVOKABLE Wallet * openWallet(const QString &path, const QString &password, bool testnet = false);
Q_INVOKABLE Wallet * openWallet(const QString &path, const QString &password, NetworkType::Type nettype = NetworkType::MAINNET);
/*!
* \brief openWalletAsync - asynchronous version of "openWallet". Returns immediately. "walletOpened" signal
* emitted when wallet opened;
*/
Q_INVOKABLE void openWalletAsync(const QString &path, const QString &password, bool testnet = false);
Q_INVOKABLE void openWalletAsync(const QString &path, const QString &password, NetworkType::Type nettype = NetworkType::MAINNET);
// wizard: recoveryWallet path; hint: internally it recorvers wallet and set password = ""
Q_INVOKABLE Wallet * recoveryWallet(const QString &path, const QString &memo,
bool testnet = false, quint64 restoreHeight = 0);
NetworkType::Type nettype = NetworkType::MAINNET, quint64 restoreHeight = 0);
Q_INVOKABLE Wallet * createWalletFromKeys(const QString &path,
const QString &language,
bool testnet,
NetworkType::Type nettype,
const QString &address,
const QString &viewkey,
const QString &spendkey = "",
@@ -99,10 +100,10 @@ public:
Q_INVOKABLE QString maximumAllowedAmountAsSting() const;
Q_INVOKABLE bool paymentIdValid(const QString &payment_id) const;
Q_INVOKABLE bool addressValid(const QString &address, bool testnet) const;
Q_INVOKABLE bool keyValid(const QString &key, const QString &address, bool isViewKey, bool testnet) const;
Q_INVOKABLE bool addressValid(const QString &address, NetworkType::Type nettype) const;
Q_INVOKABLE bool keyValid(const QString &key, const QString &address, bool isViewKey, NetworkType::Type nettype) const;
Q_INVOKABLE QString paymentIdFromAddress(const QString &address, bool testnet) const;
Q_INVOKABLE QString paymentIdFromAddress(const QString &address, NetworkType::Type nettype) const;
Q_INVOKABLE void setDaemonAddress(const QString &address);
Q_INVOKABLE bool connected() const;