3#include "data/BackendInterface.hpp"
4#include "etl/ETLServiceInterface.hpp"
5#include "rpc/common/SpecBackend.hpp"
6#include "rpc/common/Types.hpp"
7#include "util/log/Logger.hpp"
9#include <boost/json/array.hpp>
10#include <boost/json/conversion.hpp>
11#include <boost/json/object.hpp>
12#include <boost/json/value.hpp>
13#include <rpcspec/handlers/account_tx/Types.hpp>
32 std::shared_ptr<BackendInterface> sharedPtrBackend_;
33 std::shared_ptr<etl::ETLServiceInterface const> etl_;
39 static constexpr auto kLimitMin = rpc::spec::handlers::account_tx::kLimitMin;
43 static constexpr auto kLimitMax = rpc::spec::handlers::account_tx::kLimitMax;
47 static constexpr auto kLimitDefault = rpc::spec::handlers::account_tx::kLimitDefault;
52 using Marker = rpc::spec::handlers::account_tx::Marker;
81 std::shared_ptr<BackendInterface> sharedPtrBackend,
82 std::shared_ptr<etl::ETLServiceInterface const>
const&
etl
84 : sharedPtrBackend_(std::move(sharedPtrBackend)), etl_{
etl}
106 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
123tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Marker
const& marker);
Result process(Input const &input, Context const &ctx) const
Process the AccountTx command.
Definition AccountTx.cpp:39
AccountTxHandler(std::shared_ptr< BackendInterface > sharedPtrBackend, std::shared_ptr< etl::ETLServiceInterface const > const &etl)
Construct a new AccountTxHandler object.
Definition AccountTx.hpp:80
rpc::spec::handlers::account_tx::Marker Marker
Pagination marker identifying a transaction by ledger sequence and transaction index.
Definition AccountTx.hpp:52
static constexpr auto kLimitDefault
Value of limit used when the request does not specify one.
Definition AccountTx.hpp:47
HandlerReturnType< Output > Result
The result type of the command: the Output on success or an error Status.
Definition AccountTx.hpp:72
friend void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Output const &output)
Convert the Output to a JSON object.
Definition AccountTx.cpp:244
static constexpr auto kLimitMax
Maximum accepted value for the limit request field.
Definition AccountTx.hpp:43
static constexpr auto kLimitMin
Minimum accepted value for the limit request field.
Definition AccountTx.hpp:39
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:110
This namespace contains everything to do with the ETL and ETL sources.
Definition AmendmentBlockHandlerInterface.hpp:6
JSON conversions for the account_tx spec types used by AccountTxHandler.
Definition AccountTx.cpp:267
void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Marker const &marker)
Convert the Marker to a JSON object.
Definition AccountTx.cpp:270
This namespace contains all the RPC logic and handlers.
Definition AMMHelpers.cpp:17
std::expected< OutputType, Status > HandlerReturnType
Return type for each individual handler.
Definition Types.hpp:63
spec::HandlerFor< InputT, boost::json::value > HandlerFor
The spec-driven base every typed handler inherits.
Definition SpecBackend.hpp:24
A struct to hold the output data of the command.
Definition AccountTx.hpp:57
std::string account
The account whose transactions are returned.
Definition AccountTx.hpp:58
uint32_t ledgerIndexMin
Lowest ledger sequence that was searched.
Definition AccountTx.hpp:59
std::optional< uint32_t > limit
Maximum number of transactions requested.
Definition AccountTx.hpp:61
boost::json::array transactions
Transactions affecting the account.
Definition AccountTx.hpp:64
bool validated
Whether the ledger range is validated.
Definition AccountTx.hpp:66
std::optional< Marker > marker
Pagination marker to resume from, if more results.
Definition AccountTx.hpp:62
uint32_t ledgerIndexMax
Highest ledger sequence that was searched.
Definition AccountTx.hpp:60
Context of an RPC call.
Definition Types.hpp:102
Result type used to return responses or error statuses to the Webserver subsystem.
Definition Types.hpp:132