xrpld
Loading...
Searching...
No Matches
TransactionEntry.h
1#pragma once
2
3#include <xrpld/rpc/Context.h>
4#include <xrpld/rpc/detail/SpecBridge.hpp>
5
6#include <xrpl/json/json_value.h>
7#include <xrpl/ledger/ReadView.h>
8#include <xrpl/protocol/STObject.h>
9#include <xrpl/protocol/STTx.h>
10
11#include <rpcspec/Errors.hpp>
12#include <rpcspec/handlers/transaction_entry/Types.hpp>
13
14#include <expected>
15#include <functional>
16#include <memory>
17#include <optional>
18#include <string_view>
19
20namespace xrpl::rpc {
21
27class TransactionEntryHandler : public HandlerFor<::rpc::spec::handlers::transaction_entry::Input>
28{
29public:
40
46 explicit TransactionEntryHandler(JsonContext& context);
47
54 [[nodiscard]] std::expected<Output, ::rpc::Status>
55 process(Input const& input) const;
56
63 void
64 writeResult(json::Value& value, Output const& output) const;
65
66private:
68};
69
70} // namespace xrpl::rpc
Represents a JSON value.
Definition json_value.h:121
std::reference_wrapper< JsonContext > context_
void writeResult(json::Value &value, Output const &output) const
Write the output of process() into the response.
TransactionEntryHandler(JsonContext &context)
Construct a handler for a single request.
std::expected< Output, ::rpc::Status > process(Input const &input) const
Process the request.
The api_version numbers this server serves.
Definition ApiVersion.h:26
The data a transaction_entry request produces, written out by writeResult().
std::shared_ptr< STObject const > meta
The metadata of the transaction found.
std::shared_ptr< ReadView const > ledger
The ledger the request selected.
std::optional< std::string_view > error
An error written with the ledger fields.
std::shared_ptr< STTx const > tx
The transaction found.