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/beast/core/SemanticVersion.h>
11#include <xrpl/proto/org/xrpl/rpc/v1/xrp_ledger.pb.h>
12#include <xrpl/protocol/ApiVersion.h>
13#include <xrpl/protocol/SecretKey.h>
14
15#include <optional>
16#include <variant>
17
18namespace Json {
19class Value;
20}
21
22namespace ripple {
23
24class ReadView;
25class Transaction;
26
27namespace RPC {
28
29struct JsonContext;
30
35template <class T>
37getLedger(T& ledger, uint256 const& ledgerHash, Context& context);
38
43template <class T>
45getLedger(T& ledger, uint32_t ledgerIndex, Context& context);
46
52template <class T>
53Status
54getLedger(T& ledger, LedgerShortcut shortcut, Context& context);
55
64
70Status
73 JsonContext&,
74 Json::Value& result);
75
76template <class T, class R>
77Status
78ledgerFromRequest(T& ledger, GRPCContext<R>& context);
79
80template <class T>
81Status
83 T& ledger,
84 org::xrpl::rpc::v1::LedgerSpecifier const& specifier,
85 Context& context);
86
91
92} // namespace RPC
93
94} // namespace ripple
95
96#endif
Represents a JSON value.
Definition json_value.h:131
JSON (JavaScript Object Notation).
Definition json_errors.h:6
Status
Return codes from Backend operations.
Status ledgerFromRequest(T &ledger, GRPCContext< R > &context)
std::variant< std::shared_ptr< Ledger const >, Json::Value > getLedgerByContext(RPC::JsonContext &context)
Return a ledger based on ledger_hash or ledger_index, or an RPC error.
Status getLedger(T &ledger, uint256 const &ledgerHash, Context &context)
Get ledger by hash If there is no error in the return value, the ledger pointer will have been filled...
Status lookupLedger(std::shared_ptr< ReadView const > &ledger, JsonContext &context, Json::Value &result)
Look up a ledger from a request and fill a Json::Result with the data representing a ledger.
Status ledgerFromSpecifier(T &ledger, org::xrpl::rpc::v1::LedgerSpecifier const &specifier, Context &context)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
base_uint< 256 > uint256
Definition base_uint.h:539