22#include "data/AmendmentCenterInterface.hpp"
23#include "data/BackendInterface.hpp"
25#include "rpc/common/Checkers.hpp"
26#include "rpc/common/JsonBool.hpp"
27#include "rpc/common/Specs.hpp"
28#include "rpc/common/Types.hpp"
29#include "rpc/common/Validators.hpp"
31#include <boost/json/conversion.hpp>
32#include <boost/json/value.hpp>
33#include <xrpl/protocol/STLedgerEntry.h>
34#include <xrpl/protocol/jss.h>
51 std::shared_ptr<BackendInterface> sharedPtrBackend_;
52 std::shared_ptr<data::AmendmentCenterInterface const> amendmentCenter_;
60 std::string ledgerHash;
61 ripple::STLedgerEntry accountData;
62 bool isDisallowIncomingEnabled =
false;
63 bool isClawbackEnabled =
false;
64 bool isTokenEscrowEnabled =
false;
66 std::optional<std::vector<ripple::STLedgerEntry>> signerLists;
68 bool validated =
true;
78 std::optional<std::string> account;
79 std::optional<std::string> ident;
80 std::optional<std::string> ledgerHash;
81 std::optional<uint32_t> ledgerIndex;
94 std::shared_ptr<BackendInterface>
const& sharedPtrBackend,
95 std::shared_ptr<data::AmendmentCenterInterface const>
const& amendmentCenter
97 : sharedPtrBackend_(sharedPtrBackend), amendmentCenter_{amendmentCenter}
108 spec([[maybe_unused]] uint32_t apiVersion)
110 static auto const kRPC_SPEC_V1 =
RpcSpec{
122 return apiVersion == 1 ? kRPC_SPEC_V1 : kRPC_SPEC;
143 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
152 tag_invoke(boost::json::value_to_tag<Input>, boost::json::value
const& jv);
The account_info command retrieves information about an account, its activity, and its XRP balance.
Definition AccountInfo.hpp:50
AccountInfoHandler(std::shared_ptr< BackendInterface > const &sharedPtrBackend, std::shared_ptr< data::AmendmentCenterInterface const > const &amendmentCenter)
Construct a new AccountInfoHandler object.
Definition AccountInfo.hpp:93
friend void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Output const &output)
Convert the Output to a JSON object.
Definition AccountInfo.cpp:131
Result process(Input const &input, Context const &ctx) const
Process the AccountInfo command.
Definition AccountInfo.cpp:54
static RpcSpecConstRef spec(uint32_t apiVersion)
Returns the API specification for the command.
Definition AccountInfo.hpp:108
Check for a deprecated fields.
Definition Checkers.hpp:62
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 AccountInfo.hpp:58
Context of an RPC call.
Definition Types.hpp:118
A wrapper around bool that allows to convert from any JSON value.
Definition JsonBool.hpp:34
Result type used to return responses or error statuses to the Webserver subsystem.
Definition Types.hpp:129
Represents a Specification of an entire RPC command.
Definition Specs.hpp:98
static CustomValidator accountValidator
Provides a commonly used validator for accounts.
Definition Validators.hpp:502
static CustomValidator ledgerIndexValidator
Provides a commonly used validator for ledger index.
Definition Validators.hpp:487
static CustomValidator uint256HexStringValidator
Provides a commonly used validator for uint256 hex string.
Definition Validators.hpp:549
Validates that the type of the value is one of the given types.
Definition Validators.hpp:142