xrpld
Loading...
Searching...
No Matches
AccountInfo.h
1#pragma once
2
3#include <xrpld/app/misc/TxQ.h>
4#include <xrpld/rpc/Context.h>
5#include <xrpld/rpc/detail/SpecBridge.hpp>
6
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_info/Types.hpp>
15
16#include <expected>
17#include <functional>
18#include <memory>
19#include <optional>
20#include <vector>
21
22namespace xrpl::rpc {
23
29class AccountInfoHandler : public HandlerFor<::rpc::spec::handlers::account_info::Input>
30{
31public:
44
50 explicit AccountInfoHandler(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::shared_ptr< STLedgerEntry const > const_pointer
std::expected< Output, ::rpc::Status > process(Input const &input) const
Process the request.
std::reference_wrapper< JsonContext > context_
Definition AccountInfo.h:71
AccountInfoHandler(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.
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_info request produces, written out by writeResult().
Definition AccountInfo.h:36
std::shared_ptr< ReadView const > ledger
The ledger the request selected.
Definition AccountInfo.h:37
SLE::const_pointer accountRoot
The account root, once it was read.
Definition AccountInfo.h:40
std::optional< std::vector< TxQ::TxDetails > > queue
The requested queued transactions.
Definition AccountInfo.h:42
AccountID account
The account; written only if not found.
Definition AccountInfo.h:39
std::optional< SLE::const_pointer > signerList
The requested signer list, or null.
Definition AccountInfo.h:41
std::optional< ErrorCodeI > error
An error written with the ledger fields.
Definition AccountInfo.h:38