xrpld
Loading...
Searching...
No Matches
handlers/orderbook/BookChanges.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
9#include <rpcspec/Errors.hpp>
10#include <rpcspec/handlers/book_changes/Types.hpp>
11
12#include <expected>
13#include <functional>
14#include <memory>
15
16namespace xrpl::rpc {
17
23class BookChangesHandler : public HandlerFor<::rpc::spec::handlers::book_changes::Input>
24{
25public:
33
39 explicit BookChangesHandler(JsonContext& context);
40
47 [[nodiscard]] std::expected<Output, ::rpc::Status>
48 process(Input const& input) const;
49
56 static void
57 writeResult(json::Value& value, Output const& output);
58
59private:
61};
62
63} // namespace xrpl::rpc
Represents a JSON value.
Definition json_value.h:121
std::reference_wrapper< JsonContext > context_
static void writeResult(json::Value &value, Output const &output)
Write the output of process() into the response.
std::expected< Output, ::rpc::Status > process(Input const &input) const
Process the request.
BookChangesHandler(JsonContext &context)
Construct a handler for a single request.
The api_version numbers this server serves.
Definition ApiVersion.h:26
The data a book_changes request produces, written out by writeResult().
std::shared_ptr< ReadView const > ledger
The ledger the request selected.