xrpld
Loading...
Searching...
No Matches
AccountOffers.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/ledger/ReadView.h>
9#include <xrpl/protocol/AccountID.h>
10#include <xrpl/protocol/ErrorCodes.h>
11#include <xrpl/protocol/STLedgerEntry.h>
12
13#include <rpcspec/Errors.hpp>
14#include <rpcspec/handlers/account_offers/Types.hpp>
15
16#include <cstdint>
17#include <expected>
18#include <functional>
19#include <memory>
20#include <optional>
21#include <vector>
22
23namespace xrpl::rpc {
24
30class AccountOffersHandler : public HandlerFor<::rpc::spec::handlers::account_offers::Input>
31{
32public:
46
52 explicit AccountOffersHandler(JsonContext& context);
53
60 [[nodiscard]] std::expected<Output, ::rpc::Status>
61 process(Input const& input) const;
62
69 void
70 writeResult(json::Value& value, Output const& output) const;
71
72private:
74};
75
76} // namespace xrpl::rpc
Represents a JSON value.
Definition json_value.h:121
std::expected< Output, ::rpc::Status > process(Input const &input) const
Process the request.
void writeResult(json::Value &value, Output const &output) const
Write the output of process() into the response.
std::reference_wrapper< JsonContext > context_
AccountOffersHandler(JsonContext &context)
Construct a handler for a single request.
The api_version numbers this server serves.
Definition ApiVersion.h:26
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:34
The data an account_offers request produces, written out by writeResult().
std::vector< SLE::const_pointer > offers
The offers on this page.
AccountID account
The account whose offers are listed.
std::optional< ErrorCodeI > error
An error written with the ledger fields.
std::uint32_t limit
The limit used; written only with a marker.
std::shared_ptr< ReadView const > ledger
The ledger the request selected.
std::uint64_t nextHint
The directory page hint written with the marker.
std::optional< uint256 > marker
Where the next page starts, if there is one.