|
Clio
develop
The XRP Ledger API server.
|
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 | AccountMPTokenIssuancesHandler |
| The account_mptoken_issuances method returns information about all MPTokenIssuance objects the account has created. More... | |
| class | AccountMPTokensHandler |
| The account_mptokens method returns information about the MPTokens the account currently holds. More... | |
| class | AccountNFTsHandler |
| The account_nfts method returns a list of NFToken objects for the specified account. 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... | |
| 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 | DelegateTransactionFilter |
| Delegate transaction filter to filter txn based on permission delegate. More... | |
| class | DepositAuthorizedHandler |
| Handles the deposit_authorized command. More... | |
| class | FeatureHandler |
| Contains common functionality for handling the server_info 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 | Label |
| Class representing a Prometheus label. More... | |
| class | Labels |
| Class representing a collection of Prometheus labels. 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 latest 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 holders of a particular MPTokenIssuance. More... | |
| class | MPTokenIssuanceHistoryHandler |
| The mptoken_issuance_history command returns past transactions associated with the queried MPTokenIssuance, optionally filtered by an affected account and/or transaction type. 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 | Reportable |
| An interface for any class providing a report as json object. 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... | |
| struct | RPCCenter |
| Registry of RPC commands supported by Clio. More... | |
| class | RPCEngine |
| The RPC engine that ties all RPC-related functionality together. 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 | TransactionFilter |
| Interface for filtering transactions. More... | |
| class | TxHandler |
| The tx method retrieves information on a single transaction, by its identifying hash. 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 | VaultInfoHandler |
| The vault_info command retrieves information about a vault, currency, shares etc. 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... | |
| class | WorkQueue |
| An asynchronous, thread-safe queue for RPC requests. More... | |
Concepts | |
| 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 | SomeHandlerWithTypedInput |
| Specifies what a Handler validated by the shared consteval spec must provide. | |
| concept | SomeHandlerWithoutInput |
| Specifies what a Handler without Input must provide. | |
| concept | SomeHandler |
| Specifies what a Handler type must provide. | |
Typedefs | |
| using | SpecView = spec::RpcSpecView<spec::BoostJsonObjectView> |
| A type-erased view of a handler's spec, uniform across API versions. | |
| template<typename InputT> | |
| using | HandlerFor = spec::HandlerFor<InputT, boost::json::value> |
| The spec-driven base every typed handler inherits. | |
| 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 | DelegateFilter = rpc::spec::handlers::account_tx::DelegateFilter |
| The delegate filter used to narrow account_tx by delegation. | |
| using | ServerInfoHandler = BaseServerInfoHandler<Counters> |
| The server_info command asks the Clio server for a human-readable version of various information about the Clio server being queried. | |
| using | RippledJson = json::Value |
Enumerations | |
| enum class | NFTokenjson { ENABLE , DISABLE } |
| Enum for NFT json manipulation. | |
Functions | |
| std::pair< xrpl::STAmount, xrpl::STAmount > | getAmmPoolHolds (BackendInterface const &backend, data::AmendmentCenterInterface const &amendmentCenter, std::uint32_t sequence, xrpl::AccountID const &ammAccountID, xrpl::Issue const &issue1, xrpl::Issue const &issue2, bool freezeHandling, boost::asio::yield_context yield) |
| getAmmPoolHolds returns the balances of the amm asset pair | |
| xrpl::STAmount | getAmmLpHolds (BackendInterface const &backend, std::uint32_t sequence, xrpl::Issue const &iss1, xrpl::Issue const &iss2, xrpl::AccountID const &ammAccount, xrpl::AccountID const &lpAccount, boost::asio::yield_context yield) |
| getAmmLpHolds returns the liquidity provider token balance | |
| xrpl::STAmount | getAmmLpHolds (BackendInterface const &backend, std::uint32_t sequence, xrpl::SLE const &ammSle, xrpl::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 (xrpl::LedgerHeader const &lgrInfo, std::vector< data::TransactionAndMetadata > const &transactions) |
| Computes all book changes for the given ledger header and transactions. | |
| 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. | |
| std::ostream & | operator<< (std::ostream &stream, Status const &status) |
| Stream a Status in human readable form. | |
| ClioErrorInfo const & | getErrorInfo (ClioError code) |
| Get the error info object from an clio-specific error code. | |
| boost::json::object | makeError (XrpldError err, std::optional< std::string_view > customError=std::nullopt, std::optional< std::string_view > customMessage=std::nullopt) |
| Generate JSON from a rpc::XrpldError. | |
| 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, Status > | 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. | |
| std::expected< web::Context, Status > | 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. | |
| 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) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountInfoHandler::Output const &output) |
| 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, AccountMPTokenIssuancesHandler::Output const &output) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountMPTokenIssuancesHandler::MPTokenIssuanceResponse const &issuance) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountMPTokensHandler::Output const &output) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountMPTokensHandler::MPTokenResponse const &mptoken) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountNFTsHandler::Output const &output) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, AccountObjectsHandler::Output const &output) |
| 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) |
| 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, AMMInfoHandler::Output const &output) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, BookChangesHandler::Output const &output) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, BookOffersHandler::Output const &output) |
| 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) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, GatewayBalancesHandler::Output const &output) |
| 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) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, LedgerDataHandler::Output const &output) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, LedgerEntryHandler::Output const &output) |
| 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) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, MPTokenIssuanceHistoryHandler::Output const &output) |
| 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, NFTInfoHandler::Output const &output) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, NFTOffersHandlerBase::Output const &output) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, NFTsByIssuerHandler::Output const &output) |
| 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) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, TransactionEntryHandler::Output const &output) |
| void | tag_invoke (boost::json::value_from_tag, boost::json::value &jv, VaultInfoHandler::Output const &output) |
| std::optional< AccountCursor > | parseAccountCursor (std::optional< std::string > jsonCursor) |
| Parse the account cursor from the JSON. | |
| std::optional< xrpl::STAmount > | getDeliveredAmount (std::shared_ptr< xrpl::STTx const > const &txn, std::shared_ptr< xrpl::TxMeta const > const &meta, std::uint32_t ledgerSequence, uint32_t date) |
| Get the delivered amount. | |
| bool | canHaveDeliveredAmount (std::shared_ptr< xrpl::STTx const > const &txn, std::shared_ptr< xrpl::TxMeta const > const &meta) |
| Whether the transaction can have a delivered amount. | |
| std::optional< xrpl::AccountID > | accountFromStringStrict (std::string const &account) |
| Get a xrpl::AccountID from its string representation. | |
| std::pair< std::shared_ptr< xrpl::STTx const >, std::shared_ptr< xrpl::STObject const > > | deserializeTxPlusMeta (data::TransactionAndMetadata const &blobs) |
| Deserialize a TransactionAndMetadata into a pair of STTx and STObject. | |
| std::pair< std::shared_ptr< xrpl::STTx const >, std::shared_ptr< xrpl::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 (xrpl::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< uint32_t > networkId=std::nullopt) |
| Convert a TransactionAndMetadata to two JSON objects. | |
| std::optional< std::string > | encodeCTID (uint32_t ledgerSeq, uint16_t txnIndex, uint32_t networkId) noexcept |
| Encode CTID as string. | |
| bool | insertDeliveredAmount (boost::json::object &metaJson, std::shared_ptr< xrpl::STTx const > const &txn, std::shared_ptr< xrpl::TxMeta const > const &meta, uint32_t date) |
| Add "DeliveredAmount" to the transaction json object. | |
| static std::optional< xrpl::uint192 > | getMPTIssuanceID (std::shared_ptr< xrpl::TxMeta const > const &meta) |
| Get the delivered amount. | |
| static bool | canHaveMPTIssuanceID (std::shared_ptr< xrpl::STTx const > const &txn, std::shared_ptr< xrpl::TxMeta const > const &meta) |
| Check if transaction has a new MPToken created. | |
| bool | insertMPTIssuanceID (boost::json::object &txnJson, std::shared_ptr< xrpl::STTx const > const &txn, boost::json::object &metaJson, std::shared_ptr< xrpl::TxMeta const > const &meta) |
| Add "mpt_issuance_id" into various MPTToken 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 (xrpl::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 (xrpl::SLE const &sle) |
| Convert SLE to JSON. | |
| boost::json::object | toJson (xrpl::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::expected< xrpl::LedgerHeader, Status > | ledgerHeaderFromRequest (std::shared_ptr< data::BackendInterface const > const &backend, web::Context const &ctx) |
| Get ledger info from the request. | |
| std::expected< xrpl::LedgerHeader, Status > | 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::expected< xrpl::LedgerHeader, Status > | getLedgerHeaderFromLedgerSpecifier (BackendInterface const &backend, boost::asio::yield_context yield, rpc::spec::LedgerSpecifier const &ledger, uint32_t maxSeq) |
| Get ledger header from a spec-library ledger specifier. | |
| std::vector< unsigned char > | ledgerHeaderToBlob (xrpl::LedgerHeader const &info, bool includeHash=false) |
| Convert a ledger header to a blob. | |
| std::uint64_t | getStartHint (xrpl::SLE const &sle, xrpl::AccountID const &accountID) |
| Get the start hint for the account. | |
| std::expected< AccountCursor, Status > | traverseNFTObjects (BackendInterface const &backend, std::uint32_t sequence, xrpl::AccountID const &accountID, xrpl::uint256 nextPage, std::uint32_t limit, boost::asio::yield_context yield, std::function< void(xrpl::SLE)> atOwnedNode) |
| Traverse NFT objects and call the callback for each owned node. | |
| std::expected< AccountCursor, Status > | traverseOwnedNodes (BackendInterface const &backend, xrpl::AccountID const &accountID, std::uint32_t sequence, std::uint32_t limit, std::optional< std::string > jsonCursor, boost::asio::yield_context yield, std::function< void(xrpl::SLE)> atOwnedNode, bool nftIncluded=false) |
| Traverse nodes owned by an account. | |
| std::expected< AccountCursor, Status > | traverseOwnedNodes (BackendInterface const &backend, xrpl::Keylet const &owner, xrpl::uint256 const &hexMarker, std::uint32_t startHint, std::uint32_t sequence, std::uint32_t limit, boost::asio::yield_context yield, std::function< void(xrpl::SLE)> atOwnedNode) |
| Traverse nodes owned by an account. | |
| std::shared_ptr< xrpl::SLE const > | read (std::shared_ptr< data::BackendInterface const > const &backend, xrpl::Keylet const &keylet, xrpl::LedgerHeader const &lgrInfo, web::Context const &context) |
| Read SLE from the backend. | |
| std::optional< xrpl::Seed > | parseRippleLibSeed (boost::json::value const &value) |
| Parse a ripple-lib seed. | |
| std::vector< xrpl::AccountID > | getAccountsFromTransaction (boost::json::object const &transaction) |
| Get the account associated with a transaction. | |
| bool | isGlobalFrozen (BackendInterface const &backend, std::uint32_t seq, xrpl::AccountID const &issuer, boost::asio::yield_context yield) |
| Whether global frozen is set. | |
| bool | fetchAndCheckAnyFlagsExists (BackendInterface const &backend, std::uint32_t sequence, xrpl::Keylet const &keylet, std::vector< std::uint32_t > const &flags, boost::asio::yield_context yield) |
| Fetches a ledger object and checks if any of the specified flag is set on the account. | |
| bool | isFrozen (BackendInterface const &backend, std::uint32_t sequence, xrpl::AccountID const &account, xrpl::Currency const ¤cy, xrpl::AccountID const &issuer, boost::asio::yield_context yield) |
| Whether the account is frozen. | |
| bool | isDeepFrozen (BackendInterface const &backend, std::uint32_t sequence, xrpl::AccountID const &account, xrpl::Currency const ¤cy, xrpl::AccountID const &issuer, boost::asio::yield_context yield) |
| Whether the trustline is deep frozen. | |
| bool | isLPTokenFrozen (BackendInterface const &backend, std::uint32_t sequence, xrpl::AccountID const &account, xrpl::Issue const &asset, xrpl::Issue const &asset2, boost::asio::yield_context yield) |
| Whether the account that owns a LPToken is frozen for the assets in the pool. | |
| xrpl::XRPAmount | xrpLiquid (BackendInterface const &backend, std::uint32_t sequence, xrpl::AccountID const &id, boost::asio::yield_context yield) |
| Get the XRP liquidity. | |
| xrpl::STAmount | accountFunds (BackendInterface const &backend, data::AmendmentCenterInterface const &amendmentCenter, std::uint32_t sequence, xrpl::STAmount const &amount, xrpl::AccountID const &id, boost::asio::yield_context yield) |
| Get the account funds. | |
| xrpl::STAmount | ammAccountHolds (BackendInterface const &backend, std::uint32_t sequence, xrpl::AccountID const &account, xrpl::Currency const ¤cy, xrpl::AccountID const &issuer, bool const zeroIfFrozen, boost::asio::yield_context yield) |
| Get the amount that an LPToken owner holds. | |
| xrpl::STAmount | accountHolds (BackendInterface const &backend, data::AmendmentCenterInterface const &amendmentCenter, std::uint32_t sequence, xrpl::AccountID const &account, xrpl::Currency const ¤cy, xrpl::AccountID const &issuer, bool zeroIfFrozen, boost::asio::yield_context yield) |
| Get the amount that an account holds. | |
| xrpl::Rate | transferRate (BackendInterface const &backend, std::uint32_t sequence, xrpl::AccountID const &issuer, boost::asio::yield_context yield) |
| Get the transfer rate. | |
| xrpl::STAmount | accountHoldsMPT (BackendInterface const &backend, std::uint32_t sequence, xrpl::AccountID const &account, xrpl::MPTIssue const &mptIssue, bool zeroIfFrozen, boost::asio::yield_context yield) |
| Get the amount that an account holds in MPT. | |
| boost::json::array | postProcessOrderBook (std::vector< data::LedgerObject > const &offers, xrpl::Book const &book, xrpl::AccountID const &takerID, data::BackendInterface const &backend, data::AmendmentCenterInterface const &amendmentCenter, std::uint32_t ledgerSequence, boost::asio::yield_context yield) |
| Post process an order book. | |
| std::expected< xrpl::Book, Status > | parseBook (xrpl::Currency pays, xrpl::AccountID payIssuer, xrpl::Currency gets, xrpl::AccountID getIssuer, std::optional< std::string > const &domain) |
| Parse the book from the request. | |
| std::expected< xrpl::Book, Status > | parseBook (xrpl::Asset const &pays, xrpl::Asset const &gets, std::optional< std::string > const &domain) |
| Parse the book from assets (supports both IOU and MPT). | |
| std::expected< xrpl::Book, Status > | parseBook (boost::json::object const &request) |
| Parse the book from the request. | |
| std::expected< xrpl::AccountID, Status > | parseTaker (boost::json::value const &taker) |
| Parse the taker from the request. | |
| xrpl::Issue | parseIssue (boost::json::object const &issue) |
| Parse the json object into a xrpl::Issue object. | |
| bool | specifiesCurrentOrClosedLedger (boost::json::object const &request) |
| Check whether 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::expected< xrpl::uint256, Status > | getNFTID (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 (xrpl::SLE const &sle, xrpl::AccountID const &accountID) |
| Check whether the SLE is owned by the account. | |
| boost::json::object | generatePubLedgerMessage (xrpl::LedgerHeader const &lgrInfo, xrpl::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 DurationType> | |
| void | logDuration (boost::json::object const &request, util::BaseTagDecorator const &tag, DurationType const &dur) |
| Log the duration of the request processing. | |
This namespace contains all the RPC logic and handlers.
| using rpc::HandlerFor = spec::HandlerFor<InputT, boost::json::value> |
The spec-driven base every typed handler inherits.
Binding the backend here, once, is what keeps handlers and call sites free of it: Handler::parseInput and Handler::spec are ordinary static members.
| InputT | The handler's request Input struct. |
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
| std::optional< xrpl::AccountID > rpc::accountFromStringStrict | ( | std::string const & | account | ) |
Get a xrpl::AccountID from its string representation.
| account | The string representation of the account |
| xrpl::STAmount rpc::accountFunds | ( | BackendInterface const & | backend, |
| data::AmendmentCenterInterface const & | amendmentCenter, | ||
| std::uint32_t | sequence, | ||
| xrpl::STAmount const & | amount, | ||
| xrpl::AccountID const & | id, | ||
| boost::asio::yield_context | yield ) |
Get the account funds.
| backend | The backend to use |
| amendmentCenter | The amendmentCenter to use |
| sequence | The sequence |
| amount | The amount |
| id | The account ID |
| yield | The coroutine context |
| xrpl::STAmount rpc::accountHolds | ( | BackendInterface const & | backend, |
| data::AmendmentCenterInterface const & | amendmentCenter, | ||
| std::uint32_t | sequence, | ||
| xrpl::AccountID const & | account, | ||
| xrpl::Currency const & | currency, | ||
| xrpl::AccountID const & | issuer, | ||
| bool | zeroIfFrozen, | ||
| boost::asio::yield_context | yield ) |
Get the amount that an account holds.
| backend | The backend to use |
| amendmentCenter | The amendmentCenter to use |
| sequence | The sequence |
| account | The account |
| currency | The currency |
| issuer | The issuer |
| zeroIfFrozen | Whether to return zero if frozen |
| yield | The coroutine context |
| xrpl::STAmount rpc::accountHoldsMPT | ( | BackendInterface const & | backend, |
| std::uint32_t | sequence, | ||
| xrpl::AccountID const & | account, | ||
| xrpl::MPTIssue const & | mptIssue, | ||
| bool | zeroIfFrozen, | ||
| boost::asio::yield_context | yield ) |
Get the amount that an account holds in MPT.
Mirrors xrpld's accountHolds(MPTIssue) as used by getBookPage. For the issuer the spendable amount is the issuance capacity (MaximumAmount - OutstandingAmount). For a holder it is the token balance, returned as zero if the holder's token is unauthorized while the issuance requires authorization (xrpld's AuthHandling::ZeroIfUnauthorized), and, when zeroIfFrozen is set, zero if the issuance or the token is locked.
| backend | The backend to use |
| sequence | The sequence |
| account | The account |
| mptIssue | The MPT issue |
| zeroIfFrozen | Whether to return zero if frozen |
| yield | The coroutine context |
| xrpl::STAmount rpc::ammAccountHolds | ( | BackendInterface const & | backend, |
| std::uint32_t | sequence, | ||
| xrpl::AccountID const & | account, | ||
| xrpl::Currency const & | currency, | ||
| xrpl::AccountID const & | issuer, | ||
| bool const | zeroIfFrozen, | ||
| boost::asio::yield_context | yield ) |
Get the amount that an LPToken owner holds.
| backend | The backend to use |
| sequence | The sequence |
| account | The account |
| currency | The currency |
| issuer | The issuer |
| zeroIfFrozen | Whether to return zero if frozen |
| yield | The coroutine context |
| bool rpc::canHaveDeliveredAmount | ( | std::shared_ptr< xrpl::STTx const > const & | txn, |
| std::shared_ptr< xrpl::TxMeta const > const & | meta ) |
Whether the transaction can have a delivered amount.
| txn | The transaction |
| meta | The metadata |
|
static |
Check if transaction has a new MPToken created.
| txn | The transaction object |
| meta | The metadata object |
|
nodiscard |
Computes all book changes for the given ledger header and transactions.
| lgrInfo | The ledger header |
| transactions | The vector of transactions with heir metadata |
|
inlinenoexcept |
Decode the CTID from a string or a uint64_t.
| T | The type of the CTID |
| ctid | The CTID to decode |
| std::pair< std::shared_ptr< xrpl::STTx const >, std::shared_ptr< xrpl::STObject const > > rpc::deserializeTxPlusMeta | ( | data::TransactionAndMetadata const & | blobs | ) |
Deserialize a TransactionAndMetadata into a pair of STTx and STObject.
| blobs | The TransactionAndMetadata to deserialize |
| std::pair< std::shared_ptr< xrpl::STTx const >, std::shared_ptr< xrpl::TxMeta const > > rpc::deserializeTxPlusMeta | ( | data::TransactionAndMetadata const & | blobs, |
| std::uint32_t | seq ) |
Deserialize a TransactionAndMetadata into a pair of STTx and TxMeta.
| blobs | The TransactionAndMetadata to deserialize |
| seq | The sequence number to set |
|
noexcept |
Encode CTID as string.
| ledgerSeq | The ledger sequence |
| txnIndex | The transaction index |
| networkId | The network ID |
| bool rpc::fetchAndCheckAnyFlagsExists | ( | BackendInterface const & | backend, |
| std::uint32_t | sequence, | ||
| xrpl::Keylet const & | keylet, | ||
| std::vector< std::uint32_t > const & | flags, | ||
| boost::asio::yield_context | yield ) |
Fetches a ledger object and checks if any of the specified flag is set on the account.
| backend | The backend to use |
| sequence | The sequence |
| keylet | The keylet representing the object |
| flags | The flags to check on the fetched SLE. |
| yield | The coroutine context |
| boost::json::object rpc::generatePubLedgerMessage | ( | xrpl::LedgerHeader const & | lgrInfo, |
| xrpl::Fees const & | fees, | ||
| std::string const & | ledgerRange, | ||
| std::uint32_t | txnCount ) |
Generate a JSON object to publish ledger message.
| lgrInfo | The ledger header |
| fees | The fees |
| ledgerRange | The ledger range |
| txnCount | The transaction count |
| std::vector< xrpl::AccountID > rpc::getAccountsFromTransaction | ( | boost::json::object const & | transaction | ) |
Get the account associated with a transaction.
| transaction | The transaction |
| xrpl::STAmount rpc::getAmmLpHolds | ( | BackendInterface const & | backend, |
| std::uint32_t | sequence, | ||
| xrpl::Issue const & | iss1, | ||
| xrpl::Issue const & | iss2, | ||
| xrpl::AccountID const & | ammAccount, | ||
| xrpl::AccountID const & | lpAccount, | ||
| boost::asio::yield_context | yield ) |
getAmmLpHolds returns the liquidity provider token balance
| backend | The backend to use |
| sequence | The sequence number to use |
| iss1 | The first issue |
| iss2 | The second issue |
| ammAccount | The amm account |
| lpAccount | The lp account |
| yield | The coroutine context |
| xrpl::STAmount rpc::getAmmLpHolds | ( | BackendInterface const & | backend, |
| std::uint32_t | sequence, | ||
| xrpl::SLE const & | ammSle, | ||
| xrpl::AccountID const & | lpAccount, | ||
| boost::asio::yield_context | yield ) |
getAmmLpHolds returns the liquidity provider token balance
| backend | The backend to use |
| sequence | The sequence number to use |
| ammSle | The amm ledger entry |
| lpAccount | The lp account |
| yield | The coroutine context |
| std::pair< xrpl::STAmount, xrpl::STAmount > rpc::getAmmPoolHolds | ( | BackendInterface const & | backend, |
| data::AmendmentCenterInterface const & | amendmentCenter, | ||
| std::uint32_t | sequence, | ||
| xrpl::AccountID const & | ammAccountID, | ||
| xrpl::Issue const & | issue1, | ||
| xrpl::Issue const & | issue2, | ||
| bool | freezeHandling, | ||
| boost::asio::yield_context | yield ) |
getAmmPoolHolds returns the balances of the amm asset pair
| backend | The backend to use |
| amendmentCenter | The amendmentCenter to use |
| sequence | The sequence number to use |
| ammAccountID | The amm account |
| issue1 | The first issue |
| issue2 | The second issue |
| freezeHandling | Whether to return zeroes for frozen accounts |
| yield | The coroutine context |
| std::optional< xrpl::STAmount > rpc::getDeliveredAmount | ( | std::shared_ptr< xrpl::STTx const > const & | txn, |
| std::shared_ptr< xrpl::TxMeta const > const & | meta, | ||
| std::uint32_t | ledgerSequence, | ||
| uint32_t | date ) |
Get the delivered amount.
| txn | The transaction |
| meta | The metadata |
| ledgerSequence | The sequence |
| date | The date of the ledger |
| ClioErrorInfo const & rpc::getErrorInfo | ( | ClioError | code | ) |
Get the error info object from an clio-specific error code.
| code | The error code |
| std::expected< xrpl::LedgerHeader, Status > 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.
| backend | The backend to use |
| yield | The coroutine context |
| ledgerHash | The optional ledger hash |
| ledgerIndex | The optional ledger index |
| maxSeq | The maximum sequence to search |
| std::expected< xrpl::LedgerHeader, Status > rpc::getLedgerHeaderFromLedgerSpecifier | ( | BackendInterface const & | backend, |
| boost::asio::yield_context | yield, | ||
| rpc::spec::LedgerSpecifier const & | ledger, | ||
| uint32_t | maxSeq ) |
Get ledger header from a spec-library ledger specifier.
The strong-typed counterpart of getLedgerHeaderFromHashOrSeq, for handlers whose spec produces a LedgerSpecifier instead of a ledger_hash / ledger_index pair. Behaviour matches that overload: a hash or sequence beyond maxSeq, or one absent from the backend, yields ledgerNotFound.
A validated shortcut resolves to maxSeq, which is what it means for a server that only serves validated data. An unspecified ledger resolves via LedgerSpecifier::resolved(), which the spec library fixes to validated for Clio.
current and closed name ledgers Clio does not hold, and yield invalidParams with ledgerIndexMalformed. specifiesCurrentOrClosedLedger diverts such requests to xrpld before dispatch, but only for methods xrpld can answer: ForwardingProxy::shouldForward returns early for Clio-only methods, so those arrive here with the shortcut intact. The spec does not reject the two shortcuts either, since xrpld needs them.
| backend | The backend to use |
| yield | The coroutine context |
| ledger | The ledger the request selected |
| maxSeq | The maximum sequence to search |
|
static |
Get the delivered amount.
| meta | The metadata |
| std::expected< xrpl::uint256, Status > rpc::getNFTID | ( | boost::json::object const & | request | ) |
Get the NFTID from the request.
| request | The request |
| std::uint64_t rpc::getStartHint | ( | xrpl::SLE const & | sle, |
| xrpl::AccountID const & | accountID ) |
Get the start hint for the account.
| sle | The ledger entry |
| accountID | The account ID |
| bool rpc::insertDeliveredAmount | ( | boost::json::object & | metaJson, |
| std::shared_ptr< xrpl::STTx const > const & | txn, | ||
| std::shared_ptr< xrpl::TxMeta const > const & | meta, | ||
| uint32_t | date ) |
Add "DeliveredAmount" to the transaction json object.
| metaJson | The metadata json object to add "DeliveredAmount" |
| txn | The transaction object |
| meta | The metadata object |
| date | The date of the ledger |
| 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.
| txJson | The transaction json object |
| apiVersion | The api version |
| bool rpc::insertMPTIssuanceID | ( | boost::json::object & | txnJson, |
| std::shared_ptr< xrpl::STTx const > const & | txn, | ||
| boost::json::object & | metaJson, | ||
| std::shared_ptr< xrpl::TxMeta const > const & | meta ) |
Add "mpt_issuance_id" into various MPTToken transaction json.
| txnJson | The transaction Json object |
| txn | The txn object |
| metaJson | The metadata Json object |
| meta | The metadata object |
| bool rpc::isAdminCmd | ( | std::string const & | method, |
| boost::json::object const & | request ) |
Check whether a request requires administrative privileges on rippled side.
| method | The method name to check |
| request | The request to check |
| bool rpc::isDeepFrozen | ( | BackendInterface const & | backend, |
| std::uint32_t | sequence, | ||
| xrpl::AccountID const & | account, | ||
| xrpl::Currency const & | currency, | ||
| xrpl::AccountID const & | issuer, | ||
| boost::asio::yield_context | yield ) |
Whether the trustline is deep frozen.
For deep freeze, (unlike regular freeze) we do not care which account has the high/low deep freeze flag. We only care about if the trustline is deep frozen or not.
| backend | The backend to use |
| sequence | The sequence |
| account | The account |
| currency | The currency |
| issuer | The issuer |
| yield | The coroutine context |
| bool rpc::isFrozen | ( | BackendInterface const & | backend, |
| std::uint32_t | sequence, | ||
| xrpl::AccountID const & | account, | ||
| xrpl::Currency const & | currency, | ||
| xrpl::AccountID const & | issuer, | ||
| boost::asio::yield_context | yield ) |
Whether the account is frozen.
| backend | The backend to use |
| sequence | The sequence |
| account | The account |
| currency | The currency |
| issuer | The issuer |
| yield | The coroutine context |
| bool rpc::isGlobalFrozen | ( | BackendInterface const & | backend, |
| std::uint32_t | seq, | ||
| xrpl::AccountID const & | issuer, | ||
| boost::asio::yield_context | yield ) |
Whether global frozen is set.
| backend | The backend to use |
| seq | The ledger sequence |
| issuer | The issuer |
| yield | The coroutine context |
| bool rpc::isLPTokenFrozen | ( | BackendInterface const & | backend, |
| std::uint32_t | sequence, | ||
| xrpl::AccountID const & | account, | ||
| xrpl::Issue const & | asset, | ||
| xrpl::Issue const & | asset2, | ||
| boost::asio::yield_context | yield ) |
Whether the account that owns a LPToken is frozen for the assets in the pool.
| backend | The backend to use |
| sequence | The sequence |
| account | The account |
| asset | The first asset in the pool |
| asset2 | The second asset in the pool |
| yield | The coroutine context |
| bool rpc::isOwnedByAccount | ( | xrpl::SLE const & | sle, |
| xrpl::AccountID const & | accountID ) |
Check whether the SLE is owned by the account.
| sle | The ledger entry |
| accountID | The account ID |
| std::expected< xrpl::LedgerHeader, Status > rpc::ledgerHeaderFromRequest | ( | std::shared_ptr< data::BackendInterface const > const & | backend, |
| web::Context const & | ctx ) |
Get ledger info from the request.
| backend | The backend to use |
| ctx | The context of the request |
| std::vector< unsigned char > rpc::ledgerHeaderToBlob | ( | xrpl::LedgerHeader const & | info, |
| bool | includeHash = false ) |
Convert a ledger header to a blob.
| info | The ledger header |
| includeHash | Whether to include the hash |
| void rpc::logDuration | ( | boost::json::object const & | request, |
| util::BaseTagDecorator const & | tag, | ||
| DurationType const & | dur ) |
Log the duration of the request processing.
| T | The type of the duration |
| request | The request to log |
| tag | The tag of the context of the request |
| dur | The duration to log |
| 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.
| err | The clio's custom error |
| customError | A custom error |
| customMessage | A custom message |
| boost::json::object rpc::makeError | ( | Status const & | status | ) |
Generate JSON from a rpc::Status.
| status | The status object |
| boost::json::object rpc::makeError | ( | XrpldError | err, |
| std::optional< std::string_view > | customError = std::nullopt, | ||
| std::optional< std::string_view > | customMessage = std::nullopt ) |
Generate JSON from a rpc::XrpldError.
| err | The rippled error |
| customError | A custom error |
| customMessage | A custom message |
| 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.
| yc | The coroutine context |
| request | The request as JSON object |
| tagFactory | A factory that provides tags to track requests |
| range | The ledger range that is available at request time |
| clientIp | The IP address of the connected client |
| apiVersionParser | A parser that is used to parse out the "api_version" field |
| isAdmin | Whether the connection has admin privileges |
| 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.
| yc | The coroutine context |
| request | The request as JSON object |
| session | The subscription context |
| tagFactory | A factory that provides tags to track requests |
| range | The ledger range that is available at request time |
| clientIp | The IP address of the connected client |
| apiVersionParser | A parser that is used to parse out the "api_version" field |
| isAdmin | Whether the request has admin privileges |
| std::ostream & rpc::operator<< | ( | std::ostream & | stream, |
| Status const & | status ) |
Stream a Status in human readable form.
Declared in rpcspec but implemented here: rendering a code needs Clio's getErrorInfo table and xrpl::rpc::getErrorInfo.
| stream | The stream to write to |
| status | The status to write |
|
inline |
Check if two MaybeError objects are equal.
| lhs | The first MaybeError object |
| rhs | The second MaybeError object |
| std::optional< AccountCursor > rpc::parseAccountCursor | ( | std::optional< std::string > | jsonCursor | ) |
Parse the account cursor from the JSON.
| jsonCursor | The JSON cursor |
| std::expected< xrpl::Book, Status > rpc::parseBook | ( | boost::json::object const & | request | ) |
Parse the book from the request.
| request | The request |
| std::expected< xrpl::Book, Status > rpc::parseBook | ( | xrpl::Asset const & | pays, |
| xrpl::Asset const & | gets, | ||
| std::optional< std::string > const & | domain ) |
Parse the book from assets (supports both IOU and MPT).
| pays | The asset to pay |
| gets | The asset to get |
| domain | The domain |
| std::expected< xrpl::Book, Status > rpc::parseBook | ( | xrpl::Currency | pays, |
| xrpl::AccountID | payIssuer, | ||
| xrpl::Currency | gets, | ||
| xrpl::AccountID | getIssuer, | ||
| std::optional< std::string > const & | domain ) |
Parse the book from the request.
| pays | The currency to pay |
| payIssuer | The issuer of the currency to pay |
| gets | The currency to get |
| getIssuer | The issuer of the currency to get |
| domain | The domain |
| xrpl::Issue rpc::parseIssue | ( | boost::json::object const & | issue | ) |
Parse the json object into a xrpl::Issue object.
| issue | The json object to parse. The accepted format is { "currency" : "USD", "issuer" : "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59" } or {"currency" : "XRP"} |
| raise | json::error exception if the json object is not in the accepted format. |
| std::optional< xrpl::Seed > rpc::parseRippleLibSeed | ( | boost::json::value const & | value | ) |
Parse a ripple-lib seed.
| value | JSON value to parse from |
| std::optional< std::uint32_t > rpc::parseStringAsUInt | ( | std::string const & | value | ) |
Parse the string as a uint32_t.
| value | The string to parse |
| std::expected< xrpl::AccountID, Status > rpc::parseTaker | ( | boost::json::value const & | taker | ) |
Parse the taker from the request.
| taker | The taker as json |
| boost::json::array rpc::postProcessOrderBook | ( | std::vector< data::LedgerObject > const & | offers, |
| xrpl::Book const & | book, | ||
| xrpl::AccountID const & | takerID, | ||
| data::BackendInterface const & | backend, | ||
| data::AmendmentCenterInterface const & | amendmentCenter, | ||
| std::uint32_t | ledgerSequence, | ||
| boost::asio::yield_context | yield ) |
Post process an order book.
| offers | The offers |
| book | The book |
| takerID | The taker ID |
| backend | The backend to use |
| amendmentCenter | The amendmentCenter to use |
| ledgerSequence | The ledger sequence |
| yield | The coroutine context |
| std::shared_ptr< xrpl::SLE const > rpc::read | ( | std::shared_ptr< data::BackendInterface const > const & | backend, |
| xrpl::Keylet const & | keylet, | ||
| xrpl::LedgerHeader const & | lgrInfo, | ||
| web::Context const & | context ) |
Read SLE from the backend.
| backend | The backend to use |
| keylet | The keylet to read |
| lgrInfo | The ledger header |
| context | The context of the request |
| bool rpc::specifiesCurrentOrClosedLedger | ( | boost::json::object const & | request | ) |
Check whether the request specifies the current or closed ledger.
| request | The request to check |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountChannelsHandler::ChannelResponse const & | channel ) |
| [out] | jv | The JSON object to convert to |
| channel | The channel response to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountChannelsHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountCurrenciesHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountInfoHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountLinesHandler::LineResponse const & | line ) |
| [out] | jv | The JSON object to convert to |
| line | The line response to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountLinesHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountMPTokenIssuancesHandler::MPTokenIssuanceResponse const & | issuance ) |
| [out] | jv | The JSON object to convert to |
| issuance | The MPTokenIssuance response to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountMPTokenIssuancesHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountMPTokensHandler::MPTokenResponse const & | mptoken ) |
| [out] | jv | The JSON object to convert to |
| mptoken | The MPToken response to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountMPTokensHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountNFTsHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountObjectsHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountOffersHandler::Offer const & | offer ) |
| [out] | jv | The JSON object to convert to |
| offer | The offer to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountOffersHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AccountTxHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| AMMInfoHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
|
inline |
Implementation of value_from for BookChange type.
| [out] | jv | The JSON value to populate |
| change | The BookChange to serialize |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| BookChangesHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| BookOffersHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| DepositAuthorizedHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| FeatureHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| FeatureHandler::Output::Feature const & | feature ) |
| [out] | jv | The JSON object to convert to |
| feature | The feature to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| GatewayBalancesHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| GetAggregatePriceHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| LedgerDataHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| LedgerEntryHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| LedgerHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| LedgerIndexHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| LedgerRangeHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| MPTHoldersHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| MPTokenIssuanceHistoryHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to. |
| output | The output to convert. |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| NFTHistoryHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| NFTInfoHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| NFTOffersHandlerBase::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| NFTsByIssuerHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| NoRippleCheckHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| RandomHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| SubscribeHandler::Output const & | output ) |
| jv | The json value to convert to |
| output | The output to convert from |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| TransactionEntryHandler::Output const & | output ) |
| [out] | jv | The JSON object to convert to |
| output | The output to convert |
| void rpc::tag_invoke | ( | boost::json::value_from_tag | , |
| boost::json::value & | jv, | ||
| VaultInfoHandler::Output const & | output ) |
| jv | The JSON object to convert to |
| output | The output to convert |
|
inline |
Convert an empty output to a JSON object.
| [out] | jv | The JSON object to convert to |
| boost::json::value rpc::toBoostJson | ( | RippledJson const & | value | ) |
Convert a RippledJson to boost::json::value.
| value | The RippledJson to convert |
| std::pair< boost::json::object, boost::json::object > rpc::toExpandedJson | ( | data::TransactionAndMetadata const & | blobs, |
| std::uint32_t | apiVersion, | ||
| NFTokenjson | nftEnabled = NFTokenjson::DISABLE, | ||
| std::optional< uint32_t > | networkId = std::nullopt ) |
Convert a TransactionAndMetadata to two JSON objects.
| blobs | The TransactionAndMetadata to convert |
| apiVersion | The api version to generate the JSON for |
| nftEnabled | Whether to include NFT information in the JSON |
| networkId | The network ID to use for ctid, not include ctid if nullopt |
| boost::json::object rpc::toJson | ( | xrpl::LedgerHeader const & | info, |
| bool | binary, | ||
| std::uint32_t | apiVersion ) |
Convert a LedgerHeader to JSON object.
| info | The LedgerHeader to convert. |
| binary | Whether to convert in hex format. |
| apiVersion | The api version |
| boost::json::object rpc::toJson | ( | xrpl::SLE const & | sle | ) |
Convert SLE to JSON.
| sle | The ledger entry to convert |
| boost::json::object rpc::toJson | ( | xrpl::STBase const & | obj | ) |
Convert STBase object to JSON.
| obj | The object to convert |
| boost::json::object rpc::toJson | ( | xrpl::TxMeta const & | meta | ) |
Convert a TxMeta to JSON object.
| meta | The TxMeta to convert. |
| 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".
| txnPlusMeta | The TransactionAndMetadata to convert. |
| apiVersion | The api version |
| xrpl::Rate rpc::transferRate | ( | BackendInterface const & | backend, |
| std::uint32_t | sequence, | ||
| xrpl::AccountID const & | issuer, | ||
| boost::asio::yield_context | yield ) |
Get the transfer rate.
| backend | The backend to use |
| sequence | The sequence |
| issuer | The issuer |
| yield | The coroutine context |
| std::expected< AccountCursor, Status > rpc::traverseNFTObjects | ( | BackendInterface const & | backend, |
| std::uint32_t | sequence, | ||
| xrpl::AccountID const & | accountID, | ||
| xrpl::uint256 | nextPage, | ||
| std::uint32_t | limit, | ||
| boost::asio::yield_context | yield, | ||
| std::function< void(xrpl::SLE)> | atOwnedNode ) |
Traverse NFT objects and call the callback for each owned node.
| backend | The backend to use |
| sequence | The sequence |
| accountID | The account ID |
| nextPage | The next page |
| limit | The limit |
| yield | The coroutine context |
| atOwnedNode | The function to call for each owned node |
| std::expected< AccountCursor, Status > rpc::traverseOwnedNodes | ( | BackendInterface const & | backend, |
| xrpl::AccountID const & | accountID, | ||
| std::uint32_t | sequence, | ||
| std::uint32_t | limit, | ||
| std::optional< std::string > | jsonCursor, | ||
| boost::asio::yield_context | yield, | ||
| std::function< void(xrpl::SLE)> | atOwnedNode, | ||
| bool | nftIncluded = false ) |
Traverse nodes owned by an account.
| backend | The backend to use |
| accountID | The account ID |
| sequence | The sequence |
| limit | The limit of nodes to traverse |
| jsonCursor | The optional JSON cursor |
| yield | The coroutine context |
| atOwnedNode | The function to call for each owned node |
| nftIncluded | Whether to include NFTs |
| std::expected< AccountCursor, Status > rpc::traverseOwnedNodes | ( | BackendInterface const & | backend, |
| xrpl::Keylet const & | owner, | ||
| xrpl::uint256 const & | hexMarker, | ||
| std::uint32_t | startHint, | ||
| std::uint32_t | sequence, | ||
| std::uint32_t | limit, | ||
| boost::asio::yield_context | yield, | ||
| std::function< void(xrpl::SLE)> | atOwnedNode ) |
Traverse nodes owned by an account.
| backend | The backend to use |
| owner | The keylet of the owner |
| hexMarker | The marker |
| startHint | The start hint |
| sequence | The sequence |
| limit | The limit of nodes to traverse |
| yield | The coroutine context |
| atOwnedNode | The function to call for each owned node |
| xrpl::XRPAmount rpc::xrpLiquid | ( | BackendInterface const & | backend, |
| std::uint32_t | sequence, | ||
| xrpl::AccountID const & | id, | ||
| boost::asio::yield_context | yield ) |
Get the XRP liquidity.
| backend | The backend to use |
| sequence | The sequence |
| id | The account ID |
| yield | The coroutine context |