Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc::LedgerIndexHandler Class Reference

The ledger_index method fetches the latest closed ledger before the given date. More...

#include <LedgerIndex.hpp>

Classes

struct  Input
 A struct to hold the input data for the command. More...
struct  Output
 A struct to hold the output data of the command. More...

Public Types

using Result = HandlerReturnType<Output>

Public Member Functions

 LedgerIndexHandler (std::shared_ptr< BackendInterface > const &sharedPtrBackend)
 Construct a new LedgerIndexHandler object.
Result process (Input const &input, Context const &ctx) const
 Process the LedgerIndex command.

Static Public Member Functions

static RpcSpecConstRef spec (uint32_t apiVersion)
 Returns the API specification for the command.

Friends

void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, LedgerIndexHandler::Output const &output)
 Convert the Output to a JSON object.
Input tag_invoke (boost::json::value_to_tag< Input >, boost::json::value const &jv)
 Convert a JSON object to Input type.

Detailed Description

The ledger_index method fetches the latest closed ledger before the given date.

Constructor & Destructor Documentation

◆ LedgerIndexHandler()

rpc::LedgerIndexHandler::LedgerIndexHandler ( std::shared_ptr< BackendInterface > const & sharedPtrBackend)
inline

Construct a new LedgerIndexHandler object.

Parameters
sharedPtrBackendThe backend to use

Member Function Documentation

◆ process()

LedgerIndexHandler::Result rpc::LedgerIndexHandler::process ( LedgerIndexHandler::Input const & input,
Context const & ctx ) const

Process the LedgerIndex command.

Parameters
inputThe input data for the command
ctxThe context of the request
Returns
The result of the operation

◆ spec()

RpcSpecConstRef rpc::LedgerIndexHandler::spec ( uint32_t apiVersion)
inlinestatic

Returns the API specification for the command.

Parameters
apiVersionThe api version to return the spec for
Returns
The spec for the given apiVersion

◆ tag_invoke [1/2]

void tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
LedgerIndexHandler::Output const & output )
friend

Convert the Output to a JSON object.

Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke [2/2]

Input tag_invoke ( boost::json::value_to_tag< Input > ,
boost::json::value const & jv )
friend

Convert a JSON object to Input type.

Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

The documentation for this class was generated from the following files:
  • /__w/clio/clio/src/rpc/handlers/LedgerIndex.hpp
  • /__w/clio/clio/src/rpc/handlers/LedgerIndex.cpp