Clio
develop
The XRP Ledger API server.
Theme:
Default
Round
Robot
Toggle main menu visibility
Loading...
Searching...
No Matches
Random.hpp
1
#pragma once
2
3
#include "rpc/common/Types.hpp"
4
5
#include <boost/json/conversion.hpp>
6
#include <boost/json/value.hpp>
7
8
#include <string>
9
10
namespace
rpc
{
11
18
class
RandomHandler
{
19
public
:
23
struct
Output
{
24
std::string
random
;
25
};
26
30
using
Result
=
HandlerReturnType<Output>
;
31
38
static
Result
39
process
(
Context
const
& ctx);
40
41
private
:
48
friend
void
49
tag_invoke
(boost::json::value_from_tag, boost::json::value& jv,
Output
const
& output);
50
};
51
52
}
// namespace rpc
rpc::RandomHandler
The random command provides a random number to be used as a source of entropy for random number gener...
Definition
Random.hpp:18
rpc::RandomHandler::process
static Result process(Context const &ctx)
Process the Random command.
Definition
Random.cpp:17
rpc::RandomHandler::Result
HandlerReturnType< Output > Result
The result type of the command: either the Output or an error status.
Definition
Random.hpp:30
rpc::RandomHandler::tag_invoke
friend void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Output const &output)
Convert the Output to a JSON object.
Definition
Random.cpp:26
rpc
This namespace contains all the RPC logic and handlers.
Definition
AMMHelpers.cpp:17
rpc::HandlerReturnType
std::expected< OutputType, Status > HandlerReturnType
Return type for each individual handler.
Definition
Types.hpp:63
rpc::Context
Context of an RPC call.
Definition
Types.hpp:102
rpc::RandomHandler::Output
A struct to hold the output data of the command.
Definition
Random.hpp:23
rpc::RandomHandler::Output::random
std::string random
Random 256-bit value as a hex string.
Definition
Random.hpp:24
src
rpc
handlers
Random.hpp
Generated by
1.17.0