2020-10-07 10:36:04 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2022-02-10 10:26:41 +00:00
|
|
|
// SPDX-FileCopyrightText: 2020-2022 The Monero Project
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
#ifndef FEATHER_PRICES_H
|
|
|
|
#define FEATHER_PRICES_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
2021-07-06 19:36:27 +00:00
|
|
|
#include "utils/Utils.h"
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
struct marketStruct {
|
|
|
|
QString symbol;
|
|
|
|
QString name;
|
|
|
|
QString image;
|
|
|
|
double price_usd;
|
|
|
|
double price_usd_change_pct_24h;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Prices : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit Prices(QObject *parent = nullptr);
|
|
|
|
QMap<QString, double> rates;
|
|
|
|
QMap<QString, marketStruct> markets;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void cryptoPricesReceived(const QJsonArray &data);
|
|
|
|
void fiatPricesReceived(const QJsonObject &data);
|
|
|
|
|
2021-05-25 01:07:42 +00:00
|
|
|
double convert(QString symbolFrom, QString symbolTo, double amount);
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void fiatPricesUpdated();
|
|
|
|
void cryptoPricesUpdated();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //FEATHER_PRICES_H
|