rippled
Loading...
Searching...
No Matches
LedgerHandler.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}
18
19namespace xrpl {
20namespace RPC {
21
22struct JsonContext;
23
24// ledger [id|index|current|closed] [full]
25// {
26// ledger: 'current' | 'closed' | <uint256> | <number>, // optional
27// full: true | false // optional, defaults to false.
28// }
29
31{
32public:
33 explicit LedgerHandler(JsonContext&);
34
35 Status
36 check();
37
38 void
40
41 static constexpr char name[] = "ledger";
42
43 static constexpr unsigned minApiVer = RPC::apiMinimumSupportedVersion;
44
45 static constexpr unsigned maxApiVer = RPC::apiMaximumValidVersion;
46
47 static constexpr Role role = Role::USER;
48
49 static constexpr Condition condition = NO_CONDITION;
50
51private:
56 int options_ = 0;
57};
58
59} // namespace RPC
60} // namespace xrpl
Represents a JSON value.
Definition json_value.h:130
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:5
@ NO_CONDITION
Definition Handler.h:20
static constexpr auto apiMinimumSupportedVersion
Definition ApiVersion.h:41
static constexpr auto apiMaximumValidVersion
Definition ApiVersion.h:46
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
Role
Indicates the level of administrative permission to grant.
Definition Role.h:24
Status represents the results of an operation that might fail.
Definition Status.h:20