xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
rpc
detail
RPCLedgerHelpers.h
1
#pragma once
2
3
#include <xrpld/rpc/Context.h>
4
#include <xrpld/rpc/Status.h>
5
#include <xrpld/rpc/detail/Tuning.h>
6
7
#include <xrpl/basics/base_uint.h>
8
#include <xrpl/json/json_value.h>
9
#include <xrpl/ledger/Ledger.h>
10
#include <xrpl/server/NetworkOPs.h>
11
12
#include <org/xrpl/rpc/v1/ledger.pb.h>
13
#include <rpcspec/Ledger.hpp>
14
15
#include <
cstdint
>
16
#include <expected>
17
#include <
memory
>
18
19
namespace
xrpl
{
20
21
class
ReadView
;
22
class
Transaction
;
23
24
namespace
rpc
{
25
26
struct
JsonContext
;
27
41
template
<
class
T>
42
Status
43
getLedger
(T& ledger,
UInt256
const
& ledgerHash,
Context
const
& context);
44
59
template
<
class
T>
60
Status
61
getLedger
(T& ledger, uint32_t ledgerIndex,
Context
const
& context);
62
77
template
<
class
T>
78
Status
79
getLedger
(T& ledger, ::rpc::spec::LedgerShortcut shortcut,
Context
const
& context);
80
92
template
<
class
T>
93
Status
94
getLedger
(T& ledger, ::rpc::spec::LedgerSpecifier
const
& specifier,
Context
const
& context);
95
111
json::Value
112
lookupLedger
(std::shared_ptr<ReadView const>&,
JsonContext
const
&);
113
129
Status
130
lookupLedger
(std::shared_ptr<ReadView const>&,
JsonContext
const
&, json::Value& result);
131
146
template
<
class
T,
class
R>
147
Status
148
ledgerFromRequest
(T& ledger,
GRPCContext<R>
const
& context);
149
162
template
<
class
T>
163
Status
164
ledgerFromSpecifier
(
165
T& ledger,
166
org::xrpl::rpc::v1::LedgerSpecifier
const
& specifier,
167
Context
const
& context);
168
189
std::expected<std::shared_ptr<Ledger const>, json::Value>
190
getOrAcquireLedger
(rpc::JsonContext
const
& context);
191
192
}
// namespace rpc
193
194
}
// namespace xrpl
xrpl::ReadView
A view into a ledger.
Definition
ReadView.h:41
xrpl::Transaction
Definition
Transaction.h:55
cstdint
memory
xrpl::rpc
API version numbers used in later API versions.
Definition
ApiVersion.h:36
xrpl::rpc::getOrAcquireLedger
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.
Definition
RPCLedgerHelpers.cpp:425
xrpl::rpc::getLedger
Status getLedger(T &ledger, UInt256 const &ledgerHash, Context const &context)
Retrieves a ledger by its hash.
Definition
RPCLedgerHelpers.cpp:239
xrpl::rpc::ledgerFromRequest
Status ledgerFromRequest(T &ledger, GRPCContext< R > const &context)
Retrieves a ledger from a gRPC request context.
Definition
RPCLedgerHelpers.cpp:167
xrpl::rpc::ledgerFromSpecifier
Status ledgerFromSpecifier(T &ledger, org::xrpl::rpc::v1::LedgerSpecifier const &specifier, Context const &context)
Retrieves a ledger based on a LedgerSpecifier.
Definition
RPCLedgerHelpers.cpp:193
xrpl::rpc::lookupLedger
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.
Definition
RPCLedgerHelpers.cpp:390
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::UInt256
BaseUInt< 256 > UInt256
Definition
base_uint.h:580
xrpl::rpc::Context
The context of information needed to call an RPC.
Definition
Context.h:27
xrpl::rpc::GRPCContext
Definition
Context.h:58
xrpl::rpc::JsonContext
Definition
Context.h:41
xrpl::rpc::Status
Status represents the results of an operation that might fail.
Definition
Status.h:27
Generated by
1.17.0