Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc Namespace Reference

This namespace contains all the RPC logic and handlers. More...

Classes

class  AccountChannelsHandler
 The account_channels method returns information about an account's Payment Channels. This includes only channels where the specified account is the channel's source, not the destination. All information retrieved is relative to a particular version of the ledger. More...
 
class  AccountCurrenciesHandler
 The account_currencies command retrieves a list of currencies that an account can send or receive, based on its trust lines. More...
 
struct  AccountCursor
 A cursor object used to traverse nodes owned by an account. More...
 
class  AccountInfoHandler
 The account_info command retrieves information about an account, its activity, and its XRP balance. More...
 
class  AccountLinesHandler
 The account_lines method returns information about an account's trust lines, which contain balances in all non-XRP currencies and assets. More...
 
class  AccountNFTsHandler
 The account_nfts method returns a list of NFToken objects for the specified account. More...
 
class  AccountNotFoundError
 Account not found error. More...
 
class  AccountObjectsHandler
 The account_objects command returns the raw ledger format for all objects owned by an account. The results can be filtered by the type. The valid types are: check, deposit_preauth, escrow, nft_offer, offer, payment_channel, signer_list, state (trust line), did and ticket. More...
 
class  AccountOffersHandler
 The account_offers method retrieves a list of offers made by a given account. More...
 
class  AccountTxHandler
 The account_tx method retrieves a list of transactions that involved the specified account. More...
 
class  AMMInfoHandler
 AMMInfoHandler returns information about AMM pools. More...
 
class  AnyHandler
 A type-erased Handler that can contain any (NextGen) RPC handler class. More...
 
class  APIVersionParser
 A baseclass for API version helper. More...
 
class  BaseServerInfoHandler
 Contains common functionality for handling the server_info command. More...
 
class  BaseTxHandler
 Contains common functionality for handling the tx command. More...
 
struct  BookChange
 Represents an entry in the book_changes' changes array. More...
 
class  BookChanges
 Encapsulates the book_changes computations and transformations. More...
 
class  BookChangesHandler
 BookChangesHandler returns the order book changes for a given ledger. More...
 
class  BookOffersHandler
 The book_offers method retrieves a list of Offers between two currencies, also known as an order book. More...
 
struct  ClioErrorInfo
 Holds info about a particular ClioError. More...
 
struct  Context
 Context of an RPC call. More...
 
class  Counters
 Holds information about successful, failed, forwarded, etc. RPC handler calls. More...
 
class  DepositAuthorizedHandler
 Handles the deposit_authorized command. More...
 
class  FeatureHandler
 Contains common functionality for handling the server_info command. More...
 
struct  FieldSpec
 Represents a Specification for one field of an RPC command. More...
 
class  GatewayBalancesHandler
 Handles the gateway_balances command. More...
 
class  GetAggregatePriceHandler
 The get_aggregate_price method. More...
 
class  HandlerProvider
 Interface for the provider of RPC handlers. More...
 
class  InvalidParamsError
 Invalid parameters error. More...
 
struct  JsonBool
 A wrapper around bool that allows to convert from any JSON value. More...
 
class  LedgerDataHandler
 The ledger_data method retrieves contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version. More...
 
class  LedgerEntryHandler
 The ledger_entry method returns a single ledger object from the XRP Ledger in its raw format. More...
 
class  LedgerHandler
 Retrieve information about the public ledger. More...
 
class  LedgerIndexHandler
 The ledger_index method fetches the lastest closed ledger before the given date. More...
 
class  LedgerRangeHandler
 The ledger_range command returns the index number of the earliest and latest ledgers that the server has. More...
 
class  MPTHoldersHandler
 The mpt_holders command asks the Clio server for all holders of a particular MPTokenIssuance. More...
 
class  NFTBuyOffersHandler
 The nft_buy_offers method returns a list of buy offers for a given NFToken object. More...
 
class  NFTHistoryHandler
 The nft_history command asks the Clio server for past transaction metadata for the NFT being queried. More...
 
class  NFTInfoHandler
 The nft_info command asks the Clio server for information about the NFT being queried. More...
 
class  NFTOffersHandlerBase
 Contains common functionality for handling the nft_offers command. More...
 
class  NFTsByIssuerHandler
 Handler for the nfts_by_issuer command. More...
 
class  NFTSellOffersHandler
 The nft_sell_offers method returns a list of sell offers for a given NFToken object. More...
 
class  NoRippleCheckHandler
 Handles the noripple_check command. More...
 
class  PingHandler
 The ping command returns an acknowledgement, so that clients can test the connection status and latency. More...
 
class  RandomHandler
 The random command provides a random number to be used as a source of entropy for random number generation by clients. More...
 
struct  Result
 Result type used to return responses or error statuses to the Webserver subsystem. More...
 
struct  ReturnType
 The final return type out of RPC engine. More...
 
class  RPCEngine
 The RPC engine that ties all RPC-related functionality together. More...
 
struct  RpcSpec
 Represents a Specification of an entire RPC command. More...
 
struct  Status
 A status returned from any RPC handler. More...
 
class  SubscribeHandler
 Contains functionality for handling the subscribe command. The subscribe method requests periodic notifications from the server when certain events happen. More...
 
class  TransactionEntryHandler
 The transaction_entry method retrieves information on a single transaction from a specific ledger version. More...
 
class  UnsubscribeHandler
 Handles the unsubscribe command which is used to disconnect a subscriber from a feed. The unsubscribe command tells the server to stop sending messages for a particular subscription or set of subscriptions. More...
 
class  VersionHandler
 The version command returns the min,max and current api Version we are using. More...
 
struct  VoidOutput
 An empty type used as Output for handlers than don't actually produce output. More...
 
struct  WarningInfo
 Holds information about a clio warning. More...
 
class  WorkQueue
 An asynchronous, thread-safe queue for RPC requests. More...
 

Concepts

concept  SomeRequirement
 Specifies what a requirement used with rpc::FieldSpec must provide.
 
concept  SomeModifier
 Specifies what a modifier used with rpc::FieldSpec must provide.
 
concept  SomeCheck
 Specifies what a check used with rpc::FieldSpec must provide.
 
concept  SomeProcessor
 The requirements of a processor to be used with rpc::FieldSpec.
 
concept  SomeContextProcessWithInput
 A process function that expects both some Input and a Context.
 
concept  SomeContextProcessWithoutInput
 A process function that expects no Input but does take a Context.
 
concept  SomeHandlerWithInput
 Specifies what a Handler with Input must provide.
 
concept  SomeHandlerWithoutInput
 Specifies what a Handler without Input must provide.
 
concept  SomeHandler
 Specifies what a Handler type must provide.
 

Typedefs

using RpcSpecConstRef = RpcSpec const&
 An alias for a const reference to RpcSpec.
 
using MaybeError = std::expected<void, Status>
 Return type used for Validators that can return error but don't have specific value to return.
 
using Error = std::unexpected<Status>
 The type that represents just the error part of MaybeError.
 
template<typename OutputType >
using HandlerReturnType = std::expected<OutputType, Status>
 Return type for each individual handler.
 
