rippled
Loading...
Searching...
No Matches
RPCHelpers.h
1#ifndef XRPL_RPC_RPCHELPERS_H_INCLUDED
2#define XRPL_RPC_RPCHELPERS_H_INCLUDED
3
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>
9
10#include <xrpl/proto/org/xrpl/rpc/v1/xrp_ledger.pb.h>
11#include <xrpl/protocol/ApiVersion.h>
12#include <xrpl/protocol/SecretKey.h>
13
14#include <optional>
15
16namespace xrpl {
17
18class ReadView;
19
20namespace RPC {
21
22struct JsonContext;
23
37getStartHint(std::shared_ptr<SLE const> const& sle, AccountID const& accountID);
38
50bool
52 ReadView const& ledger,
54 AccountID const& accountID);
55
64hash_set<AccountID>
65parseAccountIds(Json::Value const& jvArray);
66
82 unsigned int& limit,
83 Tuning::LimitRange const& range,
84 JsonContext const& context);
85
98getSeedFromRPC(Json::Value const& params, Json::Value& error);
99
110parseRippleLibSeed(Json::Value const& params);
111
124
138bool
140
157 Json::Value const& params,
158 Json::Value& error,
159 unsigned int apiVersion = apiVersionIfUnspecified);
160
161} // namespace RPC
162
163} // namespace xrpl
164
165#endif
Represents a JSON value.
Definition json_value.h:131
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 &params)
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
Definition ApiVersion.h:39
std::optional< std::pair< PublicKey, SecretKey > > keypairForSignature(Json::Value const &params, Json::Value &error, unsigned int apiVersion)
Generates a keypair for signature from RPC parameters.
std::optional< Seed > getSeedFromRPC(Json::Value const &params, Json::Value &error)
Extracts a Seed from RPC parameters.
static constexpr auto apiVersionIfUnspecified
Definition ApiVersion.h:44
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.
Definition algorithm.h:6
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
Definition RangeSet.h:35
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:29
LedgerEntryType
Identifiers for on-ledger objects.