Clio
develop
The XRP Ledger API server.
Theme:
Default
Round
Robot
Toggle main menu visibility
Loading...
Searching...
No Matches
MPTHolders.hpp
1
#pragma once
2
3
#include "data/BackendInterface.hpp"
4
#include "rpc/common/SpecBackend.hpp"
5
#include "rpc/common/Types.hpp"
6
7
#include <boost/json/array.hpp>
8
#include <boost/json/conversion.hpp>
9
#include <boost/json/value.hpp>
10
#include <rpcspec/handlers/mpt_holders/Types.hpp>
11
12
#include <cstdint>
13
#include <memory>
14
#include <optional>
15
#include <string>
16
#include <utility>
17
18
namespace
rpc
{
19
29
class
MPTHoldersHandler
:
public
rpc::HandlerFor
<rpc::spec::handlers::mpt_holders::Input> {
30
std::shared_ptr<BackendInterface> sharedPtrBackend_;
31
32
public
:
33
static
constexpr
auto
kLimitMin = rpc::spec::handlers::mpt_holders::kLimitMin;
34
static
constexpr
auto
kLimitMax = rpc::spec::handlers::mpt_holders::kLimitMax;
35
static
constexpr
auto
kLimitDefault = rpc::spec::handlers::mpt_holders::kLimitDefault;
36
static
constexpr
auto
kMaxAccounts = rpc::spec::handlers::mpt_holders::kMaxAccounts;
37
41
struct
Output
{
42
boost::json::array mpts;
43
uint32_t ledgerIndex;
44
std::string mptID;
45
bool
validated =
true
;
46
std::optional<uint32_t> limit;
47
std::optional<std::string> marker;
48
};
49
50
using
Result =
HandlerReturnType<Output>
;
51
57
MPTHoldersHandler
(std::shared_ptr<BackendInterface> sharedPtrBackend)
58
: sharedPtrBackend_(std::move(sharedPtrBackend))
59
{
60
}
61
69
[[nodiscard]]
Result
70
process
(Input
const
& input,
Context
const
& ctx)
const
;
71
72
private
:
79
friend
void
80
tag_invoke
(boost::json::value_from_tag, boost::json::value& jv, Output
const
& output);
81
};
82
}
// namespace rpc
rpc::MPTHoldersHandler::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
MPTHolders.cpp:169
rpc::MPTHoldersHandler::process
Result process(Input const &input, Context const &ctx) const
Process the MPTHolders command.
Definition
MPTHolders.cpp:97
rpc::MPTHoldersHandler::MPTHoldersHandler
MPTHoldersHandler(std::shared_ptr< BackendInterface > sharedPtrBackend)
Construct a new MPTHoldersHandler object.
Definition
MPTHolders.hpp:57
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:61
rpc::HandlerFor
spec::HandlerFor< InputT, boost::json::value > HandlerFor
The spec-driven base every typed handler inherits.
Definition
SpecBackend.hpp:24
rpc::Context
Context of an RPC call.
Definition
Types.hpp:98
rpc::MPTHoldersHandler::Output
A struct to hold the output data of the command.
Definition
MPTHolders.hpp:41
rpc::Result
Result type used to return responses or error statuses to the Webserver subsystem.
Definition
Types.hpp:109
src
rpc
handlers
MPTHolders.hpp
Generated by
1.17.0