rippled
Loading...
Searching...
No Matches
LedgerHandler.h
1#ifndef XRPL_RPC_HANDLERS_LEDGER_H_INCLUDED
2#define XRPL_RPC_HANDLERS_LEDGER_H_INCLUDED
3
4#include <xrpld/app/ledger/LedgerMaster.h>
5#include <xrpld/app/ledger/LedgerToJson.h>
6#include <xrpld/app/main/Application.h>
7#include <xrpld/rpc/Context.h>
8#include <xrpld/rpc/Role.h>
9#include <xrpld/rpc/Status.h>
10#include <xrpld/rpc/detail/Handler.h>
11
12#include <xrpl/ledger/ReadView.h>
13#include <xrpl/protocol/ApiVersion.h>
14#include <xrpl/protocol/jss.h>
15
16namespace Json {
17class Object;
18}
19
20namespace xrpl {
21namespace RPC {
22
23struct JsonContext;
24
25// ledger [id|index|current|closed] [full]
26// {
27// ledger: 'current' | 'closed' | <uint256> | <number>, // optional
28// full: true | false // optional, defaults to false.
29// }
30
32{
33public:
34 explicit LedgerHandler(JsonContext&);
35
36 Status
37 check();
38
39 void
41
42 static constexpr char name[] = "ledger";
43
44 static constexpr unsigned minApiVer = RPC::apiMinimumSupportedVersion;
45
46 static constexpr unsigned maxApiVer = RPC::apiMaximumValidVersion;
47
48 static constexpr Role role = Role::USER;
49
50 static constexpr Condition condition = NO_CONDITION;
51
52private:
57 int options_ = 0;
58};
59
60} // namespace RPC
61} // namespace xrpl
62
63#endif
Represents a JSON value.
Definition json_value.h:131
static constexpr unsigned maxApiVer
void writeResult(Json::Value &)
std::shared_ptr< ReadView const > ledger_
static constexpr unsigned minApiVer
static constexpr Condition condition
static constexpr char name[]
static constexpr Role role
std::vector< TxQ::TxDetails > queueTxs_
JSON (JavaScript Object Notation).
Definition json_errors.h:6
@ NO_CONDITION
Definition Handler.h:21
static constexpr auto apiMinimumSupportedVersion
Definition ApiVersion.h:42
static constexpr auto apiMaximumValidVersion
Definition ApiVersion.h:48
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Role
Indicates the level of administrative permission to grant.
Definition Role.h:25
Status represents the results of an operation that might fail.
Definition Status.h:21