Clio  develop
The XRP Ledger API server.
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
10namespace rpc {
11
19public:
23 struct Output {
24 std::string random;
25 };
26
31
38 static Result
39 process(Context const& ctx);
40
41private:
48 friend void
49 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output const& output);
50};
51
52} // namespace rpc
The random command provides a random number to be used as a source of entropy for random number gener...
Definition Random.hpp:18
static Result process(Context const &ctx)
Process the Random command.
Definition Random.cpp:17
HandlerReturnType< Output > Result
The result type of the command: either the Output or an error status.
Definition Random.hpp:30
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
This namespace contains all the RPC logic and handlers.
Definition AMMHelpers.cpp:17
std::expected< OutputType, Status > HandlerReturnType
Return type for each individual handler.
Definition Types.hpp:63
Context of an RPC call.
Definition Types.hpp:102
A struct to hold the output data of the command.
Definition Random.hpp:23
std::string random
Random 256-bit value as a hex string.
Definition Random.hpp:24