using RippledError = ripple::error_code_i
 Clio uses compatible Rippled error codes for most RPC errors.
 
using CombinedError = std::variant<RippledError, ClioError>
 Clio operates on a combination of Rippled and Custom Clio error codes.
 
using ServerInfoHandler = BaseServerInfoHandler<etl::LoadBalancer, etl::ETLService, Counters>
 The server_info command asks the Clio server for a human-readable version of various information about the Clio server being queried.
 
using TxHandler = BaseTxHandler<etl::ETLService>
 The tx method retrieves information on a single transaction, by its identifying hash.
 
using RippledJson = Json::Value
 

Enumerations

enum class  ClioError {
  RpcMalformedCurrency = 5000 , RpcMalformedRequest = 5001 , RpcMalformedOwner = 5002 , RpcMalformedAddress = 5003 ,
  RpcUnknownOption = 5005 , RpcFieldNotFoundTransaction = 5006 , RpcMalformedOracleDocumentId = 5007 , RpcMalformedAuthorizedCredentials = 5008 ,
  RpcInvalidApiVersion = 6000 , RpcCommandIsMissing = 6001 , RpcCommandNotString = 6002 , RpcCommandIsEmpty = 6003 ,
  RpcParamsUnparseable = 6004 , EtlConnectionError = 7000 , EtlRequestError = 7001 , EtlRequestTimeout = 7002 ,
  EtlInvalidResponse = 7003
}
 Custom clio RPC Errors.
 
enum  WarningCode {
  WarnUnknown = -1 , WarnRpcClio = 2001 , WarnRpcOutdated = 2002 , WarnRpcRateLimit = 2003 ,
  WarnRpcDeprecated = 2004
}
 Warning codes that can be returned by clio.
 
enum class  NFTokenjson { ENABLE , DISABLE }
 Enum for NFT json manipulation.
 

Functions

std::pair< ripple::STAmount, ripple::STAmount > getAmmPoolHolds (BackendInterface const &backend, std::uint32_t sequence, ripple::AccountID const &ammAccountID, ripple::Issue const &issue1, ripple::Issue const &issue2, bool freezeHandling, boost::asio::yield_context yield)
 getAmmPoolHolds returns the balances of the amm asset pair
 
ripple::STAmount getAmmLpHolds (BackendInterface const &backend, std::uint32_t sequence, ripple::Currency const &cur1, ripple::Currency const &cur2, ripple::AccountID const &ammAccount, ripple::AccountID const &lpAccount, boost::asio::yield_context yield)
 getAmmLpHolds returns the liquidity provider token balance
 
ripple::STAmount getAmmLpHolds (BackendInterface const &backend, std::uint32_t sequence, ripple::SLE const &ammSle, ripple::AccountID const &lpAccount, boost::asio::yield_context yield)
 getAmmLpHolds returns the liquidity provider token balance
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, BookChange const &change)
 Implementation of value_from for BookChange type.
 
boost::json::object computeBookChanges (ripple::LedgerHeader const &lgrInfo, std::vector< data::TransactionAndMetadata > const &transactions)
 Computes all book changes for the given ledger header and transactions.
 
JsonBool tag_invoke (boost::json::value_to_tag< JsonBool > const &, boost::json::value const &jsonValue)
 Convert a JSON value to a JsonBool.
 
bool operator== (MaybeError const &lhs, MaybeError const &rhs)
 Check if two MaybeError objects are equal.
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, VoidOutput const &)
 Convert an empty output to a JSON object.
 
WarningInfo const & getWarningInfo (WarningCode code)
 Get the warning info object from a warning code.
 
boost::json::object makeWarning (WarningCode code)
 Generate JSON from a rpc::WarningCode.
 
ClioErrorInfo const & getErrorInfo (ClioError code)
 Get the error info object from an clio-specific error code.
 
boost::json::object makeError (RippledError err, std::optional< std::string_view > customError=std::nullopt, std::optional< std::string_view > customMessage=std::nullopt)
 Generate JSON from a rpc::RippledError.
 
boost::json::object makeError (ClioError err, std::optional< std::string_view > customError=std::nullopt, std::optional< std::string_view > customMessage=std::nullopt)
 Generate JSON from a rpc::ClioError.
 
boost::json::object makeError (Status const &status)
 Generate JSON from a rpc::Status.
 
std::expected< web::Context, StatusmakeWsContext (boost::asio::yield_context yc, boost::json::object const &request, web::SubscriptionContextPtr session, util::TagDecoratorFactory const &tagFactory, data::LedgerRange const &range, std::string const &clientIp, std::reference_wrapper< APIVersionParser const > apiVersionParser, bool isAdmin)
 A factory function that creates a Websocket context.
 
std::expected< web::Context, StatusmakeHttpContext (boost::asio::yield_context yc, boost::json::object const &request, util::TagDecoratorFactory const &tagFactory, data::LedgerRange const &range, std::string const &clientIp, std::reference_wrapper< APIVersionParser const > apiVersionParser, bool isAdmin)
 A factory function that creates a HTTP context.
 
AccountChannelsHandler::Input tag_invoke (boost::json::value_to_tag< AccountChannelsHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountChannelsHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountChannelsHandler::ChannelResponse const &channel)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountCurrenciesHandler::Output const &output)
 
AccountCurrenciesHandler::Input tag_invoke (boost::json::value_to_tag< AccountCurrenciesHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountInfoHandler::Output const &output)
 
AccountInfoHandler::Input tag_invoke (boost::json::value_to_tag< AccountInfoHandler::Input >, boost::json::value const &jv)
 
AccountLinesHandler::Input tag_invoke (boost::json::value_to_tag< AccountLinesHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountLinesHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountLinesHandler::LineResponse const &line)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountNFTsHandler::Output const &output)
 
AccountNFTsHandler::Input tag_invoke (boost::json::value_to_tag< AccountNFTsHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountObjectsHandler::Output const &output)
 
AccountObjectsHandler::Input tag_invoke (boost::json::value_to_tag< AccountObjectsHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountOffersHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountOffersHandler::Offer const &offer)
 
AccountOffersHandler::Input tag_invoke (boost::json::value_to_tag< AccountOffersHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountTxHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountTxHandler::Marker const &marker)
 
AccountTxHandler::Input tag_invoke (boost::json::value_to_tag< AccountTxHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AMMInfoHandler::Output const &output)
 
AMMInfoHandler::Input tag_invoke (boost::json::value_to_tag< AMMInfoHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, BookChangesHandler::Output const &output)
 
BookChangesHandler::Input tag_invoke (boost::json::value_to_tag< BookChangesHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, BookOffersHandler::Output const &output)
 
BookOffersHandler::Input tag_invoke (boost::json::value_to_tag< BookOffersHandler::Input >, boost::json::value const &jv)
 
DepositAuthorizedHandler::Input tag_invoke (boost::json::value_to_tag< DepositAuthorizedHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, DepositAuthorizedHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, FeatureHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, FeatureHandler::Output::Feature const &feature)
 
