2022-01-06 15:29:19 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QJsonDocument>
|
2022-02-21 19:03:38 +01:00
|
|
|
#include <QString>
|
2022-01-06 15:29:19 -04:00
|
|
|
|
|
|
|
namespace Accounts
|
|
|
|
{
|
|
|
|
class DerivedAccountDetails
|
|
|
|
{
|
|
|
|
public:
|
2022-02-21 19:03:38 +01:00
|
|
|
QString publicKey;
|
|
|
|
QString address;
|
|
|
|
QString derivationPath;
|
2022-01-06 15:29:19 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class DerivedAccounts
|
|
|
|
{
|
|
|
|
public:
|
2022-02-21 19:03:38 +01:00
|
|
|
DerivedAccountDetails whisper;
|
|
|
|
DerivedAccountDetails walletRoot;
|
|
|
|
DerivedAccountDetails defaultWallet;
|
|
|
|
DerivedAccountDetails eip1581;
|
2022-01-06 15:29:19 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
class GeneratedAccountDto
|
|
|
|
{
|
|
|
|
public:
|
2022-02-21 19:03:38 +01: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 09:02:34 +01:00
|
|
|
bool isValid() const;
|
2022-01-06 15:29:19 -04:00
|
|
|
};
|
|
|
|
|
2022-02-22 09:02:34 +01:00
|
|
|
DerivedAccountDetails toDerivedAccountDetails(const QJsonValue& jsonObj, const QString& derivationPath);
|
2022-01-06 15:29:19 -04:00
|
|
|
|
2022-02-22 09:02:34 +01:00
|
|
|
DerivedAccounts toDerivedAccounts(const QJsonObject& jsonObj);
|
2022-01-06 15:29:19 -04:00
|
|
|
|
2022-02-22 09:02:34 +01:00
|
|
|
GeneratedAccountDto toGeneratedAccountDto(const QJsonValue& jsonObj);
|
2022-01-06 15:29:19 -04:00
|
|
|
} // namespace Accounts
|