TARAXA
account.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 
6 #include "AccountObject.h"
9 
10 namespace graphql::taraxa {
11 
12 class Account {
13  public:
14  explicit Account(std::shared_ptr<::taraxa::final_chain::FinalChain> final_chain, dev::Address address,
15  ::taraxa::EthBlockNumber blk_n);
16  explicit Account(std::shared_ptr<::taraxa::final_chain::FinalChain> final_chain, dev::Address address);
17 
18  response::Value getAddress() const noexcept;
19  response::Value getBalance() const noexcept;
20  response::Value getTransactionCount() const noexcept;
21  response::Value getCode() const noexcept;
22  response::Value getStorage(response::Value&& slotArg) const;
23 
24  private:
26  std::optional<::taraxa::state_api::Account> account_;
27  std::shared_ptr<::taraxa::final_chain::FinalChain> final_chain_;
28 };
29 } // namespace graphql::taraxa
Definition: FixedHash.h:35
Definition: account.hpp:12
response::Value getBalance() const noexcept
Definition: account.cpp:22
response::Value getStorage(response::Value &&slotArg) const
Definition: account.cpp:40
response::Value getAddress() const noexcept
Definition: account.cpp:20
std::shared_ptr<::taraxa::final_chain::FinalChain > final_chain_
Definition: account.hpp:27
response::Value getCode() const noexcept
Definition: account.cpp:36
Account(std::shared_ptr<::taraxa::final_chain::FinalChain > final_chain, dev::Address address, ::taraxa::EthBlockNumber blk_n)
Definition: account.cpp:9
response::Value getTransactionCount() const noexcept
Definition: account.cpp:29
std::optional<::taraxa::state_api::Account > account_
Definition: account.hpp:26
const dev::Address kAddress
Definition: account.hpp:25
Definition: account.hpp:10
uint64_t EthBlockNumber
Definition: types.hpp:23