FeatureHandler::Input tag_invoke (boost::json::value_to_tag< FeatureHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, GatewayBalancesHandler::Output const &output)
 
GatewayBalancesHandler::Input tag_invoke (boost::json::value_to_tag< GatewayBalancesHandler::Input >, boost::json::value const &jv)
 
GetAggregatePriceHandler::Input tag_invoke (boost::json::value_to_tag< GetAggregatePriceHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, GetAggregatePriceHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, LedgerHandler::Output const &output)
 
LedgerHandler::Input tag_invoke (boost::json::value_to_tag< LedgerHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, LedgerDataHandler::Output const &output)
 
LedgerDataHandler::Input tag_invoke (boost::json::value_to_tag< LedgerDataHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, LedgerEntryHandler::Output const &output)
 
LedgerEntryHandler::Input tag_invoke (boost::json::value_to_tag< LedgerEntryHandler::Input >, boost::json::value const &jv)
 
LedgerIndexHandler::Input tag_invoke (boost::json::value_to_tag< LedgerIndexHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, LedgerIndexHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, LedgerRangeHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, MPTHoldersHandler::Output const &output)
 
MPTHoldersHandler::Input tag_invoke (boost::json::value_to_tag< MPTHoldersHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, NFTHistoryHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, NFTHistoryHandler::Marker const &marker)
 
NFTHistoryHandler::Input tag_invoke (boost::json::value_to_tag< NFTHistoryHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, NFTInfoHandler::Output const &output)
 
NFTInfoHandler::Input tag_invoke (boost::json::value_to_tag< NFTInfoHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, NFTOffersHandlerBase::Output const &output)
 
NFTOffersHandlerBase::Input tag_invoke (boost::json::value_to_tag< NFTOffersHandlerBase::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, NFTsByIssuerHandler::Output const &output)
 
NFTsByIssuerHandler::Input tag_invoke (boost::json::value_to_tag< NFTsByIssuerHandler::Input >, boost::json::value const &jv)
 
NoRippleCheckHandler::Input tag_invoke (boost::json::value_to_tag< NoRippleCheckHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, NoRippleCheckHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, RandomHandler::Output const &output)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, SubscribeHandler::Output const &output)
 
SubscribeHandler::Input tag_invoke (boost::json::value_to_tag< SubscribeHandler::Input >, boost::json::value const &jv)
 
void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, TransactionEntryHandler::Output const &output)
 
TransactionEntryHandler::Input tag_invoke (boost::json::value_to_tag< TransactionEntryHandler::Input >, boost::json::value const &jv)
 
UnsubscribeHandler::Input tag_invoke (boost::json::value_to_tag< UnsubscribeHandler::Input >, boost::json::value const &jv)
 
std::optional< AccountCursorparseAccountCursor (std::optional< std::string > jsonCursor)
 Parse the account cursor from the JSON.
 
std::optional< ripple::STAmount > getDeliveredAmount (std::shared_ptr< ripple::STTx const > const &txn, std::shared_ptr< ripple::TxMeta const > const &meta, std::uint32_t ledgerSequence, uint32_t date)
 Get the delivered amount.
 
bool canHaveDeliveredAmount (std::shared_ptr< ripple::STTx const > const &txn, std::shared_ptr< ripple::TxMeta const > const &meta)
 Whether the transaction can have a delivered amount.
 
std::optional< ripple::AccountID > accountFromStringStrict (std::string const &account)
 Get a ripple::AccountID from its string representation.
 
std::pair< std::shared_ptr< ripple::STTx const >, std::shared_ptr< ripple::STObject const > > deserializeTxPlusMeta (data::TransactionAndMetadata const &blobs)
 Deserialize a TransactionAndMetadata into a pair of STTx and STObject.
 
std::pair< std::shared_ptr< ripple::STTx const >, std::shared_ptr< ripple::TxMeta const > > deserializeTxPlusMeta (data::TransactionAndMetadata const &blobs, std::uint32_t seq)
 Deserialize a TransactionAndMetadata into a pair of STTx and TxMeta.
 
boost::json::object toJson (ripple::STBase const &obj)
 Convert STBase object to JSON.
 
std::pair< boost::json::object, boost::json::object > toExpandedJson (data::TransactionAndMetadata const &blobs, std::uint32_t apiVersion, NFTokenjson nftEnabled=NFTokenjson::DISABLE, std::optional< uint16_t > networkId=std::nullopt)
 Convert a TransactionAndMetadata to two JSON objects.
 
std::optional< std::string > encodeCTID (uint32_t ledgerSeq, uint16_t txnIndex, uint16_t networkId) noexcept
 Encode CTID as string.
 
bool insertDeliveredAmount (boost::json::object &metaJson, std::shared_ptr< ripple::STTx const > const &txn, std::shared_ptr< ripple::TxMeta const > const &meta, uint32_t date)
 Add "DeliveredAmount" to the transaction json object.
 
static std::optional< ripple::uint192 > getMPTIssuanceID (std::shared_ptr< ripple::TxMeta const > const &meta)
 Get the delivered amount.
 
static bool canHaveMPTIssuanceID (std::shared_ptr< ripple::STTx const > const &txn, std::shared_ptr< ripple::TxMeta const > const &meta)
 Check if transaction has a new MPToken created.
 
bool insertMPTIssuanceID (boost::json::object &metaJson, std::shared_ptr< ripple::STTx const > const &txn, std::shared_ptr< ripple::TxMeta const > const &meta)
 Add "mpt_issuance_id" into MPTokenIssuanceCreate transaction json.
 
void insertDeliverMaxAlias (boost::json::object &txJson, std::uint32_t apiVersion)
 Add "DeliverMax" which is the alias of "Amount" for "Payment" transaction to transaction json. Remove the "Amount" field when version is greater than 1.
 
boost::json::object toJson (ripple::TxMeta const &meta)
 Convert a TxMeta to JSON object.
 
boost::json::value toBoostJson (RippledJson const &value)
 Convert a RippledJson to boost::json::value.
 
boost::json::object toJson (ripple::SLE const &sle)
 Convert SLE to JSON.
 
boost::json::object toJson (ripple::LedgerHeader const &info, bool binary, std::uint32_t apiVersion)
 Convert a LedgerHeader to JSON object.
 
std::optional< std::uint32_t > parseStringAsUInt (std::string const &value)
 Parse the string as a uint32_t.
 
std::variant< Status, ripple::LedgerHeader > ledgerHeaderFromRequest (std::shared_ptr< data::BackendInterface const > const &backend, web::Context const &ctx)
 Get ledger info from the request.
 
std::variant< Status, ripple::LedgerHeader > getLedgerHeaderFromHashOrSeq (BackendInterface const &backend, boost::asio::yield_context yield, std::optional< std::string > ledgerHash, std::optional< uint32_t > ledgerIndex, uint32_t maxSeq)
 Get ledger info from hash or sequence.
 
std::vector< unsigned char > ledgerHeaderToBlob (ripple::LedgerHeader const &info, bool includeHash=false)
 Convert a ledger header to a blob.
 
