3#include "data/BackendInterface.hpp"
5#include "rpc/common/SpecBackend.hpp"
6#include "rpc/common/Types.hpp"
7#include "util/log/Logger.hpp"
9#include <boost/json/array.hpp>
10#include <boost/json/conversion.hpp>
11#include <boost/json/object.hpp>
12#include <boost/json/value.hpp>
13#include <rpcspec/handlers/nft_history/Types.hpp>
32 std::shared_ptr<BackendInterface> sharedPtrBackend_;
38 static constexpr auto kLimitMin = rpc::spec::handlers::nft_history::kLimitMin;
42 static constexpr auto kLimitMax = rpc::spec::handlers::nft_history::kLimitMax;
46 static constexpr auto kLimitDefault = rpc::spec::handlers::nft_history::kLimitDefault;
51 using Marker = rpc::spec::handlers::nft_history::Marker;
79 : sharedPtrBackend_(std::move(sharedPtrBackend))
101 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
118tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Marker
const& marker);
HandlerReturnType< Output > Result
The result type of the command: either the Output or an error status.
Definition NFTHistory.hpp:71
static constexpr auto kLimitDefault
Default value of the limit parameter.
Definition NFTHistory.hpp:46
static constexpr auto kLimitMax
Maximum allowed value of the limit parameter.
Definition NFTHistory.hpp:42
NFTHistoryHandler(std::shared_ptr< BackendInterface > sharedPtrBackend)
Construct a new NFTHistoryHandler object.
Definition NFTHistory.hpp:78
static constexpr auto kLimitMin
Minimum allowed value of the limit parameter.
Definition NFTHistory.hpp:38
rpc::spec::handlers::nft_history::Marker Marker
A struct to hold the marker data.
Definition NFTHistory.hpp:51
friend void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Output const &output)
Convert the Output to a JSON object.
Definition NFTHistory.cpp:165
Result process(Input const &input, Context const &ctx) const
Process the NFTHistory command.
Definition NFTHistory.cpp:34
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:110
JSON conversions for the nft_history spec types used by NFTHistoryHandler.
Definition NFTHistory.cpp:188
void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Marker const &marker)
Convert the Marker to a JSON object.
Definition NFTHistory.cpp:191
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
spec::HandlerFor< InputT, boost::json::value > HandlerFor
The spec-driven base every typed handler inherits.
Definition SpecBackend.hpp:24
Context of an RPC call.
Definition Types.hpp:102
A struct to hold the output data of the command.
Definition NFTHistory.hpp:56
std::optional< Marker > marker
Marker to resume from, if more results remain.
Definition NFTHistory.hpp:61
boost::json::array transactions
Transactions that affected the NFT.
Definition NFTHistory.hpp:63
std::optional< uint32_t > limit
Limit from the request; unset if the default was used.
Definition NFTHistory.hpp:60
uint32_t ledgerIndexMax
Highest ledger sequence searched.
Definition NFTHistory.hpp:59
uint32_t ledgerIndexMin
Lowest ledger sequence searched.
Definition NFTHistory.hpp:58
std::string nftID
ID of the queried NFT.
Definition NFTHistory.hpp:57
bool validated
Whether the ledger is validated.
Definition NFTHistory.hpp:65
Result type used to return responses or error statuses to the Webserver subsystem.
Definition Types.hpp:132