22#include "data/AmendmentCenterInterface.hpp"
23#include "data/BackendInterface.hpp"
24#include "rpc/common/Specs.hpp"
26#include <boost/json/array.hpp>
27#include <boost/json/conversion.hpp>
28#include <boost/json/value.hpp>
29#include <xrpl/protocol/AccountID.h>
30#include <xrpl/protocol/Issue.h>
45 std::shared_ptr<BackendInterface> sharedPtrBackend_;
46 std::shared_ptr<data::AmendmentCenterInterface const> amendmentCenter_;
54 boost::json::value amount1;
55 boost::json::value amount2;
56 boost::json::value lpToken;
57 boost::json::array voteSlots;
58 boost::json::value auctionSlot;
59 std::uint16_t tradingFee = 0;
60 std::string ammAccount;
61 std::optional<bool> asset1Frozen;
62 std::optional<bool> asset2Frozen;
64 std::string ledgerHash;
65 uint32_t ledgerIndex{};
66 bool validated =
true;
73 std::optional<ripple::AccountID> accountID;
74 std::optional<ripple::AccountID> ammAccount;
75 ripple::Issue issue1 = ripple::noIssue();
76 ripple::Issue issue2 = ripple::noIssue();
77 std::optional<std::string> ledgerHash;
78 std::optional<uint32_t> ledgerIndex;
90 std::shared_ptr<BackendInterface>
const& sharedPtrBackend,
91 std::shared_ptr<data::AmendmentCenterInterface const>
const& amendmentCenter
93 : sharedPtrBackend_(sharedPtrBackend), amendmentCenter_{amendmentCenter}
104 spec([[maybe_unused]] uint32_t apiVersion);
124 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
133 tag_invoke(boost::json::value_to_tag<Input>, boost::json::value
const& jv);
AMMInfoHandler returns information about AMM pools.
Definition AMMInfo.hpp:44
static RpcSpecConstRef spec(uint32_t apiVersion)
Returns the API specification for the command.
Definition AMMInfo.cpp:231
Result process(Input input, Context const &ctx) const
Process the AMMInfo command.
Definition AMMInfo.cpp:81
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:280
AMMInfoHandler(std::shared_ptr< BackendInterface > const &sharedPtrBackend, std::shared_ptr< data::AmendmentCenterInterface const > const &amendmentCenter)
Construct a new AMMInfoHandler object.
Definition AMMInfo.hpp:89
This namespace contains all the RPC logic and handlers.
Definition AMMHelpers.cpp:37
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:52
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