22#include "feed/SubscriptionManagerInterface.hpp"
23#include "feed/Types.hpp"
24#include "rpc/common/Specs.hpp"
25#include "rpc/common/Types.hpp"
27#include <boost/json/conversion.hpp>
28#include <boost/json/value.hpp>
29#include <boost/json/value_to.hpp>
30#include <xrpl/protocol/Book.h>
31#include <xrpl/protocol/ErrorCodes.h>
32#include <xrpl/protocol/jss.h>
51 std::shared_ptr<feed::SubscriptionManagerInterface> subscriptions_;
66 std::optional<std::vector<std::string>> accounts;
67 std::optional<std::vector<std::string>> streams;
68 std::optional<std::vector<std::string>> accountsProposed;
69 std::optional<std::vector<OrderBook>> books;
80 UnsubscribeHandler(std::shared_ptr<feed::SubscriptionManagerInterface>
const& subscriptions);
89 spec([[maybe_unused]] uint32_t apiVersion);
103 unsubscribeFromStreams(std::vector<std::string>
const& streams, feed::SubscriberSharedPtr
const& session)
const;
106 unsubscribeFromAccounts(std::vector<std::string> accounts, feed::SubscriberSharedPtr
const& session)
const;
109 unsubscribeFromProposedAccounts(std::vector<std::string> accountsProposed, feed::SubscriberSharedPtr
const& session)
113 unsubscribeFromBooks(std::vector<OrderBook>
const& books, feed::SubscriberSharedPtr
const& session)
const;
122 tag_invoke(boost::json::value_to_tag<Input>, boost::json::value
const& jv);
Handles the unsubscribe command which is used to disconnect a subscriber from a feed....
Definition Unsubscribe.hpp:50
static RpcSpecConstRef spec(uint32_t apiVersion)
Returns the API specification for the command.
Definition Unsubscribe.cpp:54
UnsubscribeHandler(std::shared_ptr< feed::SubscriptionManagerInterface > const &subscriptions)
Construct a new BaseUnsubscribeHandler object.
Definition Unsubscribe.cpp:48
friend Input tag_invoke(boost::json::value_to_tag< Input >, boost::json::value const &jv)
Convert a JSON object to an Input.
Definition Unsubscribe.cpp:166
Result process(Input input, Context const &ctx) const
Process the Unsubscribe command.
Definition Unsubscribe.cpp:90
This namespace contains all the RPC logic and handlers.
Definition AMMHelpers.cpp:36
RpcSpec const & RpcSpecConstRef
An alias for a const reference to RpcSpec.
Definition Specs.hpp:145
std::expected< OutputType, Status > HandlerReturnType
Return type for each individual handler.
Definition Types.hpp:81
Context of an RPC call.
Definition Types.hpp:118
A struct to hold one order book.
Definition Unsubscribe.hpp:57
An empty type used as Output for handlers than don't actually produce output.
Definition Types.hpp:113