std::uint64_t getStartHint (ripple::SLE const &sle, ripple::AccountID const &accountID)
 Get the start hint for the account.
 
std::variant< Status, AccountCursortraverseNFTObjects (BackendInterface const &backend, std::uint32_t sequence, ripple::AccountID const &accountID, ripple::uint256 nextPage, std::uint32_t limit, boost::asio::yield_context yield, std::function< void(ripple::SLE)> atOwnedNode)
 Traverse NFT objects and call the callback for each owned node.
 
std::variant< Status, AccountCursortraverseOwnedNodes (BackendInterface const &backend, ripple::AccountID const &accountID, std::uint32_t sequence, std::uint32_t limit, std::optional< std::string > jsonCursor, boost::asio::yield_context yield, std::function< void(ripple::SLE)> atOwnedNode, bool nftIncluded=false)
 Traverse nodes owned by an account.
 
std::variant< Status, AccountCursortraverseOwnedNodes (BackendInterface const &backend, ripple::Keylet const &owner, ripple::uint256 const &hexMarker, std::uint32_t startHint, std::uint32_t sequence, std::uint32_t limit, boost::asio::yield_context yield, std::function< void(ripple::SLE)> atOwnedNode)
 Traverse nodes owned by an account.
 
std::shared_ptr< ripple::SLE const > read (std::shared_ptr< data::BackendInterface const > const &backend, ripple::Keylet const &keylet, ripple::LedgerHeader const &lgrInfo, web::Context const &context)
 Read SLE from the backend.
 
std::optional< ripple::Seed > parseRippleLibSeed (boost::json::value const &value)
 Parse a ripple-lib seed.
 
std::vector< ripple::AccountID > getAccountsFromTransaction (boost::json::object const &transaction)
 Get the account associated with a transaction.
 
bool isGlobalFrozen (BackendInterface const &backend, std::uint32_t seq, ripple::AccountID const &issuer, boost::asio::yield_context yield)
 Whether global frozen is set.
 
bool isFrozen (BackendInterface const &backend, std::uint32_t sequence, ripple::AccountID const &account, ripple::Currency const &currency, ripple::AccountID const &issuer, boost::asio::yield_context yield)
 Whether the account is frozen.
 
ripple::XRPAmount xrpLiquid (BackendInterface const &backend, std::uint32_t sequence, ripple::AccountID const &id, boost::asio::yield_context yield)
 Get the XRP liquidity.
 
ripple::STAmount accountFunds (BackendInterface const &backend, std::uint32_t sequence, ripple::STAmount const &amount, ripple::AccountID const &id, boost::asio::yield_context yield)
 Get the account funds.
 
ripple::STAmount accountHolds (BackendInterface const &backend, std::uint32_t sequence, ripple::AccountID const &account, ripple::Currency const &currency, ripple::AccountID const &issuer, bool zeroIfFrozen, boost::asio::yield_context yield)
 Get the amount that an account holds.
 
ripple::Rate transferRate (BackendInterface const &backend, std::uint32_t sequence, ripple::AccountID const &issuer, boost::asio::yield_context yield)
 Get the transfer rate.
 
boost::json::array postProcessOrderBook (std::vector< data::LedgerObject > const &offers, ripple::Book const &book, ripple::AccountID const &takerID, data::BackendInterface const &backend, std::uint32_t ledgerSequence, boost::asio::yield_context yield)
 Post process an order book.
 
std::variant< Status, ripple::Book > parseBook (ripple::Currency pays, ripple::AccountID payIssuer, ripple::Currency gets, ripple::AccountID getIssuer)
 Parse the book from the request.
 
std::variant< Status, ripple::Book > parseBook (boost::json::object const &request)
 Parse the book from the request.
 
std::variant< Status, ripple::AccountID > parseTaker (boost::json::value const &taker)
 Parse the taker from the request.
 
ripple::Issue parseIssue (boost::json::object const &issue)
 Parse the json object into a ripple::Issue object.
 
bool specifiesCurrentOrClosedLedger (boost::json::object const &request)
 Check whethe the request specifies the current or closed ledger.
 
bool isAdminCmd (std::string const &method, boost::json::object const &request)
 Check whether a request requires administrative privileges on rippled side.
 
std::variant< ripple::uint256, StatusgetNFTID (boost::json::object const &request)
 Get the NFTID from the request.
 
boost::json::object toJsonWithBinaryTx (data::TransactionAndMetadata const &txnPlusMeta, std::uint32_t apiVersion)
 Convert a TransactionAndMetadata to JSON object containing tx and metadata data in hex format. According to the apiVersion, the key is "tx_blob" and "meta" or "meta_blob".
 
bool isOwnedByAccount (ripple::SLE const &sle, ripple::AccountID const &accountID)
 Check whether the SLE is owned by the account.
 
boost::json::object generatePubLedgerMessage (ripple::LedgerHeader const &lgrInfo, ripple::Fees const &fees, std::string const &ledgerRange, std::uint32_t txnCount)
 Generate a JSON object to publish ledger message.
 
template<typename T >
std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > decodeCTID (T const ctid) noexcept
 Decode the CTID from a string or a uint64_t.
 
template<typename T >
void logDuration (web::Context const &ctx, T const &dur)
 Log the duration of the request processing.
 

Variables

static constexpr uint32_t kAPI_VERSION_DEFAULT = 1u
 Default API version to use if no version is specified by clients.
 
static constexpr uint32_t kAPI_VERSION_MIN = 1u
 Minimum API version supported by this build.
 
static constexpr uint32_t kAPI_VERSION_MAX = 3u
 Maximum API version supported by this build.
 
static Status gOk
 A globally available rpc::Status that represents a successful state.
 

Detailed Description

This namespace contains all the RPC logic and handlers.

Typedef Documentation

◆ CombinedError

using rpc::CombinedError = std::variant<RippledError, ClioError>

Clio operates on a combination of Rippled and Custom Clio error codes.

See also
RippledError For rippled error codes
ClioError For custom clio error codes

◆ ServerInfoHandler

The server_info command asks the Clio server for a human-readable version of various information about the Clio server being queried.

For more details see: https://xrpl.org/server_info-clio.html

◆ TxHandler

The tx method retrieves information on a single transaction, by its identifying hash.

For more details see: https://xrpl.org/tx.html

Function Documentation

◆ accountFromStringStrict()

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

Get a ripple::AccountID from its string representation.

Parameters
accountThe string representation of the account
Returns
The account ID or std::nullopt if the string is not a valid account

◆ accountFunds()

ripple::STAmount rpc::accountFunds ( BackendInterface const & backend,
std::uint32_t sequence,
ripple::STAmount const & amount,
ripple::AccountID const & id,
boost::asio::yield_context yield )

Get the account funds.

Parameters
backendThe backend to use
sequenceThe sequence
amountThe amount
idThe account ID
yieldThe coroutine context
Returns
The account funds

◆ accountHolds()

