xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
xrpld
rpc
handlers
orderbook
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
20
namespace
xrpl::rpc
{
21
28
class
NFTOffersHandlerBase
:
public
HandlerFor<::rpc::spec::handlers::nft_offers_common::Input>
29
{
30
public
:
34
struct
Output
35
{
36
UInt256
nftID
;
37
std::uint32_t
limit
= 0;
38
std::vector<SLE::const_pointer>
offers
;
39
std::optional<UInt256>
marker
;
40
};
41
48
static
void
49
writeResult
(
json::Value
& value,
Output
const
& output);
50
51
protected
:
57
explicit
NFTOffersHandlerBase
(
JsonContext
& context);
58
66
[[nodiscard]] std::expected<Output, ::rpc::Status>
67
enumerateOffers
(Input
const
& input,
Keylet
const
&
directory
)
const
;
68
69
private
:
70
std::reference_wrapper<JsonContext>
context_
;
71
};
72
73
}
// namespace xrpl::rpc
json::Value
Represents a JSON value.
Definition
json_value.h:121
xrpl::rpc::NFTOffersHandlerBase::NFTOffersHandlerBase
NFTOffersHandlerBase(JsonContext &context)
Construct a handler for a single request.
Definition
NFTOffersCommon.cpp:58
xrpl::rpc::NFTOffersHandlerBase::context_
std::reference_wrapper< JsonContext > context_
Definition
NFTOffersCommon.h:70
xrpl::rpc::NFTOffersHandlerBase::enumerateOffers
std::expected< Output, ::rpc::Status > enumerateOffers(Input const &input, Keylet const &directory) const
Enumerate one page of an NFT offer directory.
Definition
NFTOffersCommon.cpp:63
xrpl::rpc::NFTOffersHandlerBase::writeResult
static void writeResult(json::Value &value, Output const &output)
Write the output of process() into the response.
Definition
NFTOffersCommon.cpp:141
cstdint
functional
std::uint32_t
xrpl::directory
Definition
ApplyView.h:456
xrpl::rpc
The api_version numbers this server serves.
Definition
ApiVersion.h:26
xrpl::UInt256
BaseUInt< 256 > UInt256
Definition
base_uint.h:581
optional
std::reference_wrapper
xrpl::Keylet
A pair of SHAMap key and LedgerEntryType.
Definition
Keylet.h:20
xrpl::rpc::JsonContext
Definition
Context.h:41
xrpl::rpc::NFTOffersHandlerBase::Output
The data an NFT offers request produces, written out by writeResult().
Definition
NFTOffersCommon.h:35
xrpl::rpc::NFTOffersHandlerBase::Output::nftID
UInt256 nftID
The NFT whose offers are listed.
Definition
NFTOffersCommon.h:36
xrpl::rpc::NFTOffersHandlerBase::Output::offers
std::vector< SLE::const_pointer > offers
The offers on this page.
Definition
NFTOffersCommon.h:38
xrpl::rpc::NFTOffersHandlerBase::Output::marker
std::optional< UInt256 > marker
Where the next page starts, if there is one.
Definition
NFTOffersCommon.h:39
xrpl::rpc::NFTOffersHandlerBase::Output::limit
std::uint32_t limit
The limit used; written only with a marker.
Definition
NFTOffersCommon.h:37
vector
Generated by
1.17.0