Stefan 7cf0170a8a chore(CPP): integrate tokens balance in UI POC
Integrate token count in UI
Use delete later for QML exposed items to avoid errors

Closes #6321
2022-08-05 10:40:04 +02:00

46 lines
991 B
C++

#pragma once
#include <StatusGo/Wallet/Token.h>
#include <StatusGo/Wallet/BigInt.h>
#include <QtQmlIntegration>
namespace WalletGo = Status::StatusGo::Wallet;
namespace Status::Wallet {
class WalletAsset : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("C++ only, for now")
Q_PROPERTY(QString name READ name CONSTANT)
Q_PROPERTY(QString symbol READ symbol CONSTANT)
Q_PROPERTY(QColor color READ color CONSTANT)
Q_PROPERTY(quint64 count READ count CONSTANT)
Q_PROPERTY(float value READ value CONSTANT)
public:
explicit WalletAsset(const WalletGo::TokenPtr token, StatusGo::Wallet::BigInt balance, QObject *parent = nullptr);
const QString name() const;
const QString symbol() const;
const QColor color() const;
quint64 count() const;
float value() const;
private:
const WalletGo::TokenPtr m_token;
// const GoWallet::NativeToken m_nativeToken;
StatusGo::Wallet::BigInt m_balance;
int m_count;
};
}