22#include "data/BackendInterface.hpp"
23#include "rpc/common/Specs.hpp"
25#include <boost/json/array.hpp>
26#include <boost/json/conversion.hpp>
27#include <boost/json/value.hpp>
28#include <xrpl/protocol/AccountID.h>
29#include <xrpl/protocol/Issue.h>
44 std::shared_ptr<BackendInterface> sharedPtrBackend_;
52 boost::json::value amount1;
53 boost::json::value amount2;
54 boost::json::value lpToken;
55 boost::json::array voteSlots;
56 boost::json::value auctionSlot;
57 std::uint16_t tradingFee = 0;
58 std::string ammAccount;
59 std::optional<bool> asset1Frozen;
60 std::optional<bool> asset2Frozen;
62 std::string ledgerHash;
63 uint32_t ledgerIndex{};
64 bool validated =
true;
71 std::optional<ripple::AccountID> accountID;
72 std::optional<ripple::AccountID> ammAccount;
73 ripple::Issue issue1 = ripple::noIssue();
74 ripple::Issue issue2 = ripple::noIssue();
75 std::optional<std::string> ledgerHash;
76 std::optional<uint32_t> ledgerIndex;
86 AMMInfoHandler(std::shared_ptr<BackendInterface>
const& sharedPtrBackend) : sharedPtrBackend_(sharedPtrBackend)
97 spec([[maybe_unused]] uint32_t apiVersion);
117 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
126 tag_invoke(boost::json::value_to_tag<Input>, boost::json::value
const& jv);
AMMInfoHandler returns information about AMM pools.
Definition AMMInfo.hpp:43
static RpcSpecConstRef spec(uint32_t apiVersion)
Returns the API specification for the command.
Definition AMMInfo.cpp:230
Result process(Input input, Context const &ctx) const
Process the AMMInfo command.
Definition AMMInfo.cpp:81
AMMInfoHandler(std::shared_ptr< BackendInterface > const &sharedPtrBackend)
Construct a new AMMInfoHandler object.
Definition AMMInfo.hpp:86
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:279
This namespace contains all the RPC logic and handlers.
Definition AMMHelpers.cpp:36
RpcSpec const & RpcSpecConstRef
An alias for a const reference to RpcSpec.
Definition Specs.hpp:145
std::expected< OutputType, Status > HandlerReturnType
Return type for each individual handler.
Definition Types.hpp:81
A struct to hold the output data of the command.
Definition AMMInfo.hpp:50
Context of an RPC call.
Definition Types.hpp:118
Result type used to return responses or error statuses to the Webserver subsystem.
Definition Types.hpp:129