status-desktop/src-cpp/app_service/include/accounts/generated_account.h

48 lines
939 B
C
Raw Normal View History

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