2022-02-22 08:02:34 +00:00
|
|
|
#pragma once
|
2022-02-14 14:38:41 +00:00
|
|
|
|
2022-02-21 18:03:38 +00:00
|
|
|
#include <QString>
|
2022-02-21 17:07:16 +00:00
|
|
|
#include <QMap>
|
|
|
|
#include <QObject>
|
2022-02-14 14:38:41 +00:00
|
|
|
|
2022-02-21 17:07:16 +00:00
|
|
|
#include "service_interface.h"
|
2022-02-22 08:02:34 +00:00
|
|
|
#include "wallet_account.h"
|
2022-02-14 14:38:41 +00:00
|
|
|
|
|
|
|
namespace Wallets
|
|
|
|
{
|
|
|
|
|
2022-02-22 08:02:34 +00:00
|
|
|
class Service : public QObject, public ServiceInterface
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
void fetchAccounts();
|
2022-02-21 17:07:16 +00:00
|
|
|
void refreshAccounts();
|
2022-02-14 14:38:41 +00:00
|
|
|
|
|
|
|
QMap<QString, WalletAccountDto> m_walletAccounts;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void init() override;
|
2022-02-21 17:07:16 +00:00
|
|
|
|
2022-02-14 14:38:41 +00:00
|
|
|
QList<WalletAccountDto> getWalletAccounts() override;
|
2022-02-21 17:07:16 +00:00
|
|
|
QString generateNewAccount(const QString& password, const QString& accountName, const QString& color) override;
|
|
|
|
QString addAccountsFromPrivateKey(const QString& privateKey, const QString& password, const QString& accountName, const QString& color) override;
|
|
|
|
QString addAccountsFromSeed(const QString& seedPhrase, const QString& password, const QString& accountName, const QString& color) override;
|
|
|
|
QString addWatchOnlyAccount(const QString& address, const QString& accountName , const QString& color) override;
|
|
|
|
void deleteAccount(const QString& address) override;
|
|
|
|
|
2022-02-14 14:38:41 +00:00
|
|
|
};
|
|
|
|
} // namespace Wallets
|