xrpld
Loading...
Searching...
No Matches
src/xrpld/rpc/handlers/ledger/Ledger.h
1#pragma once
2
3#include <xrpld/app/main/Application.h>
4#include <xrpld/app/misc/TxQ.h> // IWYU pragma: keep
5#include <xrpld/rpc/Context.h>
6#include <xrpld/rpc/Role.h>
7#include <xrpld/rpc/Status.h>
8#include <xrpld/rpc/detail/Handler.h>
9
10#include <xrpl/json/json_value.h>
11#include <xrpl/ledger/ReadView.h>
12#include <xrpl/protocol/ApiVersion.h>
13
14#include <memory>
15#include <vector>
16
17namespace json {
18class Object;
19} // namespace json
20
21namespace xrpl::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 // NOLINTBEGIN(readability-identifier-naming)
43 static constexpr char name[] = "ledger";
44
45 static constexpr unsigned minApiVer = rpc::kApiMinimumSupportedVersion;
46
47 static constexpr unsigned maxApiVer = rpc::kApiMaximumValidVersion;
48
49 static constexpr Role role = Role::USER;
50
52 // NOLINTEND(readability-identifier-naming)
53
54private:
59 int options_ = 0;
60};
61
62} // namespace xrpl::rpc
Represents a JSON value.
Definition json_value.h:117
std::shared_ptr< ReadView const > ledger_
JSON (JavaScript Object Notation).
Definition json_errors.h:5
@ Object
object value (collection of name/value pairs).
Definition json_value.h:29
API version numbers used in later API versions.
Definition ApiVersion.h:36
static constexpr auto kApiMaximumValidVersion
Definition ApiVersion.h:47
static constexpr auto kApiMinimumSupportedVersion
Definition ApiVersion.h:42
Role
Indicates the level of administrative permission to grant.
Definition Role.h:27
@ USER
Definition Role.h:27
Status represents the results of an operation that might fail.
Definition Status.h:27