ripple::STAmount rpc::accountHolds ( BackendInterface const & backend,
std::uint32_t sequence,
ripple::AccountID const & account,
ripple::Currency const & currency,
ripple::AccountID const & issuer,
bool zeroIfFrozen,
boost::asio::yield_context yield )

Get the amount that an account holds.

Parameters
backendThe backend to use
sequenceThe sequence
accountThe account
currencyThe currency
issuerThe issuer
zeroIfFrozenWhether to return zero if frozen
yieldThe coroutine context
Returns
The amount account holds

◆ canHaveDeliveredAmount()

bool rpc::canHaveDeliveredAmount ( std::shared_ptr< ripple::STTx const > const & txn,
std::shared_ptr< ripple::TxMeta const > const & meta )

Whether the transaction can have a delivered amount.

Parameters
txnThe transaction
metaThe metadata
Returns
true if the transaction can have a delivered amount

◆ canHaveMPTIssuanceID()

static bool rpc::canHaveMPTIssuanceID ( std::shared_ptr< ripple::STTx const > const & txn,
std::shared_ptr< ripple::TxMeta const > const & meta )
static

Check if transaction has a new MPToken created.

Parameters
txnThe transaction
metaThe metadata
Returns
true if the transaction can have a mpt_issuance_id

◆ computeBookChanges()

boost::json::object rpc::computeBookChanges ( ripple::LedgerHeader const & lgrInfo,
std::vector< data::TransactionAndMetadata > const & transactions )
nodiscard

Computes all book changes for the given ledger header and transactions.

Parameters
lgrInfoThe ledger header
transactionsThe vector of transactions with heir metadata
Returns
The book changes

◆ decodeCTID()

template<typename T >
std::optional< std::tuple< uint32_t, uint16_t, uint16_t > > rpc::decodeCTID ( T const ctid)
inlinenoexcept

Decode the CTID from a string or a uint64_t.

Template Parameters
TThe type of the CTID
Parameters
ctidThe CTID to decode
Returns
The decoded CTID

◆ deserializeTxPlusMeta() [1/2]

std::pair< std::shared_ptr< ripple::STTx const >, std::shared_ptr< ripple::STObject const > > rpc::deserializeTxPlusMeta ( data::TransactionAndMetadata const & blobs)

Deserialize a TransactionAndMetadata into a pair of STTx and STObject.

Parameters
blobsThe TransactionAndMetadata to deserialize
Returns
The deserialized objects

◆ deserializeTxPlusMeta() [2/2]

std::pair< std::shared_ptr< ripple::STTx const >, std::shared_ptr< ripple::TxMeta const > > rpc::deserializeTxPlusMeta ( data::TransactionAndMetadata const & blobs,
std::uint32_t seq )

Deserialize a TransactionAndMetadata into a pair of STTx and TxMeta.

Parameters
blobsThe TransactionAndMetadata to deserialize
seqThe sequence number to set
Returns
The deserialized objects

◆ encodeCTID()

std::optional< std::string > rpc::encodeCTID ( uint32_t ledgerSeq,
uint16_t txnIndex,
uint16_t networkId )
noexcept

Encode CTID as string.

Parameters
ledgerSeqThe ledger sequence
txnIndexThe transaction index
networkIdThe network ID
Returns
The encoded CTID or std::nullopt if the input is invalid

◆ generatePubLedgerMessage()

boost::json::object rpc::generatePubLedgerMessage ( ripple::LedgerHeader const & lgrInfo,
ripple::Fees const & fees,
std::string const & ledgerRange,
std::uint32_t txnCount )

Generate a JSON object to publish ledger message.

Parameters
lgrInfoThe ledger header
feesThe fees
ledgerRangeThe ledger range
txnCountThe transaction count
Returns
The JSON object

◆ getAccountsFromTransaction()

std::vector< ripple::AccountID > rpc::getAccountsFromTransaction ( boost::json::object const & transaction)

Get the account associated with a transaction.

Parameters
transactionThe transaction
Returns
A vector of accounts associated with the transaction

◆ getAmmLpHolds() [1/2]

ripple::STAmount rpc::getAmmLpHolds ( BackendInterface const & backend,
std::uint32_t sequence,
ripple::Currency const & cur1,
ripple::Currency const & cur2,
ripple::AccountID const & ammAccount,
ripple::AccountID const & lpAccount,
boost::asio::yield_context yield )

getAmmLpHolds returns the liquidity provider token balance

Parameters
backendThe backend to use
sequenceThe sequence number to use
cur1The first currency
cur2The second currency
ammAccountThe amm account
lpAccountThe lp account
yieldThe coroutine context
Returns
The lp token balance

◆ getAmmLpHolds() [2/2]

ripple::STAmount rpc::getAmmLpHolds ( BackendInterface const & backend,
std::uint32_t sequence,
ripple::SLE const & ammSle,
ripple::AccountID const & lpAccount,
boost::asio::yield_context yield )

getAmmLpHolds returns the liquidity provider token balance

Parameters
backendThe backend to use
sequenceThe sequence number to use
ammSleThe amm ledger entry
lpAccountThe lp account
yieldThe coroutine context
Returns
The lp token balance

◆ getAmmPoolHolds()

std::pair< ripple::STAmount, ripple::STAmount > rpc::getAmmPoolHolds ( BackendInterface const & backend,
std::uint32_t sequence,
ripple::AccountID const & ammAccountID,
ripple::Issue const & issue1,
ripple::Issue const & issue2,
bool freezeHandling,
boost::asio::yield_context yield )

getAmmPoolHolds returns the balances of the amm asset pair

Parameters
backendThe backend to use
sequenceThe sequence number to use
ammAccountIDThe amm account
issue1The first issue
issue2The second issue
freezeHandlingWhether to return zeroes for frozen accounts
yieldThe coroutine context
Returns
The balances of the amm asset pair

◆ getDeliveredAmount()

std::optional< ripple::STAmount > rpc::getDeliveredAmount ( std::shared_ptr< ripple::STTx const > const & txn,
std::shared_ptr< ripple::TxMeta const > const & meta,
std::uint32_t ledgerSequence,
uint32_t date )

Get the delivered amount.

Parameters
txnThe transaction
metaThe metadata
ledgerSequenceThe sequence
dateThe date of the ledger
Returns
The delivered amount or std::nullopt if not available

◆ getErrorInfo()

ClioErrorInfo const & rpc::getErrorInfo ( ClioError code)

Get the error info object from an clio-specific error code.

Parameters
codeThe error code
Returns
A reference to the static error info

◆ getLedgerHeaderFromHashOrSeq()

std::variant< Status, ripple::LedgerHeader > rpc::getLedgerHeaderFromHashOrSeq ( BackendInterface const & backend,
boost::asio::yield_context yield,
std::optional< std::string > ledgerHash,
std::optional< uint32_t > ledgerIndex,
uint32_t maxSeq )

Get ledger info from hash or sequence.

Parameters
backendThe backend to use
yieldThe coroutine context
ledgerHashThe optional ledger hash
ledgerIndexThe optional ledger index
maxSeqThe maximum sequence to search
Returns
The ledger info or an error status

