rippled
Loading...
Searching...
No Matches
RPCHelpers.h
1#pragma once
2
3#include <xrpld/app/misc/TxQ.h>
4#include <xrpld/rpc/Context.h>
5#include <xrpld/rpc/Status.h>
6#include <xrpld/rpc/detail/Tuning.h>
7
8#include <xrpl/proto/org/xrpl/rpc/v1/xrp_ledger.pb.h>
9#include <xrpl/protocol/ApiVersion.h>
10#include <xrpl/protocol/SecretKey.h>
11#include <xrpl/server/NetworkOPs.h>
12
13#include <optional>
14
15namespace xrpl {
16
17class ReadView;
18
19namespace RPC {
20
21struct JsonContext;
22
36getStartHint(std::shared_ptr<SLE const> const& sle, AccountID const& accountID);
37
49bool
50isRelatedToAccount(ReadView const& ledger, std::shared_ptr<SLE const> const& sle, AccountID const& accountID);
51
60hash_set<AccountID>
61parseAccountIds(Json::Value const& jvArray);
62
77readLimitField(unsigned int& limit, Tuning::LimitRange const& range, JsonContext const& context);
78
91getSeedFromRPC(Json::Value const& params, Json::Value& error);
92
103parseRippleLibSeed(Json::Value const& params);
104
117
131bool
133
150
151} // namespace RPC
152
153} // namespace xrpl
Represents a JSON value.
Definition json_value.h:130
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:38
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:43
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:5
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
Definition RangeSet.h:34
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:28
LedgerEntryType
Identifiers for on-ledger objects.