3#include "data/AmendmentCenterInterface.hpp"
4#include "data/BackendInterface.hpp"
5#include "rpc/common/Types.hpp"
7#include <boost/json/array.hpp>
8#include <boost/json/conversion.hpp>
9#include <boost/json/value.hpp>
10#include <rpcspec/HandlerFor.hpp>
11#include <rpcspec/handlers/amm_info/Types.hpp>
26class AMMInfoHandler :
public rpc::spec::HandlerFor<rpc::spec::handlers::amm_info::Input> {
27 std::shared_ptr<BackendInterface> sharedPtrBackend_;
28 std::shared_ptr<data::AmendmentCenterInterface const> amendmentCenter_;
36 boost::json::value amount1;
37 boost::json::value amount2;
38 boost::json::value lpToken;
39 boost::json::array voteSlots;
40 boost::json::value auctionSlot;
41 std::uint16_t tradingFee = 0;
42 std::string ammAccount;
43 std::optional<bool> asset1Frozen;
44 std::optional<bool> asset2Frozen;
46 std::string ledgerHash;
47 uint32_t ledgerIndex{};
48 bool validated =
true;
60 std::shared_ptr<BackendInterface> sharedPtrBackend,
61 std::shared_ptr<data::AmendmentCenterInterface const>
const& amendmentCenter
63 : sharedPtrBackend_(std::move(sharedPtrBackend)), amendmentCenter_{amendmentCenter}
85 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
Result process(Input const &input, Context const &ctx) const
Process the AMMInfo command.
Definition AMMInfo.cpp:56
AMMInfoHandler(std::shared_ptr< BackendInterface > sharedPtrBackend, std::shared_ptr< data::AmendmentCenterInterface const > const &amendmentCenter)
Construct a new AMMInfoHandler object.
Definition AMMInfo.hpp:59
friend void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Output const &output)
Convert the Output to a JSON object.
Definition AMMInfo.cpp:223
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
A struct to hold the output data of the command.
Definition AMMInfo.hpp:34
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