Electroneum
transaction_info.h
Go to the documentation of this file.
1 // Copyrights(c) 2017-2019, The Electroneum Project
2 // Copyrights(c) 2014-2017, The Monero Project
3 //
4 // All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without modification, are
7 // permitted provided that the following conditions are met:
8 //
9 // 1. Redistributions of source code must retain the above copyright notice, this list of
10 // conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
13 // of conditions and the following disclaimer in the documentation and/or other
14 // materials provided with the distribution.
15 //
16 // 3. Neither the name of the copyright holder nor the names of its contributors may be
17 // used to endorse or promote products derived from this software without specific
18 // prior written permission.
19 //
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
21 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
28 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
31 
32 #include "wallet/wallet2_api.h"
33 #include <string>
34 #include <ctime>
35 
36 namespace Electroneum {
37 
38 class TransactionHistoryImpl;
39 
41 {
42 public:
46  virtual int direction() const;
48  virtual bool isPending() const;
49  virtual bool isFailed() const;
50  virtual uint64_t amount() const;
52  virtual uint64_t fee() const;
53  virtual uint64_t blockHeight() const;
54 
55  virtual std::string hash() const;
56  virtual std::time_t timestamp() const;
57  virtual std::string paymentId() const;
58  virtual const std::vector<Transfer> &transfers() const;
59  virtual uint64_t confirmations() const;
60  virtual uint64_t unlockTime() const;
61 
62 private:
64  bool m_pending;
65  bool m_failed;
66  uint64_t m_amount;
67  uint64_t m_fee;
68  uint64_t m_blockheight;
69  std::string m_hash;
70  std::time_t m_timestamp;
71  std::string m_paymentid;
72  std::vector<Transfer> m_transfers;
73  uint64_t m_confirmations;
74  uint64_t m_unlock_time;
75 
76  friend class TransactionHistoryImpl;
77 
78 };
79 
80 } // namespace
81 
82 namespace Bitelectroneum = Electroneum;
uint64_t m_fee
Definition: transaction_info.h:67
virtual bool isPending() const
true if hold
Definition: transaction_info.cpp:70
virtual uint64_t amount() const
Definition: transaction_info.cpp:80
uint64_t m_unlock_time
Definition: transaction_info.h:74
std::vector< Transfer > m_transfers
Definition: transaction_info.h:72
virtual std::time_t timestamp() const
Definition: transaction_info.cpp:100
~TransactionInfoImpl()
Definition: transaction_info.cpp:59
int m_direction
Definition: transaction_info.h:63
virtual uint64_t confirmations() const
Definition: transaction_info.cpp:115
uint64_t m_blockheight
Definition: transaction_info.h:68
virtual int direction() const
in/out
Definition: transaction_info.cpp:64
virtual uint64_t blockHeight() const
Definition: transaction_info.cpp:90
virtual const std::vector< Transfer > & transfers() const
only applicable for output transactions
Definition: transaction_info.cpp:110
std::string m_paymentid
Definition: transaction_info.h:71
bool m_pending
Definition: transaction_info.h:64
virtual bool isFailed() const
Definition: transaction_info.cpp:75
virtual uint64_t fee() const
always 0 for incoming txes
Definition: transaction_info.cpp:85
Definition: address_book.cpp:41
virtual std::string paymentId() const
Definition: transaction_info.cpp:105
bool m_failed
Definition: transaction_info.h:65
virtual std::string hash() const
transaction_id
Definition: transaction_info.cpp:95
uint64_t m_amount
Definition: transaction_info.h:66
Definition: transaction_info.h:40
TransactionInfoImpl()
Definition: transaction_info.cpp:45
Definition: transaction_history.h:39
virtual uint64_t unlockTime() const
Definition: transaction_info.cpp:120
uint64_t m_confirmations
Definition: transaction_info.h:73
The TransactionInfo - interface for displaying transaction information.
Definition: wallet2_api.h:139
std::time_t m_timestamp
Definition: transaction_info.h:70
std::string m_hash
Definition: transaction_info.h:69