32 #ifndef LEDGER_CORE_ETHEREUMLIKETRANSACTIONBUILDER_H 33 #define LEDGER_CORE_ETHEREUMLIKETRANSACTIONBUILDER_H 35 #include <api/EthereumLikeTransactionBuilder.hpp> 36 #include <api/Currency.hpp> 37 #include <api/ExecutionContext.hpp> 38 #include <api/Amount.hpp> 40 #include <wallet/common/Amount.h> 41 #include <wallet/ethereum/explorers/EthereumLikeBlockchainExplorer.h> 43 #include <math/BigInt.h> 45 #include <async/Future.hpp> 46 #include <spdlog/logger.h> 54 nonce = std::make_shared<BigInt>(0);
56 std::string toAddress;
57 std::shared_ptr<BigInt> value;
58 std::shared_ptr<BigInt> nonce;
59 std::shared_ptr<BigInt> gasPrice;
60 std::shared_ptr<BigInt> gasLimit;
61 std::vector<uint8_t> inputData;
65 using EthereumLikeTransactionBuildFunction = std::function<Future<std::shared_ptr<api::EthereumLikeTransaction>> (
const EthereumLikeTransactionBuildRequest&,
const std::shared_ptr<EthereumLikeBlockchainExplorer> &)>;
72 const std::shared_ptr<EthereumLikeBlockchainExplorer> &explorer,
73 const std::shared_ptr<spdlog::logger>&
logger,
74 const EthereumLikeTransactionBuildFunction& buildFunction);
78 std::shared_ptr<api::EthereumLikeTransactionBuilder> sendToAddress(
const std::shared_ptr<api::Amount> & amount,
79 const std::string & address)
override;
81 std::shared_ptr<api::EthereumLikeTransactionBuilder> wipeToAddress(
const std::string & address)
override;
83 std::shared_ptr<api::EthereumLikeTransactionBuilder> setGasPrice(
const std::shared_ptr<api::Amount> & gasPrice)
override;
84 std::shared_ptr<api::EthereumLikeTransactionBuilder> setGasLimit(
const std::shared_ptr<api::Amount> & gasLimit)
override;
85 std::shared_ptr<api::EthereumLikeTransactionBuilder> setInputData(
const std::vector<uint8_t> & data)
override;
87 void build(
const std::shared_ptr<api::EthereumLikeTransactionCallback> & callback)
override;
90 std::shared_ptr<api::EthereumLikeTransactionBuilder> clone()
override;
92 void reset()
override;
94 static std::shared_ptr<api::EthereumLikeTransaction> parseRawTransaction(
const api::Currency & currency,
95 const std::vector<uint8_t> & rawTransaction,
99 std::shared_ptr<EthereumLikeBlockchainExplorer> _explorer;
100 EthereumLikeTransactionBuildFunction _build;
101 EthereumLikeTransactionBuildRequest _request;
102 std::shared_ptr<api::ExecutionContext> _context;
103 std::shared_ptr<spdlog::logger> _logger;
110 #endif //LEDGER_CORE_ETHEREUMLIKETRANSACTIONBUILDER_H Definition: Deffered.hpp:49
Definition: EthereumLikeTransactionBuilder.hpp:31
Definition: Currency.hpp:23
Definition: Account.cpp:8
Definition: EthereumLikeTransactionBuilder.h:51
Definition: EthereumLikeTransactionBuilder.h:67
Definition: logger.hpp:44