20#include <xrpld/app/misc/NetworkOPs.h> 
   21#include <xrpld/rpc/Context.h> 
   22#include <xrpld/rpc/Role.h> 
   23#include <xrpld/rpc/detail/RPCHelpers.h> 
   25#include <xrpl/basics/Log.h> 
   26#include <xrpl/protocol/ErrorCodes.h> 
   27#include <xrpl/protocol/RPCErr.h> 
   28#include <xrpl/protocol/jss.h> 
   37    bool removeUrl{
false};
 
   66        for (
auto& it : context.
params[jss::streams])
 
   72            if (streamName == 
"server")
 
   76            else if (streamName == 
"ledger")
 
   80            else if (streamName == 
"manifests")
 
   84            else if (streamName == 
"transactions")
 
   89                streamName == 
"transactions_proposed" ||
 
   90                streamName == 
"rt_transactions")  
 
   94            else if (streamName == 
"validations")
 
   98            else if (streamName == 
"peer_status")
 
  102            else if (streamName == 
"consensus")
 
  113    auto accountsProposed = context.
params.
isMember(jss::accounts_proposed)
 
  114        ? jss::accounts_proposed
 
  140        auto const& req = context.
params[jss::account_history_tx_stream];
 
  141        if (!req.isMember(jss::account) || !req[jss::account].isString())
 
  144        auto const id = parseBase58<AccountID>(req[jss::account].asString());
 
  148        bool stopHistoryOnly = 
false;
 
  149        if (req.isMember(jss::stop_history_tx_only))
 
  151            if (!req[jss::stop_history_tx_only].isBool())
 
  153            stopHistoryOnly = req[jss::stop_history_tx_only].asBool();
 
  158            << 
"doUnsubscribe: account_history_tx_stream: " << 
toBase58(*
id)
 
  159            << 
" stopHistoryOnly=" << (stopHistoryOnly ? 
"true" : 
"false");
 
  167        for (
auto& jv : context.
params[jss::books])
 
  169            if (!jv.isObject() || !jv.isMember(jss::taker_pays) ||
 
  170                !jv.isMember(jss::taker_gets) ||
 
  171                !jv[jss::taker_pays].isObjectOrNull() ||
 
  172                !jv[jss::taker_gets].isObjectOrNull())
 
  183            if (!taker_pays.
isMember(jss::currency) ||
 
  187                JLOG(context.
j.
info()) << 
"Bad taker_pays currency.";
 
  192                ((taker_pays.
isMember(jss::issuer)) &&
 
  193                 (!taker_pays[jss::issuer].
isString() ||
 
  199                JLOG(context.
j.
info()) << 
"Bad taker_pays issuer.";
 
  205            if (!taker_gets.
isMember(jss::currency) ||
 
  209                JLOG(context.
j.
info()) << 
"Bad taker_gets currency.";
 
  215                ((taker_gets.
isMember(jss::issuer)) &&
 
  216                 (!taker_gets[jss::issuer].
isString() ||
 
  222                JLOG(context.
j.
info()) << 
"Bad taker_gets issuer.";
 
  227            if (book.
in == book.
out)
 
  229                JLOG(context.
j.
info()) << 
"taker_gets same as taker_pays.";
 
  233            if (jv.isMember(jss::domain))
 
  236                if (!jv[jss::domain].isString() ||
 
  237                    !domain.
parseHex(jv[jss::domain].asString()))
 
  250            if ((jv.isMember(jss::both) && jv[jss::both].asBool()) ||
 
  251                (jv.isMember(jss::both_sides) && jv[jss::both_sides].asBool()))
 
 
std::string asString() const
Returns the unquoted string value.
 
bool isMember(char const *key) const
Return true if the object has a member named key.
 
std::optional< uint256 > domain
 
virtual bool unsubBook(std::uint64_t uListener, Book const &)=0
 
virtual bool unsubValidations(std::uint64_t uListener)=0
 
virtual bool unsubServer(std::uint64_t uListener)=0
 
virtual bool unsubPeerStatus(std::uint64_t uListener)=0
 
virtual bool tryRemoveRpcSub(std::string const &strUrl)=0
 
virtual bool unsubConsensus(std::uint64_t uListener)=0
 
virtual bool unsubLedger(std::uint64_t uListener)=0
 
virtual pointer findRpcSub(std::string const &strUrl)=0
 
virtual bool unsubTransactions(std::uint64_t uListener)=0
 
virtual void unsubAccount(ref isplistener, hash_set< AccountID > const &vnaAccountIDs, bool realTime)=0
 
virtual bool unsubManifests(std::uint64_t uListener)=0
 
virtual void unsubAccountHistory(ref ispListener, AccountID const &account, bool historyOnly)=0
unsubscribe an account's transactions
 
virtual bool unsubRTTransactions(std::uint64_t uListener)=0
 
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
 
@ objectValue
object value (collection of name/value pairs).
 
hash_set< AccountID > parseAccountIds(Json::Value const &jvArray)
 
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
 
AccountID const & noAccount()
A placeholder for empty accounts.
 
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
 
Json::Value doUnsubscribe(RPC::JsonContext &)
 
bool isConsistent(Book const &book)
 
bool to_issuer(AccountID &, std::string const &)
Convert hex or base58 string to AccountID.
 
Book reversed(Book const &book)
 
Json::Value rpcError(int iError)
 
bool to_currency(Currency &, std::string const &)
Tries to convert a string to a Currency, returns true on success.