2022-01-06 19:29:19 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QJsonDocument>
|
2022-02-21 18:03:38 +00:00
|
|
|
#include <QString>
|
2022-01-06 19:29:19 +00:00
|
|
|
|
|
|
|
namespace Accounts
|
|
|
|
{
|
|
|
|
class DerivedAccountDetails
|
|
|
|
{
|
|
|
|
public:
|
2022-02-21 18:03:38 +00:00
|
|
|
QString publicKey;
|
|
|
|
QString address;
|
|
|
|
QString derivationPath;
|
2022-01-06 19:29:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class DerivedAccounts
|
|
|
|
{
|
|
|
|
public:
|
2022-02-21 18:03:38 +00:00
|
|
|
DerivedAccountDetails whisper;
|
|
|
|
DerivedAccountDetails walletRoot;
|
|
|
|
DerivedAccountDetails defaultWallet;
|
|
|
|
DerivedAccountDetails eip1581;
|
2022-01-06 19:29:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class GeneratedAccountDto
|
|
|
|
{
|
|
|
|
public:
|
2022-02-21 18:03:38 +00:00
|
|
|
QString id;
|
|
|
|
QString publicKey;
|
|
|
|
QString address;
|
|
|
|
QString keyUid;
|
|
|
|
QString mnemonic;
|
|
|
|
DerivedAccounts derivedAccounts;
|
|
|
|
|
|
|
|
// The following two are set additionally.
|
|
|
|
QString alias;
|
|
|
|
QString identicon;
|
|
|
|
|
2022-02-22 08:02:34 +00:00
|
|
|
bool isValid() const;
|
2022-01-06 19:29:19 +00:00
|
|
|
};
|
|
|
|
|
2022-02-22 08:02:34 +00:00
|
|
|
DerivedAccountDetails toDerivedAccountDetails(const QJsonValue& jsonObj, const QString& derivationPath);
|
2022-01-06 19:29:19 +00:00
|
|
|
|
2022-02-22 08:02:34 +00:00
|
|
|
DerivedAccounts toDerivedAccounts(const QJsonObject& jsonObj);
|
2022-01-06 19:29:19 +00:00
|
|
|
|
2022-02-22 08:02:34 +00:00
|
|
|
GeneratedAccountDto toGeneratedAccountDto(const QJsonValue& jsonObj);
|
2022-01-06 19:29:19 +00:00
|
|
|
} // namespace Accounts
|