3#include "data/AmendmentCenterInterface.hpp"
4#include "data/BackendInterface.hpp"
5#include "rpc/common/SpecBackend.hpp"
6#include "rpc/common/Types.hpp"
8#include <boost/json/array.hpp>
9#include <boost/json/conversion.hpp>
10#include <boost/json/object.hpp>
11#include <boost/json/value.hpp>
12#include <rpcspec/handlers/book_offers/Types.hpp>
28 std::shared_ptr<BackendInterface> sharedPtrBackend_;
29 std::shared_ptr<data::AmendmentCenterInterface const> amendmentCenter_;
35 static constexpr auto kLimitMin = rpc::spec::handlers::book_offers::kLimitMin;
39 static constexpr auto kLimitMax = rpc::spec::handlers::book_offers::kLimitMax;
43 static constexpr auto kLimitDefault = rpc::spec::handlers::book_offers::kLimitDefault;
67 std::shared_ptr<BackendInterface> sharedPtrBackend,
68 std::shared_ptr<data::AmendmentCenterInterface const>
const& amendmentCenter
70 : sharedPtrBackend_(std::move(sharedPtrBackend)), amendmentCenter_{amendmentCenter}
92 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
static constexpr auto kLimitMin
Minimum allowed value of the limit parameter.
Definition BookOffers.hpp:35
friend void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Output const &output)
Convert the Output to a JSON object.
Definition BookOffers.cpp:68
HandlerReturnType< Output > Result
The result type of the command: either the Output or an error status.
Definition BookOffers.hpp:58
BookOffersHandler(std::shared_ptr< BackendInterface > sharedPtrBackend, std::shared_ptr< data::AmendmentCenterInterface const > const &amendmentCenter)
Construct a new BookOffersHandler object.
Definition BookOffers.hpp:66
Result process(Input const &input, Context const &ctx) const
Process the BookOffers command.
Definition BookOffers.cpp:23
static constexpr auto kLimitDefault
Default value of the limit parameter.
Definition BookOffers.hpp:43
static constexpr auto kLimitMax
Maximum allowed value of the limit parameter.
Definition BookOffers.hpp:39
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 BookOffers.hpp:48
boost::json::array offers
Offers in the order book, as JSON objects.
Definition BookOffers.hpp:51
bool validated
Whether the ledger is validated.
Definition BookOffers.hpp:52
uint32_t ledgerIndex
Sequence of the ledger the offers were read from.
Definition BookOffers.hpp:50
std::string ledgerHash
Hash of the ledger the offers were read from.
Definition BookOffers.hpp:49
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