rippled
Loading...
Searching...
No Matches
Version.h
1#pragma once
2
3#include <xrpl/protocol/ApiVersion.h>
4
5namespace xrpl {
6namespace RPC {
7
9{
10public:
11 explicit VersionHandler(JsonContext& c) : apiVersion_(c.apiVersion), betaEnabled_(c.app.config().BETA_RPC_API)
12 {
13 }
14
15 Status
17 {
18 return Status::OK;
19 }
20
21 void
26
27 static constexpr char const* name = "version";
28
29 static constexpr unsigned minApiVer = RPC::apiMinimumSupportedVersion;
30
31 static constexpr unsigned maxApiVer = RPC::apiMaximumValidVersion;
32
33 static constexpr Role role = Role::USER;
34
35 static constexpr Condition condition = NO_CONDITION;
36
37private:
38 unsigned int apiVersion_;
40};
41
42} // namespace RPC
43} // namespace xrpl
Represents a JSON value.
Definition json_value.h:130
VersionHandler(JsonContext &c)
Definition Version.h:11
static constexpr Condition condition
Definition Version.h:35
unsigned int apiVersion_
Definition Version.h:38
void writeResult(Json::Value &obj)
Definition Version.h:22
static constexpr char const * name
Definition Version.h:27
static constexpr Role role
Definition Version.h:33
static constexpr unsigned minApiVer
Definition Version.h:29
static constexpr unsigned maxApiVer
Definition Version.h:31
@ NO_CONDITION
Definition Handler.h:20
static constexpr auto apiMinimumSupportedVersion
Definition ApiVersion.h:41
static constexpr auto apiMaximumValidVersion
Definition ApiVersion.h:46
static constexpr std::integral_constant< unsigned, Version > apiVersion
Definition ApiVersion.h:38
void setVersion(Json::Value &parent, unsigned int apiVersion, bool betaEnabled)
Definition ApiVersion.h:58
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
static constexpr Code OK
Definition Status.h:26