◆ getMPTIssuanceID()

static std::optional< ripple::uint192 > rpc::getMPTIssuanceID ( std::shared_ptr< ripple::TxMeta const > const & meta)
static

Get the delivered amount.

Parameters
metaThe metadata
Returns
The mpt_issuance_id or std::nullopt if not available

◆ getNFTID()

std::variant< ripple::uint256, Status > rpc::getNFTID ( boost::json::object const & request)

Get the NFTID from the request.

Parameters
requestThe request
Returns
The NFTID or an error status

◆ getStartHint()

std::uint64_t rpc::getStartHint ( ripple::SLE const & sle,
ripple::AccountID const & accountID )

Get the start hint for the account.

Parameters
sleThe ledger entry
accountIDThe account ID
Returns
The start hint

◆ getWarningInfo()

WarningInfo const & rpc::getWarningInfo ( WarningCode code)

Get the warning info object from a warning code.

Parameters
codeThe warning code
Returns
A reference to the static warning info

◆ insertDeliveredAmount()

bool rpc::insertDeliveredAmount ( boost::json::object & metaJson,
std::shared_ptr< ripple::STTx const > const & txn,
std::shared_ptr< ripple::TxMeta const > const & meta,
uint32_t date )

Add "DeliveredAmount" to the transaction json object.

Parameters
metaJsonThe metadata json object to add "DeliveredAmount"
txnThe transaction object
metaThe metadata object
dateThe date of the ledger
Returns
true if the "DeliveredAmount" is added to the metadata json object

◆ insertDeliverMaxAlias()

void rpc::insertDeliverMaxAlias ( boost::json::object & txJson,
std::uint32_t apiVersion )

Add "DeliverMax" which is the alias of "Amount" for "Payment" transaction to transaction json. Remove the "Amount" field when version is greater than 1.

Parameters
txJsonThe transaction json object
apiVersionThe api version

◆ insertMPTIssuanceID()

bool rpc::insertMPTIssuanceID ( boost::json::object & metaJson,
std::shared_ptr< ripple::STTx const > const & txn,
std::shared_ptr< ripple::TxMeta const > const & meta )

Add "mpt_issuance_id" into MPTokenIssuanceCreate transaction json.

Parameters
metaJsonThe metadata json object to add "MPTokenIssuanceID"
txnThe transaction object
metaThe metadata object
Returns
true if the "mpt_issuance_id" is added to the metadata json object

◆ isAdminCmd()

bool rpc::isAdminCmd ( std::string const & method,
boost::json::object const & request )

Check whether a request requires administrative privileges on rippled side.

Parameters
methodThe method name to check
requestThe request to check
Returns
true if the request requires ADMIN role

◆ isFrozen()

bool rpc::isFrozen ( BackendInterface const & backend,
std::uint32_t sequence,
ripple::AccountID const & account,
ripple::Currency const & currency,
ripple::AccountID const & issuer,
boost::asio::yield_context yield )

Whether the account is frozen.

Parameters
backendThe backend to use
sequenceThe sequence
accountThe account
currencyThe currency
issuerThe issuer
yieldThe coroutine context
Returns
true if the account is frozen; false otherwise

◆ isGlobalFrozen()

bool rpc::isGlobalFrozen ( BackendInterface const & backend,
std::uint32_t seq,
ripple::AccountID const & issuer,
boost::asio::yield_context yield )

Whether global frozen is set.

Parameters
backendThe backend to use
seqThe ledger sequence
issuerThe issuer
yieldThe coroutine context
Returns
true if the global frozen is set; false otherwise

◆ isOwnedByAccount()

bool rpc::isOwnedByAccount ( ripple::SLE const & sle,
ripple::AccountID const & accountID )

Check whether the SLE is owned by the account.

Parameters
sleThe ledger entry
accountIDThe account ID
Returns
true if the SLE is owned by the account

◆ ledgerHeaderFromRequest()

std::variant< Status, ripple::LedgerHeader > rpc::ledgerHeaderFromRequest ( std::shared_ptr< data::BackendInterface const > const & backend,
web::Context const & ctx )

Get ledger info from the request.

Parameters
backendThe backend to use
ctxThe context of the request
Returns
The ledger info or an error status

◆ ledgerHeaderToBlob()

std::vector< unsigned char > rpc::ledgerHeaderToBlob ( ripple::LedgerHeader const & info,
bool includeHash = false )

Convert a ledger header to a blob.

Parameters
infoThe ledger header
includeHashWhether to include the hash
Returns
The blob

◆ logDuration()

template<typename T >
void rpc::logDuration ( web::Context const & ctx,
T const & dur )

Log the duration of the request processing.

Template Parameters
TThe type of the duration
Parameters
ctxThe context of the request
durThe duration to log

◆ makeError() [1/3]

boost::json::object rpc::makeError ( ClioError err,
std::optional< std::string_view > customError = std::nullopt,
std::optional< std::string_view > customMessage = std::nullopt )

Generate JSON from a rpc::ClioError.

Parameters
errThe clio's custom error
customErrorA custom error
customMessageA custom message
Returns
The JSON output

◆ makeError() [2/3]

boost::json::object rpc::makeError ( RippledError err,
std::optional< std::string_view > customError = std::nullopt,
std::optional< std::string_view > customMessage = std::nullopt )

Generate JSON from a rpc::RippledError.

Parameters
errThe rippled error
customErrorA custom error
customMessageA custom message
Returns
The JSON output

◆ makeError() [3/3]

boost::json::object rpc::makeError ( Status const & status)

Generate JSON from a rpc::Status.

Parameters
statusThe status object
Returns
The JSON output

◆ makeHttpContext()

std::expected< web::Context, Status > rpc::makeHttpContext ( boost::asio::yield_context yc,
boost::json::object const & request,
util::TagDecoratorFactory const & tagFactory,
data::LedgerRange const & range,
std::string const & clientIp,
std::reference_wrapper< APIVersionParser const > apiVersionParser,
bool isAdmin )

A factory function that creates a HTTP context.

Parameters
ycThe coroutine context
requestThe request as JSON object
tagFactoryA factory that provides tags to track requests
rangeThe ledger range that is available at request time
clientIpThe IP address of the connected client
apiVersionParserA parser that is used to parse out the "api_version" field
isAdminWhether the connection has admin privileges
Returns
A HTTP context or error Status

◆ makeWarning()

boost::json::object rpc::makeWarning ( WarningCode code)

Generate JSON from a rpc::WarningCode.

Parameters
codeThe warning code
Returns
The JSON output

◆ makeWsContext()

std::expected< web::Context, Status > rpc::makeWsContext ( boost::asio::yield_context yc,
boost::json::object const & request,
web::SubscriptionContextPtr session,
util::TagDecoratorFactory const & tagFactory,
data::LedgerRange const & range,
std::string const & clientIp,
std::reference_wrapper< APIVersionParser const > apiVersionParser,
bool isAdmin )

A factory function that creates a Websocket context.

