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
27 using Result = HandlerReturnType<Output>;
28
35 static Result
36 process(Context const& ctx);
37
38private:
45 friend void
46 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output const& output);
47};
48
49} // 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
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:18
std::expected< OutputType, Status > HandlerReturnType
Return type for each individual handler.
Definition Types.hpp:62
Context of an RPC call.
Definition Types.hpp:99
A struct to hold the output data of the command.
Definition Random.hpp:23