Files
wowlet/src/libwalletqt/TransactionHistory.h
dsc 289f9ab1d2 The balance fiat display does not 'round to ceiling' anymore, instead introduced some more decimals:
![https://i.imgur.com/aZAonV4.png](https://i.imgur.com/aZAonV4.png)

New fiat columns in the history table:

- Historical price (`balance * historical fiat price`)
- Historical rate (the historical fiat price at that date)
- Current price (`balance * current fiat price`)

![https://i.imgur.com/QkWCLRf.png](https://i.imgur.com/QkWCLRf.png)

When preferred fiat is changed (in the settings), the balance fiat display now follows accordingly.

Requires https://git.wownero.com/wowlet/wowlet-backend/pulls/19
2022-04-25 21:56:14 +02:00

69 lines
1.9 KiB
C++

// SPDX-License-Identifier: BSD-3-Clause
// Copyright (c) 2014-2021, The Monero Project.
#ifndef TRANSACTIONHISTORY_H
#define TRANSACTIONHISTORY_H
#include <functional>
#include <QObject>
#include <QList>
#include <QReadWriteLock>
#include <QDateTime>
namespace Monero {
struct TransactionHistory;
}
class TransactionInfo;
class TransactionHistory : public QObject
{
Q_OBJECT
Q_PROPERTY(int count READ count)
Q_PROPERTY(QDateTime firstDateTime READ firstDateTime NOTIFY firstDateTimeChanged)
Q_PROPERTY(QDateTime lastDateTime READ lastDateTime NOTIFY lastDateTimeChanged)
Q_PROPERTY(int minutesToUnlock READ minutesToUnlock)
Q_PROPERTY(bool locked READ locked)
public:
Q_INVOKABLE bool transaction(int index, std::function<void (TransactionInfo &)> callback);
Q_INVOKABLE TransactionInfo * transaction(const QString &id);
Q_INVOKABLE void refresh(quint32 accountIndex);
Q_INVOKABLE void setTxNote(const QString &txid, const QString &note);
Q_INVOKABLE bool writeCSV(const QString &path);
Q_INVOKABLE QJsonArray toJsonArray();
quint64 count() const;
QDateTime firstDateTime() const;
QDateTime lastDateTime() const;
quint64 minutesToUnlock() const;
bool locked() const;
public slots:
void calcFiatInfo();
signals:
void refreshStarted() const;
void refreshFinished() const;
void firstDateTimeChanged() const;
void lastDateTimeChanged() const;
void txNoteChanged() const;
private:
explicit TransactionHistory(Monero::TransactionHistory * pimpl, QObject *parent = nullptr);
private:
friend class Wallet;
mutable QReadWriteLock m_lock;
Monero::TransactionHistory * m_pimpl;
mutable QList<TransactionInfo*> m_tinfo;
mutable QDateTime m_firstDateTime;
mutable QDateTime m_lastDateTime;
mutable int m_minutesToUnlock;
// history contains locked transfers
mutable bool m_locked;
};
#endif // TRANSACTIONHISTORY_H