32 #ifndef LEDGER_CORE_ERC20LIKEACCOUNT_H 33 #define LEDGER_CORE_ERC20LIKEACCOUNT_H 36 #include <api/ERC20LikeAccount.hpp> 37 #include <api/ERC20Token.hpp> 38 #include <wallet/ethereum/ERC20/ERC20LikeOperation.h> 39 #include <api/BigInt.hpp> 40 #include <api/Currency.hpp> 41 #include <api/OperationQuery.hpp> 42 #include <wallet/ethereum/EthereumLikeWallet.h> 43 #include <wallet/ethereum/EthereumLikeAccount.h> 44 #include <database/soci-number.h> 45 #include <api/BinaryCallback.hpp> 52 const std::shared_ptr<DatabaseSessionPool>& pool,
53 const std::shared_ptr<api::ExecutionContext>& context,
54 const std::shared_ptr<api::ExecutionContext>& mainContext) :
OperationQuery(headFilter, pool, context, mainContext) {
58 virtual soci::rowset<soci::row> performExecute(soci::session &sql) {
59 return _builder.select(
"o.account_uid, o.uid, o.wallet_uid, o.type, o.date, o.senders, o.recipients," 60 "o.amount, o.fees, o.currency_name, o.trust, b.hash, b.height, b.time, e.uid" 62 .from(
"operations").to(
"o")
63 .outerJoin(
"blocks AS b",
"o.block_uid = b.uid")
64 .outerJoin(
"erc20_operations AS e",
"o.uid = e.ethereum_operation_uid")
73 const std::string &accountAddress,
75 const std::shared_ptr<EthereumLikeAccount> &parentAccount);
77 std::string getAddress()
override ;
79 void getBalance(
const std::shared_ptr<api::BigIntCallback> & callback)
override ;
81 std::vector<std::shared_ptr<api::BigInt>> getBalanceHistoryFor(
82 const std::chrono::system_clock::time_point& startDate,
83 const std::chrono::system_clock::time_point& endDate,
84 api::TimePeriod period
88 static BigInt accumulateBalanceWithOperation(
93 std::vector<std::shared_ptr<api::ERC20LikeOperation>> getOperations()
override ;
96 const std::string &address);
98 void getTransferToAddressData(
const std::shared_ptr<api::BigInt> &amount,
99 const std::string &address,
100 const std::shared_ptr<api::BinaryCallback> &data)
override;
102 std::shared_ptr<api::OperationQuery> queryOperations()
override ;
103 void putOperation(soci::session &sql,
const std::shared_ptr<ERC20LikeOperation> &operation,
bool newOperation =
false);
105 std::shared_ptr<api::ExecutionContext> getContext();
108 std::string _accountAddress;
110 std::string _accountUid;
111 std::weak_ptr<EthereumLikeAccount> _account;
117 #endif //LEDGER_CORE_ERC20LIKEACCOUNT_H Definition: ERC20LikeOperation.hpp:27
Definition: OperationQuery.h:48
Definition: Deffered.hpp:49
Definition: ERC20LikeAccount.h:69
Definition: ERC20LikeAccount.hpp:30
Definition: Currency.hpp:23
Definition: Account.cpp:8
Definition: ERC20Token.hpp:15
Definition: ERC20LikeAccount.h:49