aboutsummaryrefslogtreecommitdiff
path: root/src/libwalletqt/TransactionInfo.h
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-06-08 13:53:24 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-06-08 13:53:24 +0300
commit5c10be325103d668884fc5e463aaa59c726d4f8e (patch)
treef6322ffb1d5b8bcec25144360116d9daa3ac37f5 /src/libwalletqt/TransactionInfo.h
parentda1b74a707da4e21a1c749c372ab9c8b1df1e5e1 (diff)
downloadmonzero-gui-5c10be325103d668884fc5e463aaa59c726d4f8e.tar.gz
monzero-gui-5c10be325103d668884fc5e463aaa59c726d4f8e.tar.xz
monzero-gui-5c10be325103d668884fc5e463aaa59c726d4f8e.zip
Qt wrappers for libwallet API classes
Diffstat (limited to 'src/libwalletqt/TransactionInfo.h')
-rw-r--r--src/libwalletqt/TransactionInfo.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/libwalletqt/TransactionInfo.h b/src/libwalletqt/TransactionInfo.h
new file mode 100644
index 00000000..62c26e2f
--- /dev/null
+++ b/src/libwalletqt/TransactionInfo.h
@@ -0,0 +1,54 @@
+#ifndef TRANSACTIONINFO_H
+#define TRANSACTIONINFO_H
+
+#include <QObject>
+#include <wallet/wallet2_api.h>
+
+class TransactionInfo : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(Direction direction READ direction)
+ Q_PROPERTY(bool isPending READ isPending)
+ Q_PROPERTY(bool isFailed READ isFailed)
+ Q_PROPERTY(quint64 amount READ amount)
+ Q_PROPERTY(quint64 fee READ fee)
+ Q_PROPERTY(quint64 blockHeight READ blockHeight)
+ Q_PROPERTY(QString hash READ hash)
+ Q_PROPERTY(QString timestamp READ timestamp)
+ Q_PROPERTY(QString paymentId READ paymentId)
+
+public:
+ enum Direction {
+ Direction_In = Bitmonero::TransactionInfo::Direction_In,
+ Direction_Out = Bitmonero::TransactionInfo::Direction_Out
+ };
+
+// TODO: implement as separate class;
+
+// struct Transfer {
+// Transfer(uint64_t _amount, const std::string &address);
+// const uint64_t amount;
+// const std::string address;
+// };
+ Direction direction() const;
+ bool isPending() const;
+ bool isFailed() const;
+ quint64 amount() const;
+ quint64 fee() const;
+ quint64 blockHeight() const;
+ //! transaction_id
+ QString hash() const;
+ QString timestamp();
+ QString paymentId();
+
+ // TODO: implement it
+ //! only applicable for output transactions
+ // virtual const std::vector<Transfer> & transfers() const = 0;
+private:
+ explicit TransactionInfo(Bitmonero::TransactionInfo * pimpl, QObject *parent = 0);
+private:
+ friend class TransactionHistory;
+ Bitmonero::TransactionInfo * m_pimpl;
+};
+
+#endif // TRANSACTIONINFO_H