3#include "data/BackendInterface.hpp"
6#include "rpc/common/JsonBool.hpp"
7#include "rpc/common/MetaProcessors.hpp"
8#include "rpc/common/Modifiers.hpp"
9#include "rpc/common/Specs.hpp"
10#include "rpc/common/Types.hpp"
11#include "rpc/common/Validators.hpp"
13#include <boost/json/array.hpp>
14#include <boost/json/conversion.hpp>
15#include <boost/json/value.hpp>
16#include <xrpl/protocol/ErrorCodes.h>
17#include <xrpl/protocol/jss.h>
36 std::shared_ptr<BackendInterface> sharedPtrBackend_;
39 static constexpr auto kLIMIT_MIN = 1;
40 static constexpr auto kLIMIT_MAX = 500;
41 static constexpr auto kLIMIT_DEFAULT = 300;
47 std::string ledgerHash;
48 uint32_t ledgerIndex{};
49 std::vector<std::string> problems;
51 std::optional<boost::json::array> transactions;
52 bool validated =
true;
60 bool roleGateway =
false;
61 std::optional<std::string> ledgerHash;
62 std::optional<uint32_t> ledgerIndex;
63 uint32_t limit = kLIMIT_DEFAULT;
75 : sharedPtrBackend_(std::move(sharedPtrBackend))
86 spec([[maybe_unused]] uint32_t apiVersion)
88 static auto const kRPC_SPEC_V1 =
RpcSpec{
94 Status{RippledError::rpcINVALID_PARAMS,
"role field is invalid"}
104 static auto const kRPC_SPEC =
RpcSpec{
111 return apiVersion == 1 ? kRPC_SPEC_V1 : kRPC_SPEC;
132 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
141 tag_invoke(boost::json::value_to_tag<Input>, boost::json::value
const& jv);
NoRippleCheckHandler(std::shared_ptr< BackendInterface > sharedPtrBackend)
Construct a new NoRippleCheckHandler object.
Definition NoRippleCheck.hpp:74
Result process(Input const &input, Context const &ctx) const
Process the NoRippleCheck command.
Definition NoRippleCheck.cpp:40
friend void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Output const &output)
Convert the Output to a JSON object.
Definition NoRippleCheck.cpp:198
static RpcSpecConstRef spec(uint32_t apiVersion)
Returns the API specification for the command.
Definition NoRippleCheck.hpp:86
Clamp value between min and max.
Definition Modifiers.hpp:23
Validate that value is equal or greater than the specified min.
Definition Validators.hpp:205
Validates that the value is one of the values passed in.
Definition Validators.hpp:364
This namespace contains all the RPC logic and handlers.
Definition AMMHelpers.cpp:18
RpcSpec const & RpcSpecConstRef
An alias for a const reference to RpcSpec.
Definition Specs.hpp:130
std::expected< OutputType, Status > HandlerReturnType
Return type for each individual handler.
Definition Types.hpp:62
Context of an RPC call.
Definition Types.hpp:99
A wrapper around bool that allows to convert from any JSON value.
Definition JsonBool.hpp:15
A struct to hold the output data of the command.
Definition NoRippleCheck.hpp:46
Result type used to return responses or error statuses to the Webserver subsystem.
Definition Types.hpp:110
Represents a Specification of an entire RPC command.
Definition Specs.hpp:82
A status returned from any RPC handler.
Definition Errors.hpp:65
static CustomValidator accountValidator
Provides a commonly used validator for accounts.
Definition Validators.hpp:504
static CustomValidator ledgerIndexValidator
Provides a commonly used validator for ledger index.
Definition Validators.hpp:489
static CustomValidator uint256HexStringValidator
Provides a commonly used validator for uint256 hex string.
Definition Validators.hpp:551
A validator that simply requires a field to be present.
Definition Validators.hpp:28
Validates that the type of the value is one of the given types.
Definition Validators.hpp:128