xrpld
Loading...
Searching...
No Matches
xrpl::rpc::NFTOffersHandlerBase Class Reference

The shared body of the nft_buy_offers and nft_sell_offers handlers. More...

#include <NFTOffersCommon.h>

Inheritance diagram for xrpl::rpc::NFTOffersHandlerBase:
Collaboration diagram for xrpl::rpc::NFTOffersHandlerBase:

Classes

struct  Output
 The data an NFT offers request produces, written out by writeResult(). More...

Static Public Member Functions

static void writeResult (json::Value &value, Output const &output)
 Write the output of process() into the response.

Protected Member Functions

 NFTOffersHandlerBase (JsonContext &context)
 Construct a handler for a single request.
std::expected< Output, ::rpc::Status > enumerateOffers (Input const &input, Keylet const &directory) const
 Enumerate one page of an NFT offer directory.

Private Attributes

std::reference_wrapper< JsonContext > context_

Detailed Description

The shared body of the nft_buy_offers and nft_sell_offers handlers.

The request is parsed by ::rpc::spec::handlers::nft_offers_common. The two handlers differ only in the offer directory they enumerate.

Definition at line 28 of file NFTOffersCommon.h.

Constructor & Destructor Documentation

◆ NFTOffersHandlerBase()

xrpl::rpc::NFTOffersHandlerBase::NFTOffersHandlerBase ( JsonContext & context)
explicitprotected

Construct a handler for a single request.

Parameters
contextThe context of the request being handled.

Definition at line 58 of file NFTOffersCommon.cpp.

Member Function Documentation

◆ writeResult()

void xrpl::rpc::NFTOffersHandlerBase::writeResult ( json::Value & value,
Output const & output )
static

Write the output of process() into the response.

Parameters
valueThe response to write into.
outputThe output process() returned.

Definition at line 141 of file NFTOffersCommon.cpp.

◆ enumerateOffers()

std::expected< NFTOffersHandlerBase::Output,::rpc::Status > xrpl::rpc::NFTOffersHandlerBase::enumerateOffers ( Input const & input,
Keylet const & directory ) const
nodiscardprotected

Enumerate one page of an NFT offer directory.

Parameters
inputThe request, parsed and validated by the spec.
directoryThe buy or sell offer directory of the NFT.
Returns
The output to write, or the status of the error.

Definition at line 63 of file NFTOffersCommon.cpp.

Member Data Documentation

◆ context_

std::reference_wrapper<JsonContext> xrpl::rpc::NFTOffersHandlerBase::context_
private

Definition at line 70 of file NFTOffersCommon.h.