wowlet/src/utils/txfiathistory.h

34 lines
825 B
C
Raw Permalink Normal View History

2020-12-26 19:56:06 +00:00
// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2020-2021, The Monero Project.
2021-03-30 09:52:29 +00:00
#ifndef WOWLET_TXFIATHISTORY_H
#define WOWLET_TXFIATHISTORY_H
class TxFiatHistory : public QObject {
Q_OBJECT
public:
2020-12-24 13:34:37 +00:00
explicit TxFiatHistory(int genesis_timestamp, const QString &configDirectory, QObject *parent = nullptr);
double get(const QString &date);
2020-12-24 13:34:37 +00:00
double get(int timestamp);
public slots:
void onUpdateDatabase();
void onWSData(const QJsonObject &data);
signals:
2020-12-24 13:34:37 +00:00
void requestYear(int year);
void requestYearMonth(int year, int month);
private:
void loadDatabase();
void writeDatabase();
QString m_databasePath;
QString m_configDirectory;
bool m_initialized = false;
QMap<QString, double> m_database;
2020-12-24 13:34:37 +00:00
int m_genesis_timestamp;
};
2021-03-30 09:52:29 +00:00
#endif //WOWLET_TXFIATHISTORY_H