xrpld
Loading...
Searching...
No Matches
AccountChannels.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/STLedgerEntry.h>
11
12#include <rpcspec/Errors.hpp>
13#include <rpcspec/handlers/account_channels/Types.hpp>
14
15#include <cstdint>
16#include <expected>
17#include <functional>
18#include <memory>
19#include <optional>
20#include <vector>
21
22namespace xrpl::rpc {
23
29class AccountChannelsHandler : public HandlerFor<::rpc::spec::handlers::account_channels::Input>
30{
31public:
44
50 explicit AccountChannelsHandler(JsonContext& context);
51
58 [[nodiscard]] std::expected<Output, ::rpc::Status>
59 process(Input const& input) const;
60
67 void
68 writeResult(json::Value& value, Output const& output) const;
69
70private:
72};
73
74} // 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.
std::reference_wrapper< JsonContext > context_
void writeResult(json::Value &value, Output const &output) const
Write the output of process() into the response.
AccountChannelsHandler(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_channels request produces, written out by writeResult().
std::shared_ptr< ReadView const > ledger
The ledger the request selected.
AccountID account
The account whose channels are listed.
std::vector< SLE::const_pointer > channels
The channels on this page.
std::optional< uint256 > marker
Where the next page starts, if there is one.
std::uint64_t nextHint
The directory page hint written with the marker.
std::uint32_t limit
The limit used; written only with a marker.