1#ifndef XRPL_RPC_RPCHELPERS_H_INCLUDED
2#define XRPL_RPC_RPCHELPERS_H_INCLUDED
4#include <xrpld/app/misc/NetworkOPs.h>
5#include <xrpld/app/misc/TxQ.h>
6#include <xrpld/rpc/Context.h>
7#include <xrpld/rpc/Status.h>
8#include <xrpld/rpc/detail/Tuning.h>
10#include <xrpl/proto/org/xrpl/rpc/v1/xrp_ledger.pb.h>
11#include <xrpl/protocol/ApiVersion.h>
12#include <xrpl/protocol/SecretKey.h>
52 ReadView
const& ledger,
83 Tuning::LimitRange
const&
range,
84 JsonContext
const& context);
bool isRelatedToAccount(ReadView const &ledger, std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Tests if a ledger entry (SLE) is owned by the specified account.
std::pair< RPC::Status, LedgerEntryType > chooseLedgerEntryType(Json::Value const ¶ms)
Chooses the ledger entry type based on RPC parameters.
bool isAccountObjectsValidType(LedgerEntryType const &type)
Checks if the type is a valid filtering type for the account_objects method.
std::uint64_t getStartHint(std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
Gets the start hint for traversing account objects.
std::optional< Seed > parseRippleLibSeed(Json::Value const &value)
Parses a RippleLib seed from RPC parameters.
hash_set< AccountID > parseAccountIds(Json::Value const &jvArray)
Parses an array of account IDs from a JSON value.
static constexpr std::integral_constant< unsigned, Version > apiVersion
std::optional< std::pair< PublicKey, SecretKey > > keypairForSignature(Json::Value const ¶ms, Json::Value &error, unsigned int apiVersion)
Generates a keypair for signature from RPC parameters.
std::optional< Seed > getSeedFromRPC(Json::Value const ¶ms, Json::Value &error)
Extracts a Seed from RPC parameters.
static constexpr auto apiVersionIfUnspecified
std::optional< Json::Value > readLimitField(unsigned int &limit, Tuning::LimitRange const &range, JsonContext const &context)
Retrieves the limit value from a JsonContext or sets a default.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
LedgerEntryType
Identifiers for on-ledger objects.