xrpld
Loading...
Searching...
No Matches
src/xrpld/rpc/handlers/ledger/Ledger.h
1#pragma once
2
3#include <xrpld/app/ledger/LedgerMaster.h>
4#include <xrpld/app/ledger/LedgerToJson.h>
5#include <xrpld/app/main/Application.h>
6#include <xrpld/rpc/Context.h>
7#include <xrpld/rpc/Role.h>
8#include <xrpld/rpc/Status.h>
9#include <xrpld/rpc/detail/Handler.h>
10
11#include <xrpl/ledger/ReadView.h>
12#include <xrpl/protocol/ApiVersion.h>
13#include <xrpl/protocol/jss.h>
14
15namespace json {
16class Object;
17} // namespace json
18
19namespace xrpl::RPC {
20
21struct JsonContext;
22
23// ledger [id|index|current|closed] [full]
24// {
25// ledger: 'current' | 'closed' | <uint256> | <number>, // optional
26// full: true | false // optional, defaults to false.
27// }
28
30{
31public:
32 explicit LedgerHandler(JsonContext&);
33
34 Status
35 check();
36
37 void
39
40 // NOLINTBEGIN(readability-identifier-naming)
41 static constexpr char name[] = "ledger";
42
43 static constexpr unsigned minApiVer = RPC::kApiMinimumSupportedVersion;
44
45 static constexpr unsigned maxApiVer = RPC::kApiMaximumValidVersion;
46
47 static constexpr Role role = Role::USER;
48
50 // NOLINTEND(readability-identifier-naming)
51
52private:
57 int options_ = 0;
58};
59
60} // namespace xrpl::RPC
Represents a JSON value.
Definition json_value.h:130
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:26
API version numbers used in later API versions.
Definition ApiVersion.h:35
static constexpr auto kApiMinimumSupportedVersion
Definition ApiVersion.h:41
static constexpr auto kApiMaximumValidVersion
Definition ApiVersion.h:46
Role
Indicates the level of administrative permission to grant.
Definition Role.h:24
@ USER
Definition Role.h:24
Status represents the results of an operation that might fail.
Definition Status.h:19