mirror of
https://git.wownero.com/wowlet/wowlet.git
synced 2024-08-15 01:03:14 +00:00
133700160a
Co-Authored-By: tobtoht <thotbot@protonmail.com>
42 lines
912 B
C++
42 lines
912 B
C++
// SPDX-License-Identifier: BSD-3-Clause
|
|
// Copyright (c) 2020, The Monero Project.
|
|
|
|
#ifndef FEATHER_PRICES_H
|
|
#define FEATHER_PRICES_H
|
|
|
|
#include <QObject>
|
|
#include <QProcess>
|
|
#include <QNetworkAccessManager>
|
|
|
|
#include "utils/utils.h"
|
|
|
|
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;
|
|
QMap<QString, QString> fiat; // symbol:sign
|
|
|
|
public slots:
|
|
void cryptoPricesReceived(const QJsonArray &data);
|
|
void fiatPricesReceived(const QJsonObject &data);
|
|
|
|
double convert(const QString &symbolFrom, const QString &symbolTo, double amount);
|
|
|
|
signals:
|
|
void fiatPricesUpdated();
|
|
void cryptoPricesUpdated();
|
|
};
|
|
|
|
#endif //FEATHER_PRICES_H
|