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_;
32 static constexpr auto kLimitMin = rpc::spec::handlers::book_offers::kLimitMin;
33 static constexpr auto kLimitMax = rpc::spec::handlers::book_offers::kLimitMax;
34 static constexpr auto kLimitDefault = rpc::spec::handlers::book_offers::kLimitDefault;
40 std::string ledgerHash;
42 boost::json::array offers;
43 bool validated =
true;
55 std::shared_ptr<BackendInterface> sharedPtrBackend,
56 std::shared_ptr<data::AmendmentCenterInterface const>
const& amendmentCenter
58 : sharedPtrBackend_(std::move(sharedPtrBackend)), amendmentCenter_{amendmentCenter}
80 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
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
BookOffersHandler(std::shared_ptr< BackendInterface > sharedPtrBackend, std::shared_ptr< data::AmendmentCenterInterface const > const &amendmentCenter)
Construct a new BookOffersHandler object.
Definition BookOffers.hpp:54
Result process(Input const &input, Context const &ctx) const
Process the BookOffers command.
Definition BookOffers.cpp:23
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:61
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:39
Context of an RPC call.
Definition Types.hpp:98
Result type used to return responses or error statuses to the Webserver subsystem.
Definition Types.hpp:109