Patryk Osmaczko c0024ec6b1 refactor(@desktop/cpp): improve cpp code
Good coding practices applied only,
architecture and logic were not altered.
2022-03-01 16:05:21 +01:00

48 lines
939 B
C++

#pragma once
#include <QJsonDocument>
#include <QString>
namespace Accounts
{
class DerivedAccountDetails
{
public:
QString publicKey;
QString address;
QString derivationPath;
};
class DerivedAccounts
{
public:
DerivedAccountDetails whisper;
DerivedAccountDetails walletRoot;
DerivedAccountDetails defaultWallet;
DerivedAccountDetails eip1581;
};
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;
};
DerivedAccountDetails toDerivedAccountDetails(const QJsonValue& jsonObj, const QString& derivationPath);
DerivedAccounts toDerivedAccounts(const QJsonObject& jsonObj);
GeneratedAccountDto toGeneratedAccountDto(const QJsonValue& jsonObj);
} // namespace Accounts