3#include <xrpld/rpc/Context.h>
4#include <xrpld/rpc/Status.h>
5#include <xrpld/rpc/detail/Tuning.h>
7#include <xrpl/basics/base_uint.h>
8#include <xrpl/json/json_value.h>
9#include <xrpl/ledger/Ledger.h>
10#include <xrpl/protocol/LedgerShortcut.h>
11#include <xrpl/server/NetworkOPs.h>
13#include <org/xrpl/rpc/v1/ledger.pb.h>
131template <
class T,
class R>
151 org::xrpl::rpc::v1::LedgerSpecifier
const& specifier,
174std::expected<std::shared_ptr<Ledger const>, json::Value>
API version numbers used in later API versions.
std::expected< std::shared_ptr< Ledger const >, json::Value > getOrAcquireLedger(rpc::JsonContext const &context)
Retrieves or acquires a ledger based on the parameters provided in the given JsonContext.
Status ledgerFromRequest(T &ledger, GRPCContext< R > const &context)
Retrieves a ledger from a gRPC request context.
Status getLedger(T &ledger, uint256 const &ledgerHash, Context const &context)
Retrieves a ledger by its hash.
Status ledgerFromSpecifier(T &ledger, org::xrpl::rpc::v1::LedgerSpecifier const &specifier, Context const &context)
Retrieves a ledger based on a LedgerSpecifier.
Status lookupLedger(std::shared_ptr< ReadView const > &ledger, JsonContext const &context, json::Value &result)
Looks up a ledger from a request and fills a json::Value with ledger data.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
LedgerShortcut
Enumeration of ledger shortcuts for specifying which ledger to use.
The context of information needed to call an RPC.
Status represents the results of an operation that might fail.