rippled
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
xrpl::RPC Namespace Reference

API version numbers used in later API versions. More...

Namespaces

namespace  common
 
namespace  detail
 
namespace  Tuning
 Tuned constants.
 

Classes

class  AccountLines_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  LedgerRequest_test
 
class  LegacyPathFind
 
struct  Request
 
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 = 1 << 1 , NEEDS_CLOSED_LEDGER = 1 << 2 }
 

Functions

void setVersion (Json::Value &parent, unsigned int apiVersion, bool betaEnabled)
 
unsigned int getAPIVersionNumber (Json::Value const &jv, bool betaEnabled)
 Retrieve the api version number from the json value.
 
ErrorInfo const & get_error_info (error_code_i code)
 Returns an ErrorInfo that reflects the error code.
 
bool contains_error (Json::Value const &json)
 Returns true if the json contains an rpc error specification.
 
int error_code_http_status (error_code_i code)
 Returns http status that corresponds to the error code.
 
 BEAST_DEFINE_TESTSUITE (AccountLines, rpc, xrpl)
 
 BEAST_DEFINE_TESTSUITE (JSONRPC, rpc, xrpl)
 
 BEAST_DEFINE_TESTSUITE (WalletPropose, rpc, xrpl)
 
 BEAST_DEFINE_TESTSUITE (LedgerRequest, rpc, xrpl)
 
 BEAST_DEFINE_TESTSUITE (codeString, rpc, RPC)
 
 BEAST_DEFINE_TESTSUITE (fillJson, rpc, RPC)
 
template<class L >
Json::Value computeBookChanges (std::shared_ptr< L const > const &lpAccepted)
 
std::optional< std::stringencodeCTID (uint32_t ledgerSeq, uint32_t txnIndex, uint32_t networkID) noexcept
 Encodes ledger sequence, transaction index, and network ID into a CTID string.
 
template<typename T >
std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > decodeCTID (T const ctid) noexcept
 Decodes a CTID string or integer into its component parts.
 
template<class GetLedgerIndex , class GetCloseTime >
std::optional< STAmountgetDeliveredAmount (GetLedgerIndex const &getLedgerIndex, GetCloseTime const &getCloseTime, std::shared_ptr< STTx const > const &serializedTx, TxMeta const &transactionMeta)
 
