rippled
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
ripple::RPC Namespace Reference

Namespaces

 common
 
 detail
 
 Tuning
 Tuned constants.
 

Classes

class  AccountLinesRPC_test
 
class  codeString_test
 
struct  Context
 The context of information needed to call an RPC. More...
 
struct  ErrorInfo
 Maps an rpc error code to its token, default message, and HTTP status. More...
 
class  fillJson_test
 
struct  GRPCContext
 
struct  Handler
 
struct  JsonContext
 
class  JSONRPC_test
 
struct  key_strings
 
class  LedgerHandler
 
class  LedgerRequestRPC_test
 
class  LegacyPathFind
 
class  RecoveryHandler
 
struct  Request
 
class  ShardArchiveHandler
 Handles the download and import of one or more shard archives. More...
 
class  ShardVerificationScheduler
 
struct  Status
 Status represents the results of an operation that might fail. More...
 
struct  TxnTestData
 
class  VersionHandler
 
class  WalletPropose_test
 

Typedefs

using ProcessTransactionFn = std::function< void(std::shared_ptr< Transaction > &transaction, bool bUnlimited, bool bLocal, NetworkOPs::FailHard failType)>
 
using Output = std::function< void(boost::string_ref const &)>
 

Enumerations

enum  Condition { NO_CONDITION = 0, NEEDS_NETWORK_CONNECTION = 1, NEEDS_CURRENT_LEDGER = 2 + NEEDS_NETWORK_CONNECTION, NEEDS_CLOSED_LEDGER = 4 + NEEDS_NETWORK_CONNECTION }
 
enum  LedgerShortcut { CURRENT, CLOSED, VALIDATED }
 

Functions

ErrorInfo const & get_error_info (error_code_i code)
 Returns an ErrorInfo that reflects the error code. More...
 
bool contains_error (Json::Value const &json)
 Returns true if the json contains an rpc error specification. More...
 
int error_code_http_status (error_code_i code)
 Returns http status that corresponds to the error code. More...
 
template<class L >
Json::Value computeBookChanges (std::shared_ptr< L const > const &lpAccepted)
 
template<class GetLedgerIndex , class GetCloseTime >
std::optional< STAmountgetDeliveredAmount (GetLedgerIndex const &getLedgerIndex, GetCloseTime const &getCloseTime, std::shared_ptr< STTx const > const &serializedTx, TxMeta const &transactionMeta)
 
template<class GetFix1623Enabled >
bool canHaveDeliveredAmountHelp (GetFix1623Enabled const &getFix1623Enabled, std::shared_ptr< STTx const > const &serializedTx, TxMeta const &transactionMeta)
 
bool canHaveDeliveredAmount (RPC::Context const &context, std::shared_ptr< STTx const > const &serializedTx, TxMeta const &transactionMeta)
 
template<class GetLedgerIndex >
static std::optional< STAmountgetDeliveredAmount (RPC::Context const &context, std::shared_ptr< STTx const > const &serializedTx, TxMeta const &transactionMeta, GetLedgerIndex const &getLedgerIndex)
 
Handler const * getHandler (unsigned version, bool betaEnabled, std::string const &name)
 
std::vector< char const * > getHandlerNames ()
 Return names of all methods. More...
 
Handler const * getHandler (unsigned int version, bool betaEnabled, std::string const &)
 
template<class Value >
Json::Value makeObjectValue (Value const &value, Json::StaticString const &field=jss::message)
 Return a Json::objectValue with a single entry. More...
 
template<class T >
error_code_i conditionMet (Condition condition_required, T &context)
 
void injectReportingWarning (RPC::JsonContext &context, Json::Value &result)
 
Status doCommand (RPC::JsonContext &, Json::Value &)
 Execute an RPC command and store the results in a Json::Value. More...
 
Role roleRequired (unsigned int version, bool betaEnabled, std::string const &method)
 
std::optional< AccountIDaccountFromStringStrict (std::string const &)
 Get an AccountID from an account ID or public key. More...
 
error_code_i accountFromStringWithCode (AccountID &result, std::string const &strIdent, bool bStrict=false)
 Decode account ID from string. More...
 
Json::Value accountFromString (AccountID &result, std::string const &strIdent, bool bStrict)
 