Parameters
ycThe coroutine context
requestThe request as JSON object
sessionThe subscription context
tagFactoryA factory that provides tags to track requests
rangeThe ledger range that is available at request time
clientIpThe IP address of the connected client
apiVersionParserA parser that is used to parse out the "api_version" field
isAdminWhether the request has admin privileges
Returns
A Websocket context or error Status

◆ operator==()

bool rpc::operator== ( MaybeError const & lhs,
MaybeError const & rhs )
inline

Check if two MaybeError objects are equal.

Parameters
lhsThe first MaybeError object
rhsThe second MaybeError object
Returns
true if the two MaybeError objects are equal, false otherwise

◆ parseAccountCursor()

std::optional< AccountCursor > rpc::parseAccountCursor ( std::optional< std::string > jsonCursor)

Parse the account cursor from the JSON.

Parameters
jsonCursorThe JSON cursor
Returns
The parsed account cursor

◆ parseBook() [1/2]

std::variant< Status, ripple::Book > rpc::parseBook ( boost::json::object const & request)

Parse the book from the request.

Parameters
requestThe request
Returns
The book or an error status

◆ parseBook() [2/2]

std::variant< Status, ripple::Book > rpc::parseBook ( ripple::Currency pays,
ripple::AccountID payIssuer,
ripple::Currency gets,
ripple::AccountID getIssuer )

Parse the book from the request.

Parameters
paysThe currency to pay
payIssuerThe issuer of the currency to pay
getsThe currency to get
getIssuerThe issuer of the currency to get
Returns
The book or an error status

◆ parseIssue()

ripple::Issue rpc::parseIssue ( boost::json::object const & issue)

Parse the json object into a ripple::Issue object.

Parameters
issueThe json object to parse. The accepted format is { "currency" : "USD", "issuer" : "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59" } or {"currency" : "XRP"}
Returns
The ripple::Issue object.
Exceptions
raiseJson::error exception if the json object is not in the accepted format.

◆ parseRippleLibSeed()

std::optional< ripple::Seed > rpc::parseRippleLibSeed ( boost::json::value const & value)

Parse a ripple-lib seed.

Parameters
valueJSON value to parse from
Returns
The parsed seed if successful; std::nullopt otherwise

◆ parseStringAsUInt()

std::optional< std::uint32_t > rpc::parseStringAsUInt ( std::string const & value)

Parse the string as a uint32_t.

Parameters
valueThe string to parse
Returns
The parsed value or std::nullopt if the string is not a valid uint32_t

◆ parseTaker()

std::variant< Status, ripple::AccountID > rpc::parseTaker ( boost::json::value const & taker)

Parse the taker from the request.

Parameters
takerThe taker as json
Returns
The taker account or an error status

◆ postProcessOrderBook()

boost::json::array rpc::postProcessOrderBook ( std::vector< data::LedgerObject > const & offers,
ripple::Book const & book,
ripple::AccountID const & takerID,
data::BackendInterface const & backend,
std::uint32_t ledgerSequence,
boost::asio::yield_context yield )

Post process an order book.

Parameters
offersThe offers
bookThe book
takerIDThe taker ID
backendThe backend to use
ledgerSequenceThe ledger sequence
yieldThe coroutine context
Returns
The post processed order book

◆ read()

std::shared_ptr< ripple::SLE const > rpc::read ( std::shared_ptr< data::BackendInterface const > const & backend,
ripple::Keylet const & keylet,
ripple::LedgerHeader const & lgrInfo,
web::Context const & context )

Read SLE from the backend.

Parameters
backendThe backend to use
keyletThe keylet to read
lgrInfoThe ledger header
contextThe context of the request
Returns
The SLE or nullptr if not found

◆ specifiesCurrentOrClosedLedger()

bool rpc::specifiesCurrentOrClosedLedger ( boost::json::object const & request)

Check whethe the request specifies the current or closed ledger.

Parameters
requestThe request to check
Returns
true if the request specifies the current or closed ledger

◆ tag_invoke() [1/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountChannelsHandler::ChannelResponse const & channel )
Parameters
[out]jvThe JSON object to convert to
channelThe channel response to convert