bool canHaveDeliveredAmount (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::set< char const * > getHandlerNames ()
 Return names of all methods.
 
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.
 
template<class T >
error_code_i conditionMet (Condition condition_required, T &context)
 
Status doCommand (RPC::JsonContext &, Json::Value &)
 Execute an RPC command and store the results in a Json::Value.
 
Role roleRequired (unsigned int version, bool betaEnabled, std::string const &method)
 
std::uint64_t getStartHint (std::shared_ptr< SLE const > const &sle, AccountID const &accountID)
 Gets the start hint for traversing account objects.
 
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.
 
hash_set< AccountIDparseAccountIds (Json::Value const &jvArray)
 Parses an array of account IDs from a JSON value.
 
std::optional< Json::ValuereadLimitField (unsigned int &limit, Tuning::LimitRange const &range, JsonContext const &context)
 Retrieves the limit value from a JsonContext or sets a default.
 
std::optional< SeedparseRippleLibSeed (Json::Value const &params)
 Parses a RippleLib seed from RPC parameters.
 
std::optional< SeedgetSeedFromRPC (Json::Value const &params, Json::Value &error)
 Extracts a Seed from RPC parameters.
 
std::optional< std::pair< PublicKey, SecretKey > > keypairForSignature (Json::Value const &params, Json::Value &error, unsigned int apiVersion=apiVersionIfUnspecified)
 Generates a keypair for signature from RPC parameters.
 
std::pair< RPC::Status, LedgerEntryTypechooseLedgerEntryType (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.
 
template<class T , class R >
Status ledgerFromRequest (T &ledger, GRPCContext< R > const &context)
 Retrieves a ledger from a gRPC request context.
 
template Status ledgerFromRequest (std::shared_ptr< ReadView const > &, GRPCContext< org::xrpl::rpc::v1::GetLedgerEntryRequest > const &)
 
template Status ledgerFromRequest (std::shared_ptr< ReadView const > &, GRPCContext< org::xrpl::rpc::v1::GetLedgerDataRequest > const &)
 
template Status ledgerFromRequest (std::shared_ptr< ReadView const > &, GRPCContext< org::xrpl::rpc::v1::GetLedgerRequest > const &)
 
template<class T >
Status ledgerFromSpecifier (T &ledger, org::xrpl::rpc::v1::LedgerSpecifier const &specifier, Context const &context)
 Retrieves a ledger based on a LedgerSpecifier.
 
template<class T >
Status getLedger (T &ledger, uint256 const &ledgerHash, Context const &context)
 Retrieves a ledger by its hash.
 
template<class T >
Status getLedger (T &ledger, uint32_t ledgerIndex, Context const &context)
 Retrieves a ledger by its sequence index.
 
template<class T >
Status getLedger (T &ledger, LedgerShortcut shortcut, Context const &context)
 Retrieves a ledger specified by a LedgerShortcut.
 
template Status getLedger (std::shared_ptr< ReadView const > &, uint32_t, Context const &)
 
template Status getLedger (std::shared_ptr< ReadView const > &, LedgerShortcut shortcut, Context const &)
 
template Status getLedger (std::shared_ptr< ReadView const > &, uint256 const &, Context const &)
 
Status lookupLedger (std::shared_ptr< ReadView const > &, JsonContext const &, Json::Value &result)
 Looks up a ledger from a request and fills a Json::Value with ledger data.
 
Json::Value lookupLedger (std::shared_ptr< ReadView const > &, JsonContext const &)
 Looks up a ledger from a request and returns a Json::Value with either an error or ledger data.
 
Expected< std::shared_ptr< Ledger const >, Json::ValuegetOrAcquireLedger (RPC::JsonContext const &context)
 Retrieves or acquires a ledger based on the parameters provided in the given JsonContext.
 
static XRPAmount getTxFee (Application const &app, Config const &config, Json::Value tx)
 
Json::Value getCurrentNetworkFee (Role const role, Config const &config, LoadFeeTrack const &feeTrack, TxQ const &txQ, Application const &app, Json::Value const &tx, int mult, int div)
 
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.
 
Json::Value transactionSign (Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
 Returns a Json::objectValue.
 
Json::Value transactionSubmit (Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
 Returns a Json::objectValue.
 
Json::Value transactionSignFor (Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app)
 Returns a Json::objectValue.
 
Json::Value transactionSubmitMultiSigned (Json::Value jvRequest, unsigned apiVersion, NetworkOPs::FailHard failType, Role role, std::chrono::seconds validatedLedgerAge, Application &app, ProcessTransactionFn const &processTransaction)
 Returns a Json::objectValue.
 
ProcessTransactionFn getProcessTxnFn (NetworkOPs &netOPs)
 
Output stringOutput (std::string &s)
 
void inject_error (error_code_i code, Json::Value &json)
 Add or update the json update to reflect the error code.
 
void inject_error (error_code_i code, std::string const &message, Json::Value &json)
 
Json::Value make_error (error_code_i code)
 Returns a new json object that reflects the error code.
 
Json::Value make_error (error_code_i code, std::string const &message)
 
Json::Value make_param_error (std::string const &message)
 Returns a new json object that indicates invalid parameters.
 
std::string missing_field_message (std::string const &name)
 
Json::Value missing_field_error (std::string const &name)
 
Json::Value missing_field_error (Json::StaticString name)
 
std::string object_field_message (std::string const &name)
 
Json::Value object_field_error (std::string const &name)
 
Json::Value object_field_error (Json::StaticString name)
 
std::string invalid_field_message (std::string const &name)
 
std::string invalid_field_message (Json::StaticString name)
 
Json::Value invalid_field_error (std::string const &name)
 
Json::Value invalid_field_error (Json::StaticString name)
 
std::string expected_field_message (std::string const &name, std::string const &type)
 
std::string expected_field_message (Json::StaticString name, std::string const &type)
 
Json::Value expected_field_error (std::string const &name, std::string const &type)
 
Json::Value expected_field_error (Json::StaticString name, std::string const &type)
 
Json::Value not_validator_error ()
 
void insertNFTSyntheticInJson (Json::Value &, std::shared_ptr< STTx const > const &, TxMeta const &)
 Adds common synthetic fields to transaction-related JSON responses.
 
void insertDeliverMax (Json::Value &tx_json, TxType txnType, unsigned int apiVersion)
 Copy Amount field to DeliverMax field in transaction output JSON.
 
void insertDeliveredAmount (Json::Value &meta, ReadView const &, std::shared_ptr< STTx const > const &serializedTx, TxMeta const &)
 Add a delivered_amount field to the meta input/output parameter.
 
void insertDeliveredAmount (Json::Value &meta, RPC::JsonContext const &, std::shared_ptr< Transaction > const &, TxMeta const &)
 
void insertDeliveredAmount (Json::Value &meta, RPC::JsonContext const &, std::shared_ptr< STTx const > const &, TxMeta const &)
 
std::optional< STAmountgetDeliveredAmount (RPC::Context const &context, std::shared_ptr< STTx const > const &serializedTx, TxMeta const &transactionMeta, LedgerIndex const &ledgerIndex)
 
bool canHaveMPTokenIssuanceID (std::shared_ptr< STTx const > const &serializedTx, TxMeta const &transactionMeta)
 Add a mpt_issuance_id field to the meta input/output parameter.
 
std::optional< uint192getIDFromCreatedIssuance (TxMeta const &transactionMeta)
 
void insertMPTokenIssuanceID (Json::Value &response, std::shared_ptr< STTx const > const &transaction, TxMeta const &transactionMeta)
 

Variables

template<unsigned int Version>
static constexpr std::integral_constant< unsigned, Version > apiVersion = {}
 
static constexpr auto apiInvalidVersion = apiVersion<0>
 
static constexpr auto apiMinimumSupportedVersion = apiVersion<1>
 
static constexpr auto apiMaximumSupportedVersion = apiVersion<2>
 
static constexpr auto apiVersionIfUnspecified = apiVersion<1>
 
static constexpr auto apiCommandLineVersion = apiVersion<1>
 
static constexpr auto apiBetaVersion = apiVersion<3>
 
static constexpr auto apiMaximumValidVersion = apiBetaVersion
 
static constexpr TxnTestData txnTestArray []
 
static key_strings const secp256k1_strings
 
static key_strings const ed25519_strings
 
static key_strings const strong_brain_strings
 

Detailed Description

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 apiCommandLineVersion.

Typedef Documentation

◆ ProcessTransactionFn

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

Definition at line 68 of file TransactionSign.h.

◆ Output

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

Definition at line 8 of file src/xrpld/rpc/Output.h.

Enumeration Type Documentation

◆ Condition

Enumerator
NO_CONDITION 
NEEDS_NETWORK_CONNECTION 
NEEDS_CURRENT_LEDGER 
NEEDS_CLOSED_LEDGER 

Definition at line 19 of file Handler.h.

Function Documentation

◆ setVersion()

void xrpl::RPC::setVersion ( Json::Value parent,
unsigned int  apiVersion,
bool  betaEnabled 
)

Definition at line 58 of file ApiVersion.h.

◆ getAPIVersionNumber()

unsigned int xrpl::RPC::getAPIVersionNumber ( Json::Value const &  jv,
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
jva Json value that may or may not specify the api version number
betaEnabledif the beta API version is enabled
Returns
the api version number

Definition at line 97 of file ApiVersion.h.

◆ get_error_info()

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

Returns an ErrorInfo that reflects the error code.

Definition at line 182 of file ErrorCodes.cpp.

◆ inject_error() [1/2]

void xrpl::RPC::inject_error ( error_code_i  code,
Json::Value json 
)

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

Definition at line 164 of file ErrorCodes.cpp.

◆ inject_error() [2/2]

void xrpl::RPC::inject_error ( error_code_i  code,
std::string const &  message,
Json::Value json 
)

Definition at line 173 of file ErrorCodes.cpp.

◆ make_error() [1/2]

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

Returns a new json object that reflects the error code.

Definition at line 190 of file ErrorCodes.cpp.

◆ make_error() [2/2]

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

Definition at line 198 of file ErrorCodes.cpp.

◆ make_param_error()

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

Returns a new json object that indicates invalid parameters.

Definition at line 214 of file ErrorCodes.h.

◆ missing_field_message()

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

Definition at line 220 of file ErrorCodes.h.

◆ missing_field_error() [1/2]

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

Definition at line 226 of file ErrorCodes.h.

◆ missing_field_error() [2/2]

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

Definition at line 232 of file ErrorCodes.h.

◆ object_field_message()

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

Definition at line 238 of file ErrorCodes.h.

◆ object_field_error() [1/2]

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

Definition at line 244 of file ErrorCodes.h.

◆ object_field_error() [2/2]

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

Definition at line 250 of file ErrorCodes.h.

◆ invalid_field_message() [1/2]

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

Definition at line 256 of file ErrorCodes.h.

◆ invalid_field_message() [2/2]

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

Definition at line 262 of file ErrorCodes.h.

◆ invalid_field_error() [1/2]

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

Definition at line 268 of file ErrorCodes.h.

◆ invalid_field_error() [2/2]

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

Definition at line 274 of file ErrorCodes.h.

◆ expected_field_message() [1/2]

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

Definition at line 280 of file ErrorCodes.h.

◆ expected_field_message() [2/2]

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

Definition at line 286 of file ErrorCodes.h.

◆ expected_field_error() [1/2]

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

Definition at line 292 of file ErrorCodes.h.

◆ expected_field_error() [2/2]

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

Definition at line 298 of file ErrorCodes.h.

◆ not_validator_error()

Json::Value xrpl::RPC::not_validator_error ( )

Definition at line 304 of file ErrorCodes.h.

◆ contains_error()

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

Returns true if the json contains an rpc error specification.

Definition at line 206 of file ErrorCodes.cpp.

◆ error_code_http_status()

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

Returns http status that corresponds to the error code.

Definition at line 214 of file ErrorCodes.cpp.

◆ insertNFTSyntheticInJson()

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

Adds common synthetic fields to transaction-related JSON responses.

Definition at line 15 of file NFTSyntheticSerializer.cpp.

◆ BEAST_DEFINE_TESTSUITE() [1/6]

xrpl::RPC::BEAST_DEFINE_TESTSUITE ( AccountLines  ,
rpc  ,
xrpl   
)

◆ BEAST_DEFINE_TESTSUITE() [2/6]

xrpl::RPC::BEAST_DEFINE_TESTSUITE ( JSONRPC  ,
rpc  ,
xrpl   
)

◆ BEAST_DEFINE_TESTSUITE() [3/6]

xrpl::RPC::BEAST_DEFINE_TESTSUITE ( WalletPropose  ,
rpc  ,
xrpl   
)

◆ BEAST_DEFINE_TESTSUITE() [4/6]

xrpl::RPC::BEAST_DEFINE_TESTSUITE ( LedgerRequest  ,
rpc  ,
xrpl   
)

◆ BEAST_DEFINE_TESTSUITE() [5/6]

xrpl::RPC::BEAST_DEFINE_TESTSUITE ( codeString  ,
rpc  ,
RPC   
)

◆ BEAST_DEFINE_TESTSUITE() [6/6]

xrpl::RPC::BEAST_DEFINE_TESTSUITE ( fillJson  ,
rpc  ,
RPC   
)

◆ insertDeliverMax()

void xrpl::RPC::insertDeliverMax ( Json::Value tx_json,
TxType  txnType,
unsigned int  apiVersion 
)

Copy Amount field to DeliverMax field in transaction output JSON.

This only applies to Payment transaction type, all others are ignored.

When apiVersion > 1 will also remove Amount field, forcing users to access this value using new DeliverMax field only.

Definition at line 9 of file DeliverMax.cpp.

◆ computeBookChanges()

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

Definition at line 27 of file BookChanges.h.

◆ encodeCTID()

std::optional< std::string > xrpl::RPC::encodeCTID ( uint32_t  ledgerSeq,
uint32_t  txnIndex,
uint32_t  networkID 
)
noexcept

Encodes ledger sequence, transaction index, and network ID into a CTID string.

Parameters
ledgerSeqLedger sequence number (max 0x0FFF'FFFF).
txnIndexTransaction index within the ledger (max 0xFFFF).
networkIDNetwork identifier (max 0xFFFF).
Returns
Optional CTID string in uppercase hexadecimal, or std::nullopt if inputs are out of range.

Definition at line 33 of file CTID.h.

◆ decodeCTID()

template<typename T >
std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > xrpl::RPC::decodeCTID ( T const  ctid)
noexcept

Decodes a CTID string or integer into its component parts.

Template Parameters
TType of the CTID input (string, string_view, char*, integral).
Parameters
ctidCTID value to decode.
Returns
Optional tuple of (ledgerSeq, txnIndex, networkID), or std::nullopt if invalid.

Definition at line 60 of file CTID.h.

◆ insertDeliveredAmount() [1/3]

void xrpl::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 81 of file DeliveredAmount.cpp.

◆ insertDeliveredAmount() [2/3]

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

Definition at line 138 of file DeliveredAmount.cpp.

◆ insertDeliveredAmount() [3/3]

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

Definition at line 148 of file DeliveredAmount.cpp.

◆ getDeliveredAmount() [1/3]

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

Definition at line 128 of file DeliveredAmount.cpp.

◆ getDeliveredAmount() [2/3]

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

Definition at line 25 of file DeliveredAmount.cpp.

◆ canHaveDeliveredAmount()

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

Definition at line 63 of file DeliveredAmount.cpp.

◆ getDeliveredAmount() [3/3]

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

Definition at line 110 of file DeliveredAmount.cpp.

◆ getHandler() [1/2]

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

Definition at line 236 of file Handler.cpp.

◆ getHandlerNames()

std::set< char const * > xrpl::RPC::getHandlerNames ( )

Return names of all methods.

Definition at line 242 of file Handler.cpp.

◆ getHandler() [2/2]

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

◆ makeObjectValue()

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

Return a Json::objectValue with a single entry.

Definition at line 46 of file Handler.h.

◆ conditionMet()

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

Definition at line 59 of file Handler.h.

◆ canHaveMPTokenIssuanceID()

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

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

The field is only added to successful MPTokenIssuanceCreate transactions. The mpt_issuance_id is parsed from the sequence and the issuer in the MPTokenIssuance object.

Definition at line 8 of file MPTokenIssuanceID.cpp.

◆ getIDFromCreatedIssuance()

std::optional< uint192 > xrpl::RPC::getIDFromCreatedIssuance ( TxMeta const &  transactionMeta)

Definition at line 25 of file MPTokenIssuanceID.cpp.

◆ insertMPTokenIssuanceID()

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

Definition at line 40 of file MPTokenIssuanceID.cpp.

◆ doCommand()

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

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

Definition at line 192 of file RPCHandler.cpp.

◆ roleRequired()

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

Definition at line 226 of file RPCHandler.cpp.

◆ getStartHint()

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

Gets the start hint for traversing account objects.

This function retrieves a hint value from the specified ledger entry (SLE) that can be used to optimize traversal of account objects for the given account ID.

Parameters
sleShared pointer to the ledger entry (SLE) defined by the marker passed into the RPC.
accountIDThe ID of the account whose objects are being traversed.
Returns
A 64-bit unsigned integer representing the start hint for traversal.

Definition at line 22 of file RPCHelpers.cpp.

◆ isRelatedToAccount()

bool xrpl::RPC::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.

Determines whether the given SLE is related to or owned by the provided account ID within the context of the specified ledger.

Parameters
ledgerThe ledger view used to search for the SLE.
sleShared pointer to the SLE to test for ownership.
accountIDThe account being tested for SLE ownership.
Returns
true if the SLE is owned by the account, false otherwise.

Definition at line 39 of file RPCHelpers.cpp.

◆ parseAccountIds()

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

Parses an array of account IDs from a JSON value.

Extracts and returns a set of AccountID objects from the provided JSON array.

Parameters
jvArrayThe JSON value containing an array of account IDs.
Returns
A hash_set containing the parsed AccountID objects.

Definition at line 73 of file RPCHelpers.cpp.

◆ readLimitField()

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

Retrieves the limit value from a JsonContext or sets a default.

Reads the "limit" field from the given JsonContext, applies default, minimum, and maximum constraints as appropriate, and returns an error as JSON if validation fails.

Parameters
limitReference to the variable where the limit value will be stored.
rangeThe allowed range for the limit value.
contextThe JSON context from which to read the limit.
Returns
An optional JSON value containing an error if one occurred, or std::nullopt on success.

Definition at line 89 of file RPCHelpers.cpp.

◆ parseRippleLibSeed()

std::optional< Seed > xrpl::RPC::parseRippleLibSeed ( Json::Value const &  params)

Parses a RippleLib seed from RPC parameters.

Attempts to extract and return a Seed from the provided JSON parameters using RippleLib conventions.

Parameters
paramsThe JSON value containing RPC parameters.
Returns
An optional Seed if parsing is successful, or std::nullopt otherwise.

Definition at line 110 of file RPCHelpers.cpp.

◆ getSeedFromRPC()

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

Extracts a Seed from RPC parameters.

Attempts to parse and return a Seed from the provided JSON RPC parameters. If parsing fails, an error is set in the provided error JSON value.

Parameters
paramsThe JSON value containing RPC parameters.
errorReference to a JSON value to be set with error information if parsing fails.
Returns
An optional Seed if parsing is successful, or std::nullopt otherwise.

Definition at line 128 of file RPCHelpers.cpp.

◆ keypairForSignature()

std::optional< std::pair< PublicKey, SecretKey > > xrpl::RPC::keypairForSignature ( Json::Value const &  params,
Json::Value error,
unsigned int  apiVersion = apiVersionIfUnspecified 
)

Generates a keypair for signature from RPC parameters.

Attempts to derive a public and secret key pair from the provided JSON RPC parameters. If an error occurs, it is set in the provided error JSON value.

Parameters
paramsThe JSON value containing RPC parameters.
errorReference to a JSON value to be set with error information if keypair generation fails.
apiVersionThe API version to use for keypair derivation (defaults to apiVersionIfUnspecified).
Returns
An optional pair containing the public and secret keys if successful, or std::nullopt otherwise.

Definition at line 183 of file RPCHelpers.cpp.

◆ chooseLedgerEntryType()

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

Chooses the ledger entry type based on RPC parameters.

Determines the appropriate LedgerEntryType to use based on the provided JSON parameters, and returns a pair containing the RPC status and the selected type.

Parameters
paramsThe JSON value containing RPC parameters.
Returns
A pair consisting of the RPC status and the chosen LedgerEntryType.

Definition at line 308 of file RPCHelpers.cpp.

◆ isAccountObjectsValidType()

bool xrpl::RPC::isAccountObjectsValidType ( LedgerEntryType const &  type)

Checks if the type is a valid filtering type for the account_objects method.

Determines whether the specified LedgerEntryType is valid for filtering in the account_objects RPC method. Types such as Amendments, DirectoryNode, FeeSettings, and LedgerHashes are not considered valid as they cannot be owned by an account.

Parameters
typeThe ledger entry type to check.
Returns
true if the type is valid for account_objects filtering, false otherwise.

Definition at line 357 of file RPCHelpers.cpp.

◆ ledgerFromRequest() [1/4]

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

Retrieves a ledger from a gRPC request context.

This function attempts to find and fill the provided ledger pointer based on the parameters in the given gRPC context. On success, the ledger pointer is filled.

Template Parameters
TType of the ledger pointer to be filled.
RType of the gRPC request.
Parameters
ledgerReference to the ledger pointer to be filled.
contextThe gRPC context containing request parameters and environment.
Returns
Status indicating success or failure of the operation.

Definition at line 122 of file RPCLedgerHelpers.cpp.

◆ ledgerFromRequest() [2/4]

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

◆ ledgerFromRequest() [3/4]

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

◆ ledgerFromRequest() [4/4]

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

◆ ledgerFromSpecifier()

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

Retrieves a ledger based on a LedgerSpecifier.

This function attempts to find and fill the provided ledger pointer based on the specified LedgerSpecifier. On success, the ledger pointer is filled.

Template Parameters
TType of the ledger pointer to be filled.
Parameters
ledgerReference to the ledger pointer to be filled.
specifierThe LedgerSpecifier describing which ledger to retrieve.
contextThe RPC context containing request parameters and environment.
Returns
Status indicating success or failure of the operation.

Definition at line 142 of file RPCLedgerHelpers.cpp.

◆ getLedger() [1/6]

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

Retrieves a ledger by its hash.

This function attempts to find and fill the provided ledger pointer with the ledger corresponding to the specified hash. If the operation is successful, the ledger pointer will be set; otherwise, an error status is returned.

Template Parameters
TType of the ledger pointer to be filled.
Parameters
ledgerReference to the ledger pointer to be filled.
ledgerHashThe hash of the ledger to retrieve.
contextThe RPC context containing request parameters and environment.
Returns
Status indicating success or failure of the operation.

Definition at line 187 of file RPCLedgerHelpers.cpp.

◆ getLedger() [2/6]

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

Retrieves a ledger by its sequence index.

This function attempts to find and fill the provided ledger pointer with the ledger corresponding to the specified sequence index. If the operation is successful, the ledger pointer will be set; otherwise, an error status is returned.

Template Parameters
TType of the ledger pointer to be filled.
Parameters
ledgerReference to the ledger pointer to be filled.
ledgerIndexThe sequence index of the ledger to retrieve.
contextThe RPC context containing request parameters and environment.
Returns
Status indicating success or failure of the operation.

Definition at line 197 of file RPCLedgerHelpers.cpp.

◆ getLedger() [3/6]

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

Retrieves a ledger specified by a LedgerShortcut.

This function attempts to find and fill the provided ledger pointer with the ledger corresponding to the specified shortcut. If the operation is successful, the ledger pointer will be set; otherwise, an error status is returned.

Template Parameters
TType of the ledger pointer to be filled.
Parameters
ledgerReference to the ledger pointer to be filled.
shortcutThe shortcut specifying which ledger to retrieve.
contextThe RPC context containing request parameters and environment.
Returns
Status indicating success or failure of the operation.

Definition at line 226 of file RPCLedgerHelpers.cpp.

◆ getLedger() [4/6]

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

◆ getLedger() [5/6]

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

◆ getLedger() [6/6]

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

◆ lookupLedger() [1/2]

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

Looks up a ledger from a request and fills a Json::Value with ledger data.

This function attempts to find a ledger based on the parameters in the given JsonContext. On success, the ledger pointer is filled and the result parameter is populated with ledger data. On failure, an error status is returned.

Parameters
ledgerReference to a shared pointer to the ledger to be filled.
contextThe RPC JsonContext containing request parameters and environment.
resultReference to a Json::Value to be filled with ledger data.
Returns
Status indicating success or failure of the operation.

Definition at line 314 of file RPCLedgerHelpers.cpp.

◆ lookupLedger() [2/2]

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

Looks up a ledger from a request and returns a Json::Value with either an error or ledger data.

This function attempts to find a ledger based on the parameters in the given JsonContext. On success, the ledger pointer is filled and a Json::Value representing the ledger is returned. On failure, a Json::Value describing the error is returned.

Parameters
ledgerReference to a shared pointer to the ledger to be filled.
contextThe RPC JsonContext containing request parameters and environment.
Returns
Json::Value containing either the ledger data or an error description.

Definition at line 336 of file RPCLedgerHelpers.cpp.

◆ getOrAcquireLedger()

Expected< std::shared_ptr< Ledger const >, Json::Value > xrpl::RPC::getOrAcquireLedger ( RPC::JsonContext const &  context)

Retrieves or acquires a ledger based on the parameters provided in the given JsonContext.

This function differs from the other ledger getter functions in this file in that it attempts to either retrieve an existing ledger or acquire it if it is not already available, based on the context of the RPC request. It returns an Expected containing either a shared pointer to the requested immutable Ledger object or a Json::Value describing an error. Unlike the other getLedger or lookupLedger functions, which typically fill a provided ledger pointer or result object and return a Status, this function encapsulates both the result and error in a single return value, making it easier to handle success and failure cases in a unified way.

Parameters
contextThe RPC JsonContext containing request parameters and environment.
Returns
Expected<std::shared_ptr<Ledger const>, Json::Value> On success, contains a shared pointer to the requested Ledger. On failure, contains a Json::Value describing the error.

Definition at line 346 of file RPCLedgerHelpers.cpp.

◆ getTxFee()

static XRPAmount xrpl::RPC::getTxFee ( Application const &  app,
Config const &  config,
Json::Value  tx 
)
static

Definition at line 716 of file TransactionSign.cpp.

◆ getCurrentNetworkFee()

Json::Value xrpl::RPC::getCurrentNetworkFee ( Role const  role,
Config const &  config,
LoadFeeTrack const &  feeTrack,
TxQ const &  txQ,
Application const &  app,
Json::Value const &  tx,
int  mult,
int  div 
)

Definition at line 789 of file TransactionSign.cpp.

◆ checkFee()

Json::Value xrpl::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 827 of file TransactionSign.cpp.

◆ transactionSign()

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

Returns a Json::objectValue.

Definition at line 885 of file TransactionSign.cpp.

◆ transactionSubmit()

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

Returns a Json::objectValue.

Definition at line 919 of file TransactionSign.cpp.

◆ transactionSignFor()

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

Returns a Json::objectValue.

Definition at line 1037 of file TransactionSign.cpp.

◆ transactionSubmitMultiSigned()

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

Returns a Json::objectValue.

Definition at line 1145 of file TransactionSign.cpp.

◆ getProcessTxnFn()

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

Definition at line 72 of file TransactionSign.h.

◆ stringOutput()

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

Definition at line 11 of file src/xrpld/rpc/Output.h.

Variable Documentation

◆ apiVersion

template<unsigned int Version>
constexpr std::integral_constant<unsigned, Version> xrpl::RPC::apiVersion = {}
staticconstexpr

Definition at line 38 of file ApiVersion.h.

◆ apiInvalidVersion

constexpr auto xrpl::RPC::apiInvalidVersion = apiVersion<0>
staticconstexpr

Definition at line 40 of file ApiVersion.h.

◆ apiMinimumSupportedVersion

constexpr auto xrpl::RPC::apiMinimumSupportedVersion = apiVersion<1>
staticconstexpr

Definition at line 41 of file ApiVersion.h.

◆ apiMaximumSupportedVersion

constexpr auto xrpl::RPC::apiMaximumSupportedVersion = apiVersion<2>
staticconstexpr

Definition at line 42 of file ApiVersion.h.

◆ apiVersionIfUnspecified

constexpr auto xrpl::RPC::apiVersionIfUnspecified = apiVersion<1>
staticconstexpr

Definition at line 43 of file ApiVersion.h.

◆ apiCommandLineVersion

constexpr auto xrpl::RPC::apiCommandLineVersion = apiVersion<1>
staticconstexpr

Definition at line 44 of file ApiVersion.h.

◆ apiBetaVersion

constexpr auto xrpl::RPC::apiBetaVersion = apiVersion<3>
staticconstexpr

Definition at line 45 of file ApiVersion.h.

◆ apiMaximumValidVersion

constexpr auto xrpl::RPC::apiMaximumValidVersion = apiBetaVersion
staticconstexpr

Definition at line 46 of file ApiVersion.h.

◆ txnTestArray

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

Definition at line 52 of file JSONRPC_test.cpp.

◆ secp256k1_strings

key_strings const xrpl::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 35 of file KeyGeneration_test.cpp.

◆ ed25519_strings

key_strings const xrpl::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 49 of file KeyGeneration_test.cpp.

◆ strong_brain_strings

key_strings const xrpl::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 63 of file KeyGeneration_test.cpp.