rippled
Loading...
Searching...
No Matches
RPCLedgerHelpers.h
1#ifndef XRPL_RPC_RPCLEDGERHELPERS_H_INCLUDED
2#define XRPL_RPC_RPCLEDGERHELPERS_H_INCLUDED
3
4#include <xrpld/app/misc/NetworkOPs.h>
5#include <xrpld/app/misc/TxQ.h>
6#include <xrpld/rpc/Context.h>
7#include <xrpld/rpc/Status.h>
8#include <xrpld/rpc/detail/Tuning.h>
9
10#include <xrpl/proto/org/xrpl/rpc/v1/xrp_ledger.pb.h>
11
12#include <optional>
13
14namespace xrpl {
15
16class ReadView;
17class Transaction;
18
19namespace RPC {
20
21struct JsonContext;
22
24
38template <class T>
39Status
40getLedger(T& ledger, uint256 const& ledgerHash, Context const& context);
41
56template <class T>
57Status
58getLedger(T& ledger, uint32_t ledgerIndex, Context const& context);
59
74template <class T>
75Status
76getLedger(T& ledger, LedgerShortcut shortcut, Context const& context);
77
95
111Status
114 JsonContext const&,
115 Json::Value& result);
116
131template <class T, class R>
132Status
133ledgerFromRequest(T& ledger, GRPCContext<R> const& context);
134
147template <class T>
148Status
150 T& ledger,
151 org::xrpl::rpc::v1::LedgerSpecifier const& specifier,
152 Context const& context);
153
176
177} // namespace RPC
178
179} // namespace xrpl
180
181#endif
Represents a JSON value.
Definition json_value.h:131
Status ledgerFromSpecifier(T &ledger, org::xrpl::rpc::v1::LedgerSpecifier const &specifier, Context const &context)
Retrieves a ledger based on a LedgerSpecifier.
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 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.
Status getLedger(T &ledger, uint256 const &ledgerHash, Context const &context)
Retrieves a ledger by its hash.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6