xrpld
Loading...
Searching...
No Matches
AccountLines.h
1#pragma once
2
3#include <xrpld/rpc/Context.h>
4#include <xrpld/rpc/detail/SpecBridge.hpp>
5#include <xrpld/rpc/detail/TrustLine.h>
6
7#include <xrpl/basics/base_uint.h>
8#include <xrpl/json/json_value.h>
9#include <xrpl/ledger/ReadView.h>
10#include <xrpl/protocol/AccountID.h>
11#include <xrpl/protocol/ErrorCodes.h>
12
13#include <rpcspec/Errors.hpp>
14#include <rpcspec/handlers/account_lines/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 AccountLinesHandler : public HandlerFor<::rpc::spec::handlers::account_lines::Input>
31{
32public:
46
52 explicit AccountLinesHandler(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.
AccountLinesHandler(JsonContext &context)
Construct a handler for a single request.
void writeResult(json::Value &value, Output const &output) const
Write the output of process() into the response.
std::reference_wrapper< JsonContext > context_
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_lines request produces, written out by writeResult().
std::optional< ErrorCodeI > error
An error written with the ledger fields.
std::optional< uint256 > marker
Where the next page starts, if there is one.
std::vector< RPCTrustLine > lines
The trust lines on this page.
AccountID account
The account whose trust lines are listed.
std::shared_ptr< ReadView const > ledger
The ledger the request selected.
std::uint32_t limit
The limit used; written only with a marker.
std::uint64_t nextHint
The directory page hint written with the marker.