◆ tag_invoke() [2/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountChannelsHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [3/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountCurrenciesHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [4/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountInfoHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [5/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountLinesHandler::LineResponse const & line )
Parameters
[out]jvThe JSON object to convert to
lineThe line response to convert

◆ tag_invoke() [6/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountLinesHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [7/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountNFTsHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [8/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountObjectsHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [9/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountOffersHandler::Offer const & offer )
Parameters
[out]jvThe JSON object to convert to
offerThe offer to convert

◆ tag_invoke() [10/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountOffersHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [11/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountTxHandler::Marker const & marker )
Parameters
[out]jvThe JSON object to convert to
markerThe marker to convert

◆ tag_invoke() [12/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AccountTxHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [13/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
AMMInfoHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [14/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
BookChange const & change )
inline

Implementation of value_from for BookChange type.

Parameters
[out]jvThe JSON value to populate
changeThe BookChange to serialize

◆ tag_invoke() [15/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
BookChangesHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [16/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
BookOffersHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [17/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
DepositAuthorizedHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [18/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
FeatureHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [19/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
FeatureHandler::Output::Feature const & feature )
Parameters
[out]jvThe JSON object to convert to
featureThe feature to convert

◆ tag_invoke() [20/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
GatewayBalancesHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [21/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
GetAggregatePriceHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [22/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
LedgerDataHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [23/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
LedgerEntryHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [24/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
LedgerHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [25/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
LedgerIndexHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [26/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
LedgerRangeHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [27/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
MPTHoldersHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [28/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
NFTHistoryHandler::Marker const & marker )
Parameters
[out]jvThe JSON object to convert to
markerThe marker to convert

◆ tag_invoke() [29/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
NFTHistoryHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [30/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
NFTInfoHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [31/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
NFTOffersHandlerBase::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [32/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
NFTsByIssuerHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [33/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
NoRippleCheckHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [34/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
RandomHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [35/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
SubscribeHandler::Output const & output )
Parameters
jvThe json value to convert to
outputThe output to convert from

◆ tag_invoke() [36/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
TransactionEntryHandler::Output const & output )
Parameters
[out]jvThe JSON object to convert to
outputThe output to convert

◆ tag_invoke() [37/66]

void rpc::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
VoidOutput const &  )
inline

Convert an empty output to a JSON object.

Note
Always generates empty JSON object
Parameters
[out]jvThe JSON object to convert to

◆ tag_invoke() [38/66]

AccountChannelsHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< AccountChannelsHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [39/66]

AccountCurrenciesHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< AccountCurrenciesHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [40/66]

AccountInfoHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< AccountInfoHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [41/66]

AccountLinesHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< AccountLinesHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [42/66]

AccountNFTsHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< AccountNFTsHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [43/66]

AccountObjectsHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< AccountObjectsHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [44/66]

AccountOffersHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< AccountOffersHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [45/66]

AccountTxHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< AccountTxHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [46/66]

AMMInfoHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< AMMInfoHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [47/66]

BookChangesHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< BookChangesHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [48/66]

BookOffersHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< BookOffersHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [49/66]

DepositAuthorizedHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< DepositAuthorizedHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [50/66]

FeatureHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< FeatureHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [51/66]

GatewayBalancesHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< GatewayBalancesHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [52/66]

GetAggregatePriceHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< GetAggregatePriceHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [53/66]

JsonBool rpc::tag_invoke ( boost::json::value_to_tag< JsonBool > const & ,
boost::json::value const & jsonValue )
inline

Convert a JSON value to a JsonBool.

Parameters
jsonValueThe JSON value to convert
Returns
The converted JsonBool

◆ tag_invoke() [54/66]

LedgerDataHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< LedgerDataHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [55/66]

LedgerEntryHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< LedgerEntryHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [56/66]

LedgerHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< LedgerHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [57/66]

LedgerIndexHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< LedgerIndexHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [58/66]

MPTHoldersHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< MPTHoldersHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [59/66]

NFTHistoryHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< NFTHistoryHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [60/66]

NFTInfoHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< NFTInfoHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [61/66]

NFTOffersHandlerBase::Input rpc::tag_invoke ( boost::json::value_to_tag< NFTOffersHandlerBase::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [62/66]

NFTsByIssuerHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< NFTsByIssuerHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [63/66]

NoRippleCheckHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< NoRippleCheckHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [64/66]

SubscribeHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< SubscribeHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe json value to convert from
Returns
The input to convert to

◆ tag_invoke() [65/66]

TransactionEntryHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< TransactionEntryHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
Input parsed from the JSON object

◆ tag_invoke() [66/66]

UnsubscribeHandler::Input rpc::tag_invoke ( boost::json::value_to_tag< UnsubscribeHandler::Input > ,
boost::json::value const & jv )
Parameters
jvThe JSON object to convert
Returns
The Input object

◆ toBoostJson()

boost::json::value rpc::toBoostJson ( RippledJson const & value)

Convert a RippledJson to boost::json::value.

Parameters
valueThe RippledJson to convert
Returns
The JSON value

◆ toExpandedJson()

std::pair< boost::json::object, boost::json::object > rpc::toExpandedJson ( data::TransactionAndMetadata const & blobs,
std::uint32_t apiVersion,
NFTokenjson nftEnabled = NFTokenjson::DISABLE,
std::optional< uint16_t > networkId = std::nullopt )

Convert a TransactionAndMetadata to two JSON objects.

Parameters
blobsThe TransactionAndMetadata to convert
apiVersionThe api version to generate the JSON for
nftEnabledWhether to include NFT information in the JSON
networkIdThe network ID to use for ctid, not include ctid if nullopt
Returns
The JSON objects

◆ toJson() [1/4]

boost::json::object rpc::toJson ( ripple::LedgerHeader const & info,
bool binary,
std::uint32_t apiVersion )

Convert a LedgerHeader to JSON object.

Parameters
infoThe LedgerHeader to convert.
binaryWhether to convert in hex format.
apiVersionThe api version
Returns
The JSON object.

◆ toJson() [2/4]

boost::json::object rpc::toJson ( ripple::SLE const & sle)

Convert SLE to JSON.

Parameters
sleThe ledger entry to convert
Returns
The JSON object

◆ toJson() [3/4]

boost::json::object rpc::toJson ( ripple::STBase const & obj)

Convert STBase object to JSON.

Parameters
objThe object to convert
Returns
The JSON object

◆ toJson() [4/4]

boost::json::object rpc::toJson ( ripple::TxMeta const & meta)

Convert a TxMeta to JSON object.

Parameters
metaThe TxMeta to convert.
Returns
The JSON object.

◆ toJsonWithBinaryTx()

boost::json::object rpc::toJsonWithBinaryTx ( data::TransactionAndMetadata const & txnPlusMeta,
std::uint32_t apiVersion )

Convert a TransactionAndMetadata to JSON object containing tx and metadata data in hex format. According to the apiVersion, the key is "tx_blob" and "meta" or "meta_blob".

Parameters
txnPlusMetaThe TransactionAndMetadata to convert.
apiVersionThe api version
Returns
The JSON object containing tx and metadata data in hex format.

◆ transferRate()

ripple::Rate rpc::transferRate ( BackendInterface const & backend,
std::uint32_t sequence,
ripple::AccountID const & issuer,
boost::asio::yield_context yield )

Get the transfer rate.

Parameters
backendThe backend to use
sequenceThe sequence
issuerThe issuer
yieldThe coroutine context
Returns
The transfer rate

◆ traverseNFTObjects()

std::variant< Status, AccountCursor > rpc::traverseNFTObjects ( BackendInterface const & backend,
std::uint32_t sequence,
ripple::AccountID const & accountID,
ripple::uint256 nextPage,
std::uint32_t limit,
boost::asio::yield_context yield,
std::function< void(ripple::SLE)> atOwnedNode )

Traverse NFT objects and call the callback for each owned node.

Parameters
backendThe backend to use
sequenceThe sequence
accountIDThe account ID
nextPageThe next page
limitThe limit
yieldThe coroutine context
atOwnedNodeThe function to call for each owned node
Returns
The account cursor or an error status

◆ traverseOwnedNodes() [1/2]

std::variant< Status, AccountCursor > rpc::traverseOwnedNodes ( BackendInterface const & backend,
ripple::AccountID const & accountID,
std::uint32_t sequence,
std::uint32_t limit,
std::optional< std::string > jsonCursor,
boost::asio::yield_context yield,
std::function< void(ripple::SLE)> atOwnedNode,
bool nftIncluded = false )

Traverse nodes owned by an account.

Note
Like the other one but removes the account check
Parameters
backendThe backend to use
accountIDThe account ID
sequenceThe sequence
limitThe limit of nodes to traverse
jsonCursorThe optional JSON cursor
yieldThe coroutine context
atOwnedNodeThe function to call for each owned node
nftIncludedWhether to include NFTs
Returns
The status or the account cursor

◆ traverseOwnedNodes() [2/2]

std::variant< Status, AccountCursor > rpc::traverseOwnedNodes ( BackendInterface const & backend,
ripple::Keylet const & owner,
ripple::uint256 const & hexMarker,
std::uint32_t startHint,
std::uint32_t sequence,
std::uint32_t limit,
boost::asio::yield_context yield,
std::function< void(ripple::SLE)> atOwnedNode )

Traverse nodes owned by an account.

Parameters
backendThe backend to use
ownerThe keylet of the owner
hexMarkerThe marker
startHintThe start hint
sequenceThe sequence
limitThe limit of nodes to traverse
yieldThe coroutine context
atOwnedNodeThe function to call for each owned node
Returns
The status or the account cursor

◆ xrpLiquid()

ripple::XRPAmount rpc::xrpLiquid ( BackendInterface const & backend,
std::uint32_t sequence,
ripple::AccountID const & id,
boost::asio::yield_context yield )

Get the XRP liquidity.

Parameters
backendThe backend to use
sequenceThe sequence
idThe account ID
yieldThe coroutine context
Returns
The XRP liquidity