xrpld
Loading...
Searching...
No Matches
NFTOffersCommon.h
1#pragma once
2
3#include <xrpld/rpc/Context.h>
4#include <xrpld/rpc/detail/SpecBridge.hpp>
5
6#include <xrpl/basics/base_uint.h>
7#include <xrpl/json/json_value.h>
8#include <xrpl/protocol/Keylet.h>
9#include <xrpl/protocol/STLedgerEntry.h>
10
11#include <rpcspec/Errors.hpp>
12#include <rpcspec/handlers/nft_offers_common/Types.hpp>
13
14#include <cstdint>
15#include <expected>
16#include <functional>
17#include <optional>
18#include <vector>
19
20namespace xrpl::rpc {
21
28class NFTOffersHandlerBase : public HandlerFor<::rpc::spec::handlers::nft_offers_common::Input>
29{
30public:
41
48 static void
49 writeResult(json::Value& value, Output const& output);
50
51protected:
57 explicit NFTOffersHandlerBase(JsonContext& context);
58
66 [[nodiscard]] std::expected<Output, ::rpc::Status>
67 enumerateOffers(Input const& input, Keylet const& directory) const;
68
69private:
71};
72
73} // namespace xrpl::rpc
Represents a JSON value.
Definition json_value.h:121
NFTOffersHandlerBase(JsonContext &context)
Construct a handler for a single request.
std::reference_wrapper< JsonContext > context_
std::expected< Output, ::rpc::Status > enumerateOffers(Input const &input, Keylet const &directory) const
Enumerate one page of an NFT offer directory.
static void writeResult(json::Value &value, Output const &output)
Write the output of process() into the response.
The api_version numbers this server serves.
Definition ApiVersion.h:26
BaseUInt< 256 > UInt256
Definition base_uint.h:581
A pair of SHAMap key and LedgerEntryType.
Definition Keylet.h:20
The data an NFT offers request produces, written out by writeResult().
UInt256 nftID
The NFT whose offers are listed.
std::vector< SLE::const_pointer > offers
The offers on this page.
std::optional< UInt256 > marker
Where the next page starts, if there is one.
std::uint32_t limit
The limit used; written only with a marker.