std::uint64_t getStartHint (std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
 Gets the start hint for traversing account objects. More...
 
bool isRelatedToAccount (ReadView const &ledger, std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
 Tests if a SLE is owned by accountID. More...
 
bool getAccountObjects (ReadView const &ledger, AccountID const &account, std::optional< std::vector< LedgerEntryType >> const &typeFilter, uint256 dirIndex, uint256 entryIndex, std::uint32_t const limit, Json::Value &jvResult)
 Gathers all objects for an account in a ledger. More...
 
template<class T , class R >
Status ledgerFromRequest (T &ledger, GRPCContext< R > &context)
 
template Status ledgerFromRequest (std::shared_ptr< ReadView const > &, GRPCContext< org::xrpl::rpc::v1::GetLedgerEntryRequest > &)
 
template Status ledgerFromRequest (std::shared_ptr< ReadView const > &, GRPCContext< org::xrpl::rpc::v1::GetLedgerDataRequest > &)
 
template Status ledgerFromRequest (std::shared_ptr< ReadView const > &, GRPCContext< org::xrpl::rpc::v1::GetLedgerRequest > &)
 
template<class T >
Status ledgerFromSpecifier (T &ledger, org::xrpl::rpc::v1::LedgerSpecifier const &specifier, Context &context)
 
template<class T >
Status getLedger (T &ledger, uint256 const &ledgerHash, Context &context)
 Get ledger by hash If there is no error in the return value, the ledger pointer will have been filled. More...
 
template<class T >
Status getLedger (T &ledger, uint32_t ledgerIndex, Context &context)
 Get ledger by sequence If there is no error in the return value, the ledger pointer will have been filled. More...
 
template<class T >
Status getLedger (T &ledger, LedgerShortcut shortcut, Context &context)
 Get ledger specified in shortcut. More...
 
template Status getLedger (std::shared_ptr< ReadView const > &, uint32_t, Context &)
 
template Status getLedger (std::shared_ptr< ReadView const > &, LedgerShortcut shortcut, Context &)
 
template Status getLedger (std::shared_ptr< ReadView const > &, uint256 const &, Context &)
 
bool isValidated (LedgerMaster &ledgerMaster, ReadView const &ledger, Application &app)
 
Status lookupLedger (std::shared_ptr< ReadView const > &, JsonContext &, Json::Value &result)
 Look up a ledger from a request and fill a Json::Result with the data representing a ledger. More...
 
Json::Value lookupLedger (std::shared_ptr< ReadView const > &, JsonContext &)
 Look up a ledger from a request and fill a Json::Result with either an error, or data representing a ledger. More...
 
hash_set< AccountIDparseAccountIds (Json::Value const &jvArray)
 
void injectSLE (Json::Value &jv, SLE const &sle)
 Inject JSON describing ledger entry. More...
 
std::optional< Json::ValuereadLimitField (unsigned int &limit, Tuning::LimitRange const &, JsonContext const &)
 Retrieve the limit value from a JsonContext, or set a default - then restrict the limit by max and min if not an ADMIN request. More...
 
std::optional< SeedparseRippleLibSeed (Json::Value const &value)
 
std::optional< SeedgetSeedFromRPC (Json::Value const &params, Json::Value &error)
 
std::pair< PublicKey, SecretKeykeypairForSignature (Json::Value const &params, Json::Value &error)
 
std::pair< RPC::Status, LedgerEntryTypechooseLedgerEntryType (Json::Value const &params)
 
unsigned int getAPIVersionNumber (const Json::Value &value, bool betaEnabled)
 Retrieve the api version number from the json value. More...
 
std::variant< std::shared_ptr< Ledger const >, Json::ValuegetLedgerByContext (RPC::JsonContext &context)
 Return a ledger based on ledger_hash or ledger_index, or an RPC error. More...
 
bool isHexTxID (std::string const &txid)
 
template<class Object >
void setVersion (Object &parent, unsigned int apiVersion, bool betaEnabled)
 
Json::Value checkFee (Json::Value &request, Role const role, bool doAutoFill, Config const &config, LoadFeeTrack const &feeTrack, TxQ const &txQ, Application const &app)
 Fill in the fee on behalf of the client. More...
 
Json::Value transactionSign (Json::Value jvRequest, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
 Returns a Json::objectValue. More...
 
Json::Value transactionSubmit (Json::Value jvRequest, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
 Returns a Json::objectValue. More...
 
Json::Value transactionSignFor (Json::Value jvRequest, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
 Returns a Json::objectValue. More...
 
Json::Value transactionSubmitMultiSigned (Json::Value jvRequest, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
 Returns a Json::objectValue. More...
 
ProcessTransactionFn getProcessTxnFn (NetworkOPs &netOPs)
 
Output stringOutput (std::string &s)
 
 BEAST_DEFINE_TESTSUITE (AccountLinesRPC, app, ripple)
 
 BEAST_DEFINE_TESTSUITE (JSONRPC, ripple_app, ripple)
 
 BEAST_DEFINE_TESTSUITE (WalletPropose, ripple_basics, ripple)
 
 BEAST_DEFINE_TESTSUITE (LedgerRequestRPC, app, ripple)
 
 BEAST_DEFINE_TESTSUITE (codeString, Status, RPC)
 
 BEAST_DEFINE_TESTSUITE (fillJson, Status, RPC)
 

Variables

const beast::SemanticVersion firstVersion ("1.0.0")
 API version numbers used in API version 1. More...
 
const beast::SemanticVersion goodVersion ("1.0.0")
 
const beast::SemanticVersion lastVersion ("1.0.0")
 
constexpr unsigned int apiInvalidVersion = 0
 API version numbers used in later API versions. More...
 
constexpr unsigned int apiVersionIfUnspecified = 1
 
constexpr unsigned int apiMinimumSupportedVersion = 1
 
constexpr unsigned int apiMaximumSupportedVersion = 1
 
constexpr unsigned int apiBetaVersion = 2
 
static constexpr TxnTestData txnTestArray []
 
static const key_strings secp256k1_strings
 
static const key_strings ed25519_strings
 
static const key_strings strong_brain_strings
 

Typedef Documentation

◆ ProcessTransactionFn

using ripple::RPC::ProcessTransactionFn = typedef std::function<void( std::shared_ptr<Transaction>& transaction, bool bUnlimited, bool bLocal, NetworkOPs::FailHard failType)>

Definition at line 79 of file TransactionSign.h.

◆ Output

using ripple::RPC::Output = typedef std::function<void(boost::string_ref const&)>

Definition at line 28 of file rpc/Output.h.

Enumeration Type Documentation

◆ Condition

Enumerator
NO_CONDITION 
NEEDS_NETWORK_CONNECTION 
NEEDS_CURRENT_LEDGER 
NEEDS_CLOSED_LEDGER 

Definition at line 39 of file Handler.h.

◆ LedgerShortcut

Enumerator
CURRENT 
CLOSED 
VALIDATED 

Definition at line 129 of file RPCHelpers.h.

Function Documentation

◆ get_error_info()

ErrorInfo const & ripple::RPC::get_error_info ( error_code_i  code)

Returns an ErrorInfo that reflects the error code.

Definition at line 170 of file ErrorCodes.cpp.

◆ inject_error() [1/3]

template<class JsonValue >
void ripple::RPC::inject_error ( error_code_i  code,
JsonValue &  json 
)

Add or update the json update to reflect the error code.

Definition at line 212 of file ErrorCodes.h.

◆ inject_error() [2/3]

template<class JsonValue >
void ripple::RPC::inject_error ( int  code,
JsonValue &  json 
)

Definition at line 222 of file ErrorCodes.h.

◆ inject_error() [3/3]

template<class JsonValue >
void ripple::RPC::inject_error ( error_code_i  code,
std::string const &  message,
JsonValue &  json 
)

Definition at line 229 of file ErrorCodes.h.

◆ make_error() [1/2]

Json::Value ripple::RPC::make_error ( error_code_i  code)

Returns a new json object that reflects the error code.

Definition at line 178 of file ErrorCodes.cpp.

◆ make_error() [2/2]

Json::Value ripple::RPC::make_error ( error_code_i  code,
std::string const &  message 
)

Definition at line 186 of file ErrorCodes.cpp.

◆ make_param_error()

Json::Value ripple::RPC::make_param_error ( std::string const &  message)

Returns a new json object that indicates invalid parameters.

Definition at line 250 of file ErrorCodes.h.

◆ missing_field_message()

std::string ripple::RPC::missing_field_message ( std::string const &  name)

Definition at line 256 of file ErrorCodes.h.

◆ missing_field_error() [1/2]

Json::Value ripple::RPC::missing_field_error ( std::string const &  name)

Definition at line 262 of file ErrorCodes.h.

◆ missing_field_error() [2/2]

Json::Value ripple::RPC::missing_field_error ( Json::StaticString  name)

Definition at line 268 of file ErrorCodes.h.

◆ object_field_message()

std::string ripple::RPC::object_field_message ( std::string const &  name)

Definition at line 274 of file ErrorCodes.h.

◆ object_field_error() [1/2]

Json::Value ripple::RPC::object_field_error ( std::string const &  name)

Definition at line 280 of file ErrorCodes.h.

◆ object_field_error() [2/2]

Json::Value ripple::RPC::object_field_error ( Json::StaticString  name)

Definition at line 286 of file ErrorCodes.h.

◆ invalid_field_message() [1/2]

std::string ripple::RPC::invalid_field_message ( std::string const &  name)

Definition at line 292 of file ErrorCodes.h.

◆ invalid_field_message() [2/2]

std::string ripple::RPC::invalid_field_message ( Json::StaticString  name)

Definition at line 298 of file ErrorCodes.h.

◆ invalid_field_error() [1/2]

Json::Value ripple::RPC::invalid_field_error ( std::string const &  name)

Definition at line 304 of file ErrorCodes.h.

◆ invalid_field_error() [2/2]

Json::Value ripple::RPC::invalid_field_error ( Json::StaticString  name)

Definition at line 310 of file ErrorCodes.h.

◆ expected_field_message() [1/2]

std::string ripple::RPC::expected_field_message ( std::string const &  name,
std::string const &  type 
)

Definition at line 316 of file ErrorCodes.h.

◆ expected_field_message() [2/2]

std::string ripple::RPC::expected_field_message ( Json::StaticString  name,
std::string const &  type 
)

Definition at line 322 of file ErrorCodes.h.

◆ expected_field_error() [1/2]

Json::Value ripple::RPC::expected_field_error ( std::string const &  name,
std::string const &  type 
)

Definition at line 328 of file ErrorCodes.h.

◆ expected_field_error() [2/2]

Json::Value ripple::RPC::expected_field_error ( Json::StaticString  name,
std::string const &  type 
)

Definition at line 334 of file ErrorCodes.h.

◆ not_validator_error()

Json::Value ripple::RPC::not_validator_error ( )

Definition at line 340 of file ErrorCodes.h.

◆ contains_error()

bool ripple::RPC::contains_error ( Json::Value const &  json)

Returns true if the json contains an rpc error specification.

Definition at line 194 of file ErrorCodes.cpp.

◆ error_code_http_status()

int ripple::RPC::error_code_http_status ( error_code_i  code)

Returns http status that corresponds to the error code.

Definition at line 202 of file ErrorCodes.cpp.

◆ computeBookChanges()

template<class L >
Json::Value ripple::RPC::computeBookChanges ( std::shared_ptr< L const > const &  lpAccepted)

Definition at line 38 of file BookChanges.h.

◆ insertDeliveredAmount() [1/3]

void ripple::RPC::insertDeliveredAmount ( Json::Value meta,
ReadView const &  ledger,
std::shared_ptr< STTx const > const &  serializedTx,
TxMeta const &  transactionMeta 
)

Add a delivered_amount field to the meta input/output parameter.

The field is only added to successful payment and check cash transactions. If a delivered amount field is available in the TxMeta parameter, that value is used. Otherwise, the transaction's Amount field is used. If neither is available, then the delivered amount is set to "unavailable".

Definition at line 143 of file DeliveredAmount.cpp.

◆ insertDeliveredAmount() [2/3]

void ripple::RPC::insertDeliveredAmount ( Json::Value meta,
RPC::JsonContext const &  context,
std::shared_ptr< Transaction > const &  transaction,
TxMeta const &  transactionMeta 
)

Definition at line 212 of file DeliveredAmount.cpp.

◆ insertDeliveredAmount() [3/3]

void ripple::RPC::insertDeliveredAmount ( Json::Value meta,
RPC::JsonContext const &  context,
std::shared_ptr< STTx const > const &  transaction,
TxMeta const &  transactionMeta 
)

Definition at line 223 of file DeliveredAmount.cpp.

◆ getDeliveredAmount() [1/3]

std::optional< STAmount > ripple::RPC::getDeliveredAmount ( RPC::Context const &  context,
std::shared_ptr< STTx const > const &  serializedTx,
TxMeta const &  transactionMeta,
LedgerIndex const &  ledgerIndex 
)

Definition at line 199 of file DeliveredAmount.cpp.

◆ getDeliveredAmount() [2/3]

template<class GetLedgerIndex , class GetCloseTime >
std::optional<STAmount> ripple::RPC::getDeliveredAmount ( GetLedgerIndex const &  getLedgerIndex,
GetCloseTime const &  getCloseTime,
std::shared_ptr< STTx const > const &  serializedTx,
TxMeta const &  transactionMeta 
)

Definition at line 48 of file DeliveredAmount.cpp.

◆ canHaveDeliveredAmountHelp()

template<class GetFix1623Enabled >
bool ripple::RPC::canHaveDeliveredAmountHelp ( GetFix1623Enabled const &  getFix1623Enabled,
std::shared_ptr< STTx const > const &  serializedTx,
TxMeta const &  transactionMeta 
)

Definition at line 88 of file DeliveredAmount.cpp.

◆ canHaveDeliveredAmount()

bool ripple::RPC::canHaveDeliveredAmount ( RPC::Context const &  context,
std::shared_ptr< STTx const > const &  serializedTx,
TxMeta const &  transactionMeta 
)

Definition at line 115 of file DeliveredAmount.cpp.

◆ getDeliveredAmount() [3/3]

template<class GetLedgerIndex >
static std::optional<STAmount> ripple::RPC::getDeliveredAmount ( RPC::Context const &  context,
std::shared_ptr< STTx const > const &  serializedTx,
TxMeta const &  transactionMeta,
GetLedgerIndex const &  getLedgerIndex 
)
static

Definition at line 178 of file DeliveredAmount.cpp.

◆ getHandler() [1/2]

Handler const* ripple::RPC::getHandler ( unsigned  version,
bool  betaEnabled,
std::string const &  name 
)

Definition at line 243 of file Handler.cpp.

◆ getHandlerNames()

std::vector< char const * > ripple::RPC::getHandlerNames ( )

Return names of all methods.

Definition at line 249 of file Handler.cpp.

◆ getHandler() [2/2]

Handler const* ripple::RPC::getHandler ( unsigned int  version,
bool  betaEnabled,
std::string const &   
)

◆ makeObjectValue()

template<class Value >
Json::Value ripple::RPC::makeObjectValue ( Value const &  value,
Json::StaticString const &  field = jss::message 
)

Return a Json::objectValue with a single entry.

Definition at line 63 of file Handler.h.

◆ conditionMet()

template<class T >
error_code_i ripple::RPC::conditionMet ( Condition  condition_required,
T &  context 
)

Definition at line 78 of file Handler.h.

◆ canHaveNFTokenID()

bool ripple::RPC::canHaveNFTokenID ( std::shared_ptr< STTx const > const &  serializedTx,
TxMeta const &  transactionMeta 
)

Add a nftoken_ids field to the meta output parameter.

The field is only added to successful NFTokenMint, NFTokenAcceptOffer, and NFTokenCancelOffer transactions.

Helper functions are not static because they can be used by Clio.

Definition at line 37 of file NFTokenID.cpp.

◆ getNFTokenIDFromPage()

std::optional< uint256 > ripple::RPC::getNFTokenIDFromPage ( TxMeta const &  transactionMeta)

Definition at line 57 of file NFTokenID.cpp.

◆ getNFTokenIDFromDeletedOffer()

std::vector< uint256 > ripple::RPC::getNFTokenIDFromDeletedOffer ( TxMeta const &  transactionMeta)

Definition at line 142 of file NFTokenID.cpp.

◆ insertNFTokenID()

void ripple::RPC::insertNFTokenID ( Json::Value response,
std::shared_ptr< STTx const > const &  transaction,
TxMeta const &  transactionMeta 
)

Definition at line 167 of file NFTokenID.cpp.

◆ canHaveNFTokenOfferID()

bool ripple::RPC::canHaveNFTokenOfferID ( std::shared_ptr< STTx const > const &  serializedTx,
TxMeta const &  transactionMeta 
)

Add an offer_id field to the meta output parameter.

The field is only added to successful NFTokenCreateOffer transactions.

Helper functions are not static because they can be used by Clio.

Definition at line 37 of file NFTokenOfferID.cpp.

◆ getOfferIDFromCreatedOffer()

std::optional< uint256 > ripple::RPC::getOfferIDFromCreatedOffer ( TxMeta const &  transactionMeta)

Definition at line 56 of file NFTokenOfferID.cpp.

◆ insertNFTokenOfferID()

void ripple::RPC::insertNFTokenOfferID ( Json::Value response,
std::shared_ptr< STTx const > const &  transaction,
TxMeta const &  transactionMeta 
)

Definition at line 70 of file NFTokenOfferID.cpp.

◆ insertNFTSyntheticInJson()

void ripple::RPC::insertNFTSyntheticInJson ( Json::Value response,
RPC::JsonContext const &  context,
std::shared_ptr< STTx const > const &  transaction,
TxMeta const &  transactionMeta 
)

Adds common synthetic fields to transaction-related JSON responses.

Definition at line 39 of file NFTSyntheticSerializer.cpp.

◆ injectReportingWarning()

void ripple::RPC::injectReportingWarning ( RPC::JsonContext context,
Json::Value result 
)

Definition at line 230 of file RPCHandler.cpp.

◆ doCommand()

Status ripple::RPC::doCommand ( RPC::JsonContext context,
Json::Value result 
)

Execute an RPC command and store the results in a Json::Value.

Definition at line 250 of file RPCHandler.cpp.

◆ roleRequired()

Role ripple::RPC::roleRequired ( unsigned int  version,
bool  betaEnabled,
std::string const &  method 
)

Definition at line 297 of file RPCHandler.cpp.

◆ accountFromStringStrict()

std::optional< AccountID > ripple::RPC::accountFromStringStrict ( std::string const &  account)

Get an AccountID from an account ID or public key.

Definition at line 42 of file RPCHelpers.cpp.

◆ accountFromStringWithCode()

error_code_i ripple::RPC::accountFromStringWithCode ( AccountID result,
std::string const &  strIdent,
bool  bStrict = false 
)

Decode account ID from string.

Parameters
[out]resultaccount ID decoded from string
strIdentpublic key, account ID, or regular seed.
bStrictOnly allow account id or public key.
Returns
code representing error, or rpcSUCCES on success

Definition at line 58 of file RPCHelpers.cpp.

◆ accountFromString()

Json::Value ripple::RPC::accountFromString ( AccountID result,
std::string const &  strIdent,
bool  bStrict 
)

Definition at line 86 of file RPCHelpers.cpp.

◆ getStartHint()

std::uint64_t ripple::RPC::getStartHint ( std::shared_ptr< SLE const > const &  sle,
AccountID const &  accountID 
)

Gets the start hint for traversing account objects.

Parameters
sle- Ledger entry defined by the marker passed into the RPC.
accountID- The ID of the account whose objects you are traversing.

Definition at line 96 of file RPCHelpers.cpp.

◆ isRelatedToAccount()

bool ripple::RPC::isRelatedToAccount ( ReadView const &  ledger,
std::shared_ptr< SLE const > const &  sle,
AccountID const &  accountID 
)

Tests if a SLE is owned by accountID.

Parameters
ledger- The ledger used to search for the sle.
sle- The SLE to test for ownership.
account- The account being tested for SLE ownership.

Definition at line 113 of file RPCHelpers.cpp.

◆ getAccountObjects()

bool ripple::RPC::getAccountObjects ( ReadView const &  ledger,
AccountID const &  account,
std::optional< std::vector< LedgerEntryType >> const &  typeFilter,
uint256  dirIndex,
uint256  entryIndex,
std::uint32_t const  limit,
Json::Value jvResult 
)

Gathers all objects for an account in a ledger.

Parameters
ledgerLedger to search account objects.
accountAccountID to find objects for.
typeFilterGathers objects of these types. empty gathers all types.
dirIndexBegin gathering account objects from this directory.
entryIndexBegin gathering objects from this directory node.
limitMaximum number of objects to find.
jvResultA JSON result that holds the request objects.

Definition at line 151 of file RPCHelpers.cpp.

◆ ledgerFromRequest() [1/4]

template<class T , class R >
Status ripple::RPC::ledgerFromRequest ( T &  ledger,
GRPCContext< R > &  context 
)

Definition at line 394 of file RPCHelpers.cpp.

◆ ledgerFromRequest() [2/4]

template Status ripple::RPC::ledgerFromRequest ( std::shared_ptr< ReadView const > &  ,
GRPCContext< org::xrpl::rpc::v1::GetLedgerEntryRequest > &   
)

◆ ledgerFromRequest() [3/4]

template Status ripple::RPC::ledgerFromRequest ( std::shared_ptr< ReadView const > &  ,
GRPCContext< org::xrpl::rpc::v1::GetLedgerDataRequest > &   
)

◆ ledgerFromRequest() [4/4]

template Status ripple::RPC::ledgerFromRequest ( std::shared_ptr< ReadView const > &  ,
GRPCContext< org::xrpl::rpc::v1::GetLedgerRequest > &   
)

◆ ledgerFromSpecifier()

template<class T >
Status ripple::RPC::ledgerFromSpecifier ( T &  ledger,
org::xrpl::rpc::v1::LedgerSpecifier const &  specifier,
Context context 
)

Definition at line 420 of file RPCHelpers.cpp.

◆ getLedger() [1/6]

template<class T >
Status ripple::RPC::getLedger ( T &  ledger,
uint256 const &  ledgerHash,
Context context 
)

Get ledger by hash If there is no error in the return value, the ledger pointer will have been filled.

Definition at line 479 of file RPCHelpers.cpp.

◆ getLedger() [2/6]

template<class T >
Status ripple::RPC::getLedger ( T &  ledger,
uint32_t  ledgerIndex,
Context context 
)

Get ledger by sequence If there is no error in the return value, the ledger pointer will have been filled.

Definition at line 489 of file RPCHelpers.cpp.

◆ getLedger() [3/6]

template<class T >
Status ripple::RPC::getLedger ( T &  ledger,
LedgerShortcut  shortcut,
Context context 
)

Get ledger specified in shortcut.

If there is no error in the return value, the ledger pointer will have been filled

Definition at line 520 of file RPCHelpers.cpp.

◆ getLedger() [4/6]

template Status ripple::RPC::getLedger ( std::shared_ptr< ReadView const > &  ,
uint32_t  ,
Context  
)

◆ getLedger() [5/6]

template Status ripple::RPC::getLedger ( std::shared_ptr< ReadView const > &  ,
LedgerShortcut  shortcut,
Context  
)

◆ getLedger() [6/6]

template Status ripple::RPC::getLedger ( std::shared_ptr< ReadView const > &  ,
uint256 const &  ,
Context  
)

◆ isValidated()

bool ripple::RPC::isValidated ( LedgerMaster ledgerMaster,
ReadView const &  ledger,
Application app 
)

Definition at line 603 of file RPCHelpers.cpp.

◆ lookupLedger() [1/2]

Status ripple::RPC::lookupLedger ( std::shared_ptr< ReadView const > &  ,
JsonContext ,
Json::Value result 
)

Look up a ledger from a request and fill a Json::Result with the data representing a ledger.

If the returned Status is OK, the ledger pointer will have been filled.

Definition at line 675 of file RPCHelpers.cpp.

◆ lookupLedger() [2/2]

Json::Value ripple::RPC::lookupLedger ( std::shared_ptr< ReadView const > &  ,
JsonContext  
)

Look up a ledger from a request and fill a Json::Result with either an error, or data representing a ledger.

If there is no error in the return value, then the ledger pointer will have been filled.

Definition at line 701 of file RPCHelpers.cpp.

◆ parseAccountIds()

hash_set< AccountID > ripple::RPC::parseAccountIds ( Json::Value const &  jvArray)

Definition at line 711 of file RPCHelpers.cpp.

◆ injectSLE()

void ripple::RPC::injectSLE ( Json::Value jv,
SLE const &  sle 
)

Inject JSON describing ledger entry.

Effects: Adds the JSON description of sle to jv.

If sle holds an account root, also adds the urlgravatar field JSON if sfEmailHash is present.

Definition at line 727 of file RPCHelpers.cpp.

◆ readLimitField()

std::optional< Json::Value > ripple::RPC::readLimitField ( unsigned int &  limit,
Tuning::LimitRange const &  ,
JsonContext const &   
)

Retrieve the limit value from a JsonContext, or set a default - then restrict the limit by max and min if not an ADMIN request.

If there is an error, return it as JSON.

Definition at line 752 of file RPCHelpers.cpp.

◆ parseRippleLibSeed()

std::optional< Seed > ripple::RPC::parseRippleLibSeed ( Json::Value const &  value)

Definition at line 771 of file RPCHelpers.cpp.

◆ getSeedFromRPC()

std::optional< Seed > ripple::RPC::getSeedFromRPC ( Json::Value const &  params,
Json::Value error 
)

Definition at line 790 of file RPCHelpers.cpp.

◆ keypairForSignature()

std::pair< PublicKey, SecretKey > ripple::RPC::keypairForSignature ( Json::Value const &  params,
Json::Value error 
)

Definition at line 849 of file RPCHelpers.cpp.

◆ chooseLedgerEntryType()

std::pair< RPC::Status, LedgerEntryType > ripple::RPC::chooseLedgerEntryType ( Json::Value const &  params)

Definition at line 979 of file RPCHelpers.cpp.

◆ getAPIVersionNumber()

unsigned int ripple::RPC::getAPIVersionNumber ( const Json::Value value,
bool  betaEnabled 
)

Retrieve the api version number from the json value.

Note that APIInvalidVersion will be returned if 1) the version number field has a wrong format 2) the version number retrieved is out of the supported range 3) the version number is unspecified and APIVersionIfUnspecified is out of the supported range

Parameters
valuea Json value that may or may not specifies the api version number
betaEnabledif the beta API version is enabled
Returns
the api version number

Definition at line 1033 of file RPCHelpers.cpp.

◆ getLedgerByContext()

std::variant< std::shared_ptr< Ledger const >, Json::Value > ripple::RPC::getLedgerByContext ( RPC::JsonContext context)

Return a ledger based on ledger_hash or ledger_index, or an RPC error.

Definition at line 1054 of file RPCHelpers.cpp.

◆ isHexTxID()

bool ripple::RPC::isHexTxID ( std::string const &  txid)

◆ setVersion()

template<class Object >
void ripple::RPC::setVersion ( Object &  parent,
unsigned int  apiVersion,
bool  betaEnabled 
)

Definition at line 253 of file RPCHelpers.h.

◆ checkFee()

Json::Value ripple::RPC::checkFee ( Json::Value request,
Role const  role,
bool  doAutoFill,
Config const &  config,
LoadFeeTrack const &  feeTrack,
TxQ const &  txQ,
Application const &  app 
)

Fill in the fee on behalf of the client.

This is called when the client does not explicitly specify the fee. The client may also put a ceiling on the amount of the fee. This ceiling is expressed as a multiplier based on the current ledger's fee schedule.

JSON fields

"Fee" The fee paid by the transaction. Omitted when the client wants the fee filled in.

"fee_mult_max" A multiplier applied to the current ledger's transaction fee that caps the maximum fee the server should auto fill. If this optional field is not specified, then a default multiplier is used. "fee_div_max" A divider applied to the current ledger's transaction fee that caps the maximum fee the server should auto fill. If this optional field is not specified, then a default divider (1) is used. "fee_mult_max" and "fee_div_max" are both used such that the maximum fee will be base * fee_mult_max / fee_div_max as an integer.

Parameters
txThe JSON corresponding to the transaction to fill in.
ledgerA ledger for retrieving the current fee schedule.
rollIdentifies if this is called by an administrative endpoint.
Returns
A JSON object containing the error results, if any

Definition at line 666 of file TransactionSign.cpp.

◆ transactionSign()

Json::Value ripple::RPC::transactionSign ( Json::Value  jvRequest,
NetworkOPs::FailHard  failType,
Role  role,
std::chrono::seconds  validatedLedgerAge,
Application app 
)

Returns a Json::objectValue.

Definition at line 762 of file TransactionSign.cpp.

◆ transactionSubmit()

Json::Value ripple::RPC::transactionSubmit ( Json::Value  jvRequest,
NetworkOPs::FailHard  failType,
Role  role,
std::chrono::seconds  validatedLedgerAge,
Application app,
ProcessTransactionFn const &  processTransaction 
)

Returns a Json::objectValue.

Definition at line 799 of file TransactionSign.cpp.

◆ transactionSignFor()

Json::Value ripple::RPC::transactionSignFor ( Json::Value  jvRequest,
NetworkOPs::FailHard  failType,
Role  role,
std::chrono::seconds  validatedLedgerAge,
Application app 
)

Returns a Json::objectValue.

Definition at line 928 of file TransactionSign.cpp.

◆ transactionSubmitMultiSigned()

Json::Value ripple::RPC::transactionSubmitMultiSigned ( Json::Value  jvRequest,
NetworkOPs::FailHard  failType,
Role  role,
std::chrono::seconds  validatedLedgerAge,
Application app,
ProcessTransactionFn const &  processTransaction 
)

Returns a Json::objectValue.

Definition at line 1035 of file TransactionSign.cpp.

◆ getProcessTxnFn()

ProcessTransactionFn ripple::RPC::getProcessTxnFn ( NetworkOPs netOPs)

Definition at line 82 of file TransactionSign.h.

◆ stringOutput()

Output ripple::RPC::stringOutput ( std::string s)

Definition at line 31 of file rpc/Output.h.

◆ BEAST_DEFINE_TESTSUITE() [1/6]

ripple::RPC::BEAST_DEFINE_TESTSUITE ( AccountLinesRPC  ,
app  ,
ripple   
)

◆ BEAST_DEFINE_TESTSUITE() [2/6]

ripple::RPC::BEAST_DEFINE_TESTSUITE ( JSONRPC  ,
ripple_app  ,
ripple   
)

◆ BEAST_DEFINE_TESTSUITE() [3/6]

ripple::RPC::BEAST_DEFINE_TESTSUITE ( WalletPropose  ,
ripple_basics  ,
ripple   
)

◆ BEAST_DEFINE_TESTSUITE() [4/6]

ripple::RPC::BEAST_DEFINE_TESTSUITE ( LedgerRequestRPC  ,
app  ,
ripple   
)

◆ BEAST_DEFINE_TESTSUITE() [5/6]

ripple::RPC::BEAST_DEFINE_TESTSUITE ( codeString  ,
Status  ,
RPC   
)

◆ BEAST_DEFINE_TESTSUITE() [6/6]

ripple::RPC::BEAST_DEFINE_TESTSUITE ( fillJson  ,
Status  ,
RPC   
)

Variable Documentation

◆ firstVersion

const beast::SemanticVersion ripple::RPC::firstVersion

API version numbers used in API version 1.

Definition at line 215 of file RPCHelpers.h.

◆ goodVersion

const beast::SemanticVersion ripple::RPC::goodVersion

Definition at line 216 of file RPCHelpers.h.

◆ lastVersion

const beast::SemanticVersion ripple::RPC::lastVersion

Definition at line 217 of file RPCHelpers.h.

◆ apiInvalidVersion

constexpr unsigned int ripple::RPC::apiInvalidVersion = 0
constexpr

API version numbers used in later API versions.

Requests with a version number in the range [apiMinimumSupportedVersion, apiMaximumSupportedVersion] are supported.

If [beta_rpc_api] is enabled in config, the version numbers in the range [apiMinimumSupportedVersion, apiBetaVersion] are supported.

Network Requests without explicit version numbers use apiVersionIfUnspecified. apiVersionIfUnspecified is 1, because all the RPC requests with a version >= 2 must explicitly specify the version in the requests. Note that apiVersionIfUnspecified will be lower than apiMinimumSupportedVersion when we stop supporting API version 1.

Command line Requests use apiMaximumSupportedVersion.

Definition at line 241 of file RPCHelpers.h.

◆ apiVersionIfUnspecified

constexpr unsigned int ripple::RPC::apiVersionIfUnspecified = 1
constexpr

Definition at line 242 of file RPCHelpers.h.

◆ apiMinimumSupportedVersion

constexpr unsigned int ripple::RPC::apiMinimumSupportedVersion = 1
constexpr

Definition at line 243 of file RPCHelpers.h.

◆ apiMaximumSupportedVersion

constexpr unsigned int ripple::RPC::apiMaximumSupportedVersion = 1
constexpr

Definition at line 244 of file RPCHelpers.h.

◆ apiBetaVersion

constexpr unsigned int ripple::RPC::apiBetaVersion = 2
constexpr

Definition at line 245 of file RPCHelpers.h.

◆ txnTestArray

constexpr TxnTestData ripple::RPC::txnTestArray[]
staticconstexpr

Definition at line 70 of file JSONRPC_test.cpp.

◆ secp256k1_strings

const key_strings ripple::RPC::secp256k1_strings
static
Initial value:
= {
"r4Vtj2jrfmTVZGfSP3gH9hQPMqFPQFin8f",
common::master_key,
common::master_seed,
common::master_seed_hex,
"aBQxK2YFNqzmAaXNczYcjqDjfiKkLsJUizsr1UBf44RCF8FHdrmX",
"038AAE247B2344B1837FBED8F57389C8C11774510A3F7D784F2A09F0CB6843236C",
"1949ECD889EA71324BC7A30C8E81F4E93CB73EE19D59E9082111E78CC3DDABC2",
common::passphrase,
"This wallet was generated using a user-supplied "
"passphrase that has low entropy and is vulnerable "
"to brute-force attacks.",
}

Definition at line 54 of file KeyGeneration_test.cpp.

◆ ed25519_strings

const key_strings ripple::RPC::ed25519_strings
static
Initial value:
= {
"r4qV6xTXerqaZav3MJfSY79ynmc1BSBev1",
common::master_key,
common::master_seed,
common::master_seed_hex,
"aKEQmgLMyZPMruJFejUuedp169LgW6DbJt1rej1DJ5hWUMH4pHJ7",
"ED54C3F5BEDA8BD588B203D23A27398FAD9D20F88A974007D6994659CD7273FE1D",
"77AAED2698D56D6676323629160F4EEF21CFD9EE3D0745CC78FA291461F98278",
common::passphrase,
"This wallet was generated using a user-supplied "
"passphrase that has low entropy and is vulnerable "
"to brute-force attacks.",
}

Definition at line 68 of file KeyGeneration_test.cpp.

◆ strong_brain_strings

const key_strings ripple::RPC::strong_brain_strings
static
Initial value:
= {
"rBcvXmNb7KPkNdMkpckdWPpbvkWgcV3nir",
"TED AVON CAVE HOUR BRAG JEFF RIFT NEAL TOLD FAT SEW SAN",
"shKdhWka8hS7Es3bpctCZXBiAwfUN",
"74BA8389B44F98CF41E795CD91F9C93F",
"aBRL2sqVuzrsM6zikPB4v8UBHGn1aKkrsxhYEffhcQxB2LKyywE5",
"03BD334FB9E06C58D69603E9922686528B18A754BC2F2E1ADA095FFE67DE952C64",
"84262FB16AA25BE407174C7EDAB531220C30FA4D8A28AA9D564673FB3D34502C",
"A4yKIRGdzrw0YQ$2%TFKYG9HP*&ok^!sy7E@RwICs",
"This wallet was generated using a user-supplied "
"passphrase. It may be vulnerable to brute-force "
"attacks.",
}

Definition at line 82 of file KeyGeneration_test.cpp.