Node API
Supported Chains
API Reference
XRP

XRP

XRP API is available on Web3 API platform (opens in a new tab).

The XRP Ledger (XRPL) is a decentralized blockchain optimized for fast, low-cost payments and asset transfers. It uses a federated consensus algorithm in which a trusted set of validators propose and agree on transactions; once 80%+ reach consensus, a new ledger is finalized in 3–5 seconds with deterministic finality. XRPL supports native issued assets, a built-in DEX, escrows, payment channels, and multi-signing.

In order for your Web3 application to interact with XRP — either by reading blockchain data or sending transactions to the network — it must connect to an XRP node. Developers interact with the blockchain using the methods provided by the API.

The API interaction follows the JSON-RPC (opens in a new tab) which is a stateless, light-weight remote procedure call (RPC) protocol. It defines several data structures and the rules around their processing. It is transport agnostic in that the concepts can be used within the same process, over sockets, over HTTP, or in other message-passing environments. It uses JSON (RFC 4627) as data format.

Methods supported

Account Methods:

An account in the XRP Ledger represents a holder of XRP and a sender of transactions. Use these methods to work with account info.

  • account_channels — retrieves a list of payment channels where the account is the source of the channel.
  • account_currencies — retrieves a list of currencies an account can send or receive.
  • account_info — retrieves basic data on the account.
  • account_lines — retrieves info on the account's trust lines.
  • account_nfts — retrieves a list of all NFTs for an account.
  • account_objects — retrieves all ledger objects owned by an account.
  • account_offers — retrieves info on the account's currency exchange offers.
  • account_tx — retrieves a list of transactions affecting an account.
  • gateway_balances — calculates total amounts issued by an account.
  • noripple_check — gets recommended changes to an account's Default Ripple and No Ripple settings.

Ledger Methods:

A ledger version contains a header, a transaction tree, and a state tree, which contain account settings, trustlines, balances, transactions, and other data. Use these methods to retrieve ledger info.

  • ledger — retrieves info on the ledger.
  • ledger_closed — retrieves the latest closed ledger version.
  • ledger_current — retrieves the current working ledger version.
  • ledger_data — retrieves the raw contents of a ledger version.
  • ledger_entry — retrieves a single item from a ledger version.

Transaction Methods:

Transactions are the only thing that can modify the shared state of the XRP Ledger. All business on the XRP Ledger takes the form of transactions. Use these methods to work with transactions.

  • simulate — executes a dry run of any transaction type to preview results and metadata.
  • submit — sends a transaction to the network.
  • submit_multisigned — sends a multi-signed transaction to the network.
  • transaction_entry — retrieves info on the transaction from a particular ledger version.
  • tx — retrieves info on the transaction from all the ledgers at hand.
  • tx_history — retrieves info on all recent transactions.

Path and Order Book Methods:

Paths define a way for payments to flow through intermediary steps on their way from sender to receiver. Paths enable cross-currency payments by connecting sender and receiver through order books. Use these methods to work with paths and other books.

  • amm_info — retrieves info on the Automated Market Maker (AMM) instance.
  • book_changes — retrieves information on order book changes.
  • book_offers — retrieves info on the currency exchange offers.
  • deposit_authorized — checks whether an account is authorized to send money directly to another account.
  • get_aggregate_price — calculates the aggregate price of specified Oracle instances.
  • nft_buy_offers — retrieves a list of all buy offers for the NFT specified.
  • nft_sell_offers — retrieves a list of all sell offers for the NFT specified.
  • ripple_path_find — finds a path for payment between two accounts, once.

Payment Channel Methods:

Payment channels are a tool for facilitating repeated, unidirectional payments, or temporary credit between two parties. Use these methods to work with payment channels.

Server Info Methods:

Use these methods to retrieve information about the current state of the rippled server.

  • fee — retrieves information on the transaction cost.
  • feature — retrieves information on the protocol amendments.
  • manifest — retrieves public information on a known validator.
  • server_definitions — retrieves an SDK-compatible definitions.json, generated from the rippled instance currently running.
  • server_info (rippled) — retrieves status of the server in human-readable format.
  • server_state — retrieves status of the server in machine-readable format.
  • version — retrieves API version information.

Clio Methods:

These API methods are provided only by the Clio server, not rippled.

  • server_info — retrieves status of the Clio server in human-readable format.
  • ledger — retrieves info on the ledger version.
  • mpt_holders — retrieves the holders of a given MPT issuance for a given ledger.
  • version — retrieves API version information.

Utility Methods:

Use these methods to perform convenient tasks, such as ping and random number generation.

  • ping — confirms connectivity with the server.
  • random — generates a random number.

Account Methods:

An account in the XRP Ledger represents a holder of XRP and a sender of transactions. Use these methods to work with account info.

account_channels

Retrieves a list of payment channels where the account is the source of the channel.

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. (A channel's "source" and "owner" are the same.) All information retrieved is relative to a particular version of the ledger.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • account (string — address (opens in a new tab); required): look up channels where this account is the channel’s owner/source.
    • destination_account (string — address (opens in a new tab); optional): a second account; if provided, filters results to payment channels whose destination is this account.
    • ledger_hash (string; optional): the unique hash of the ledger version to use (see Specifying Ledgers (opens in a new tab)).
    • ledger_index (number or string; optional): the ledger index (opens in a new tab) of the ledger to use, or a shortcut string to choose a ledger automatically (see Specifying Ledgers (opens in a new tab)).
    • limit (number; optional): limits the number of transactions to retrieve. Must be between 10 and 400; values outside this range are adjusted to the nearest valid value. Default: 200.
    • marker (string — marker (opens in a new tab); optional): value from a previous paginated response; resumes retrieving data where that response left off.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • account (string): the address of the source/owner of the payment channels. Corresponds to the account field of the request.
  • channels (array of objects): list of payment channels owned by this account. Each object contains the following fields:
    • account (string): the owner of the channel, as an address (opens in a new tab).
    • channel_id (string): a unique ID for this channel, represented as a 64-character hexadecimal string. This is also the ID of the channel object (opens in a new tab) in the ledger’s state data.
    • destination_account (string): the destination account of the channel, as an address. Only this account can receive the amount in the channel while it is open.
    • settle_delay (unsigned integer): the number of seconds the payment channel must remain open after the owner requests to close it.
    • public_key (string; optional): the public key for the payment channel in the XRP Ledger’s base58 (opens in a new tab) format. Signed claims against this channel must be redeemed with the matching key pair.
    • public_key_hex (string; optional): the public key for the payment channel in hexadecimal format, if one was specified at channel creation. Signed claims against this channel must be redeemed with the matching key pair.
    • expiration (unsigned integer; optional): time in seconds since the Ripple Epoch (opens in a new tab) when this channel is set to expire. This expiration date is mutable. If this value is before the close time of the most recent validated ledger, the channel is expired.
    • cancel_after (unsigned integer; optional): time in seconds since the Ripple Epoch (opens in a new tab) representing this channel’s immutable expiration, if one was specified at creation. If this is before the close time of the most recent validated ledger, the channel is expired.
    • source_tag (unsigned integer; optional): a 32-bit unsigned integer used as a source tag (opens in a new tab) for payments through this payment channel, if specified at creation. This indicates the channel’s originator or purpose. Conventionally, if you bounce payments from this channel, you should include this value in the DestinationTag of the return payment.
    • destination_tag (unsigned integer; optional): a 32-bit unsigned integer used as a destination tag (opens in a new tab) for payments through this payment channel, if specified at creation. This indicates the payment channel’s beneficiary or purpose at the destination account.
  • ledger_hash (string; optional): the identifying hash (opens in a new tab) of the ledger version used to generate this response.
  • ledger_index (number): the ledger index (opens in a new tab) of the ledger version used to generate this response.
  • validated (boolean; optional): if true, the information in this response comes from a validated ledger version; otherwise, the information is subject to change.
  • limit (number; optional): the limit defining how many channel objects were actually returned by this request.
  • marker (string — marker (opens in a new tab); optional): server-defined value for pagination; pass this value to the next call to resume fetching results from where this call left off. Omitted when there are no more pages of data.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "account_channels",
      "params": [
        {
          "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
          "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
          "ledger_index": "validated"
        }
      ]
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
        "channels": [
            {
                "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
                "amount": "1000",
                "balance": "0",
                "channel_id": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7",
                "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
                "public_key": "aBR7mdD75Ycs8DRhMgQ4EMUEmBArF8SEh1hfjrT2V9DQTLNbJVqw",
                "public_key_hex": "03CFD18E689434F032A4E84C63E2A3A6472D684EAF4FD52CA67742F3E24BAE81B2",
                "settle_delay": 60
            }
        ],
        "ledger_hash": "42C4F4E81710B015B3BA2A81E357E30E261F58964A6AB6C012734FADB67AB40D",
        "ledger_index": 99672209,
        "status": "success",
        "validated": true
    }
}

account_currencies

Retrieves a list of currencies an account can send or receive.

The account_currencies command retrieves a list of currencies that an account can send or receive, based on its trust lines. This is not a thoroughly confirmed list, but it can be used to populate user interfaces.

Parameters

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "account_currencies",
      "params": [
        {
            "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
            "account_index": 0,
            "ledger_index": "validated"
        }
      ]
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ledger_hash": "26C97A5C542BB50D6C084EF158AC35AC4D3A94CEA57286F60552A2D55BC2DDCA",
        "ledger_index": 99672360,
        "receive_currencies": [
            "BTC",
            "CNY",
            "DYM",
            "EUR",
            "JOE",
            "MXN",
            "USD",
            "015841551A748AD2C1F76FF6ECB0CCCD00000000"
        ],
        "send_currencies": [
            "ASP",
            "BTC",
            "CHF",
            "CNY",
            "DYM",
            "EUR",
            "JOE",
            "JPY",
            "MXN",
            "USD",
            "5553445400000000000000000000000000000000"
        ],
        "status": "success",
        "validated": true
    }
}

account_info

Retrieves basic data on the account.

The account_info command retrieves information about an account, its activity, and its XRP balance. All information retrieved is relative to a particular version of the ledger.

Parameters

Returns

The response follows the standard format (opens in a new tab), with the result containing the requested account, its data, and a ledger to which it applies, as the following fields:

  • account_data (object): the AccountRoot ledger object (opens in a new tab) containing this account’s information as stored in the ledger.
  • account_flags (object): the account’s flag statuses, derived from the Flags field of the account. Contains the following nested fields:
  • signer_lists (array; optional):
    • API v1: omitted unless the request specified signer_lists and at least one SignerList is associated with the account. Contains an array of SignerList ledger objects for multi-signing. Since an account can own at most one SignerList, this array contains exactly one member if present. The field is nested under account_data.
    • API v2: identical to API v1, but the field is returned at the root level of the response. (Clio implements API v2 behavior in all cases.)
  • ledger_current_index (integer; optional): the ledger index of the current in-progress ledger used when retrieving this information. Omitted if ledger_index is provided instead.
  • ledger_index (integer; optional): the ledger index of the ledger version used to retrieve this information. This data does not include any changes from newer ledger versions.
  • queue_data (object; optional): information about queued transactions (opens in a new tab) sent by this account. Returned only if queue was set to true and the current open ledger was queried. Describes the local rippled server’s queue state, which may differ across the network. Some fields may be omitted because certain values are computed lazily by the queuing mechanism. Contains the following nested fields:
    • txn_count (integer): number of queued transactions from this address.
    • auth_change_queued (boolean; optional): whether a transaction in the queue changes this address’s ways of authorizing transactions (opens in a new tab). If true, no further transactions can be queued until that transaction executes or drops from the queue.
    • lowest_sequence (integer; optional): the lowest sequence number (opens in a new tab) among transactions queued by this address.
    • highest_sequence (integer; optional): the highest sequence number (opens in a new tab) among transactions queued by this address.
    • max_spend_drops_total (string; optional): the total number of drops of XRP (opens in a new tab) that could be debited from this account if every queued transaction consumes the maximum possible amount.
    • transactions (array; optional): information about each queued transaction from this account.
  • validated (boolean): true if this data originates from a validated ledger version; if omitted or false, the data is not final.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "account_info",
      "params": [
        {
            "account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
            "ledger_index": "current",
            "queue": true
        }
      ]
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "account_data": {
            "Account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
            "Balance": "88986679",
            "Flags": 1048576,
            "LedgerEntryType": "AccountRoot",
            "MessageKey": "0200000000000000000000000038901D3A772963CF12FF7C0E010FE350B6CCC45D",
            "OwnerCount": 0,
            "PreviousTxnID": "083A5D87E0E10D8632A62B67CCE8C68C0E94615371E92AD591CD068DE600117A",
            "PreviousTxnLgrSeq": 99424162,
            "RegularKey": "rhLkGGNZdjSpnHJw4XAFw1Jy7PD8TqxoET",
            "Sequence": 192223,
            "index": "92FA6A9FC8EA6018D5D16532D7795C91BFB0831355BDFDA177E86C8BF997985F"
        },
        "account_flags": {
            "allowTrustLineClawback": false,
            "defaultRipple": false,
            "depositAuth": false,
            "disableMasterKey": true,
            "disallowIncomingCheck": false,
            "disallowIncomingNFTokenOffer": false,
            "disallowIncomingPayChan": false,
            "disallowIncomingTrustline": false,
            "disallowIncomingXRP": false,
            "globalFreeze": false,
            "noFreeze": false,
            "passwordSpent": false,
            "requireAuthorization": false,
            "requireDestinationTag": false
        },
        "ledger_current_index": 99672810,
        "queue_data": {
            "txn_count": 0
        },
        "status": "success",
        "validated": false
    }
}

account_lines

Retrieves info on the account's trust lines.

The account_lines method returns information about an account's trust lines, which contain balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • account (string — address (opens in a new tab); required): look up trust lines connected to this account, from this account’s perspective.
    • ignore_default (boolean; optional): if true, omits trust lines where this account’s side is in the default state. Default: false.
    • ledger_hash (string — hash (opens in a new tab); optional): the unique hash of the ledger version to use (see Specifying Ledgers (opens in a new tab)).
    • ledger_index (number or string; optional): the ledger index (opens in a new tab) of the ledger version to use, or a shortcut string to choose a ledger automatically (see Specifying Ledgers (opens in a new tab)).
    • limit (number; optional): limits the number of trust lines to retrieve. Must be between 10 and 400. Values outside this range are adjusted to the nearest valid option. Default: 200.
    • marker (string — marker (opens in a new tab); optional): value from a previous paginated response; resumes retrieving data where that response left off.
    • peer (string — address (opens in a new tab); optional): a second account; if provided, filters results to trust lines connecting the two accounts.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the address of the account and an array of trust line objects. Specifically, the result object contains the following fields:

  • account (string): the unique address (opens in a new tab) of the account this request corresponds to — the perspective account for the listed trust lines.

  • lines (array of objects): array of trust line objects associated with the specified account. If the number of trust lines is large, only returns up to the limit at a time. Each object contains the following fields:

    • account (string — address (opens in a new tab)): the counterparty to this trust line.
    • balance (string — number (opens in a new tab)): the current balance held on this line.
      • A positive balance indicates that the perspective account holds value.
      • A negative balance indicates that the perspective account owes value.
    • currency (string — currency code): the currency code of the token that this trust line represents.
    • limit (string — number (opens in a new tab)): the maximum amount of the given currency that this account is willing to owe the peer account.
    • limit_peer (string — number (opens in a new tab)): the maximum amount of the given currency that the counterparty is willing to owe the perspective account.
    • quality_in (number): rate at which the account values incoming balances on this trust line, as a ratio of this value per 1 billion units. For example, a value of 500 million represents a 0.5:1 ratio. As a special case, 0 is treated as a 1:1 ratio.
    • quality_out (number): rate at which the account values outgoing balances on this trust line, as a ratio of this value per 1 billion units. For example, a value of 500 million represents a 0.5:1 ratio. As a special case, 0 is treated as a 1:1 ratio.
    • no_ripple (boolean; optional): if true, this account has enabled the No Ripple flag (opens in a new tab) for this trust line. If false, the flag is disabled, but this is not considered default (opens in a new tab) when Default Ripple is also disabled. If omitted, No Ripple is disabled and Default Ripple is enabled.
    • no_ripple_peer (boolean; optional): if true, the peer account has enabled the No Ripple flag (opens in a new tab) for this trust line. If false, the flag is disabled, but this is not considered default (opens in a new tab) when Default Ripple is also disabled. If omitted, No Ripple is disabled and Default Ripple is enabled.
    • authorized (boolean; optional): if true, the perspective account has authorized this trust line (opens in a new tab). Default: false.
    • peer_authorized (boolean; optional): if true, the counterparty has authorized this trust line (opens in a new tab). Default: false.
    • freeze (boolean; optional): if true, the perspective account has frozen this trust line (opens in a new tab). Default: false.
    • freeze_peer (boolean; optional): if true, the counterparty has frozen this trust line (opens in a new tab). Default: false.
  • ledger_current_index (integer; optional): the ledger index (opens in a new tab) used when retrieving this data. Present only when using an open ledger version.

  • ledger_index (integer; optional): the ledger index (opens in a new tab) used when retrieving this data. Present only when using a closed ledger version.

  • ledger_hash (string — hash (opens in a new tab); optional): the identifying hash of the ledger version used when retrieving this data. This field is only provided when using a closed ledger version.

  • marker (string — marker (opens in a new tab); optional): server-defined value indicating pagination; pass this to the next call to resume retrieving results from where this response ended. Omitted when there are no additional pages.

  • limit (number; optional): the maximum number of trust lines retrieved. The server may return fewer than the specified limit even if more results are available. Default: 200.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "account_lines",
      "params": [
        {
            "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
            "api_version": 2
        }
      ]
    }'

Response example

{
    "result": {
        "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
        "ledger_current_index": 99673270,
        "lines": [
            {
                "account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
                "balance": "0",
                "currency": "ASP",
                "limit": "0",
                "limit_peer": "10",
                "quality_in": 0,
                "quality_out": 0
            },
            {
                "account": "rE6R3DWF9fBD7CyiQciePF9SqK58Ubp8o2",
                "balance": "0",
                "currency": "JOE",
                "limit": "0",
                "limit_peer": "100",
                "no_ripple_peer": true,
                "quality_in": 0,
                "quality_out": 0
            }
        ],
        "status": "success",
        "validated": false
    }
}

account_nfts

Retrieves a list of all NFTs for an account.

The account_nfts method returns a list of NFToken objects for the specified account.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • account (string): the account that owns the list of NFTs.
  • account_nfts (array of objects): list of NFTs owned by the account. Each object represents one NFToken and includes the following fields:
    • Flags (number): a bitmap of boolean flags enabled for this NFToken. See NFToken Flags (opens in a new tab) for possible values.
    • Issuer (string — address (opens in a new tab)): the account that issued this NFToken.
    • NFTokenID (string): the unique identifier of this NFToken, represented as a hexadecimal string.
    • NFTokenTaxon (number): the unscrambled version of this token’s taxon (opens in a new tab). Tokens sharing the same taxon may represent multiple instances of a limited series.
    • URI (string): the URI data associated with this NFToken, represented in hexadecimal format.
    • nft_serial (number): the token sequence number of this NFToken, unique per issuer.
  • ledger_hash (string; optional): the identifying hash of the ledger version used to generate this response.
  • ledger_index (number; optional): the ledger index of the ledger version used to generate this response.
  • ledger_current_index (number; optional): the ledger index of the current in-progress ledger version used to generate this response.
  • validated (boolean): if true, the information in this response comes from a validated ledger version; otherwise, the information is subject to change.
  • marker (string — marker (opens in a new tab); optional): server-defined value indicating pagination. Pass this to the next call to resume fetching results from where this response ended. Omitted when there are no additional pages.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "account_nfts",
      "params": [
        {
          "account": "rpoYSH7mntUSWF41gD7RhJQzrNHxogAb6W"
        }
      ]
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "account": "rpoYSH7mntUSWF41gD7RhJQzrNHxogAb6W",
        "account_nfts": [],
        "ledger_current_index": 99893274,
        "status": "success",
        "validated": false
    }
}

account_objects

Retrieves all ledger objects owned by an account.

The account_objects command returns all ledger entries owned by an account, in their raw ledger format (opens in a new tab).

There are other API methods that are specialized for getting certain types of ledger entry, such as the account_lines method for trust lines, or account_offers method for offers. These methods provide a processed view of the data that is more suitable for typical use cases. Use account_objects if you want to get ledger entries of types that don't have a specialized method, or if you want to get the entries in their canonical format.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • account (string — address (opens in a new tab)): the account this request corresponds to.
  • account_objects (array of objects): array of ledger entries found in this account’s owner directory. Includes both:
    • Entries owned directly by this account, and
    • Entries linked to this account but owned by others (for example, escrows where this account is the destination).
    • Each member is a ledger entry in its raw ledger format (opens in a new tab). The number of entries may be fewer than the value specified in limit.
  • ledger_hash (string; optional): the identifying hash of the ledger used to generate this response.
  • ledger_index (number; optional): the ledger index (opens in a new tab) of the ledger version used to generate this response.
  • ledger_current_index (number; optional): the ledger index (opens in a new tab) of the open ledger version used to generate this response.
  • limit (number; optional): the limit value that was applied in this request, if specified.
  • marker (string — marker (opens in a new tab); optional): server-defined value indicating pagination. Pass this to the next call to resume retrieving data where this response ended. Omitted when there are no additional pages.
  • validated (boolean; optional): if true, the data in this response originates from a validated ledger version; otherwise, it may be subject to change.

The account_objects array may be empty even if there are additional ledger entries to retrieve. This is especially likely when using type to filter ledger entry types. If the response includes a marker field, there are additional pages of data; if the response does not include a marker, then this is the end of the data. This behavior is a consequence of how the API method iterates through the account's owner directory, and a precaution against requests putting excessive load on the server.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "account_objects",
      "params": [
        {
            "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
            "ledger_index": "validated",
            "type": "state",
            "deletion_blockers_only": false,
            "limit": 10
        }
      ]
    }'

Response example

{
    "result": {
        "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
        "account_objects": [
            {
                "Balance": {
                    "currency": "ASP",
                    "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
                    "value": "0"
                },
                "Flags": 65536,
                "HighLimit": {
                    "currency": "ASP",
                    "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
                    "value": "0"
                },
                "HighNode": "0",
                "LedgerEntryType": "RippleState",
                "LowLimit": {
                    "currency": "ASP",
                    "issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
                    "value": "10"
                },
                "LowNode": "0",
                "PreviousTxnID": "BF7555B0F018E3C5E2A3FF9437A1A5092F32903BE246202F988181B9CED0D862",
                "PreviousTxnLgrSeq": 1438879,
                "index": "2243B0B630EA6F7330B654EFA53E27A7609D9484E535AB11B7F946DF3D247CE9"
            }
        ],
        "ledger_hash": "3E5A1F0602C9699922CBE7BD3846D0C22A584867FFAF9787A1C676315F0797B0",
        "ledger_index": 99893571,
        "limit": 10,
        "marker": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93,94A9F05FEF9A153229E2E997E64919FD75AAE2028C8153E8EBDB4440BD3ECBB5",
        "status": "success",
        "validated": true
    }
}

account_offers

Retrieves info on the account's currency exchange offers.

The account_offers method retrieves a list of offers made by a given account that are outstanding as of a particular ledger version.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • account (string — address (opens in a new tab); required): Look up Offers placed by this account.
    • ledger_hash (hash (opens in a new tab); optional): The unique hash of the ledger version to use. (See Specifying Ledgers (opens in a new tab))
    • ledger_index (ledger index; optional): The ledger index (opens in a new tab) of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers (opens in a new tab))
    • limit (number; optional): Limit the number of Offers to retrieve. The server may return fewer than this number of results. Must be within the inclusive range 10 to 400. Positive values outside this range are replaced with the closest valid option. The default is 200.
    • marker (marker; optional): Value from a previous paginated response. Resume retrieving data where that response left off.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • account (string): Unique Address (opens in a new tab) identifying the account that made the offers.
  • offers (array): Array of objects, where each object represents an offer made by this account that is outstanding as of the requested ledger version. If the number of offers is large, only returns up to limit at a time.
  • ledger_current_index (number — ledger index (opens in a new tab); optional): Omitted if ledger_hash or ledger_index is provided. The ledger index of the current in-progress ledger version, which was used when retrieving this data.
  • ledger_index (number — ledger index (opens in a new tab); optional): Omitted if ledger_current_index is provided instead. The ledger index of the ledger version that was used when retrieving this data, as requested.
  • ledger_hash (string — hash (opens in a new tab); optional): The identifying hash of the ledger version that was used when retrieving this data.
  • marker (marker (opens in a new tab); optional): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. Omitted when there are no pages of information after this one.

Each offer object contains the following fields:

  • flags (unsigned integer): Options set for this offer entry as bit-flags.
  • seq (unsigned integer): Sequence number of the transaction that created this entry. (Transaction sequence numbers (opens in a new tab) are relative to accounts.)
  • taker_gets (string or object): The amount the account accepting the offer receives, as a String representing an amount in XRP, or a currency specification object. (See Specifying Currency Amounts (opens in a new tab)).
  • taker_pays (string or object): The amount the account accepting the offer provides, as a String representing an amount in XRP, or a currency specification object. (See Specifying Currency Amounts (opens in a new tab)).
  • quality (string): The exchange rate of the offer, as the ratio of the original taker_pays divided by the original taker_gets. When executing offers, the offer with the most favorable (lowest) quality is consumed first; offers with the same quality are executed from oldest to newest.
  • expiration (unsigned integer; optional): A time after which this offer is considered unfunded, as the number of seconds since the Ripple Epoch (opens in a new tab). See also: Offer Expiration (opens in a new tab).

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "account_offers",
      "params": [
        {
            "account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM"
        }
      ]
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM",
        "ledger_current_index": 99895001,
        "offers": [],
        "status": "success",
        "validated": false
    }
}

account_tx

Retrieves a list of transactions affecting an account.

The account_tx method retrieves a list of validated transactions that involve a given account.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • account (string; required): the unique identifier of the account, typically its address.
    • tx_type (string; optional): (Clio only) filters results to a specific transaction type (for example "Clawback", "AccountSet", "AccountDelete"). Case-insensitive. See Transaction Types (opens in a new tab).
    • ledger_index_min (integer; optional): earliest ledger index to include transactions from. A value of -1 uses the earliest validated ledger available.
    • ledger_index_max (integer; optional): most recent ledger index to include transactions from. A value of -1 uses the most recent validated ledger available.
    • ledger_hash (string — hash; optional): specifies a single ledger by its unique hash (see Specifying Ledgers (opens in a new tab)).
    • ledger_index (string or unsigned integer; optional): specifies a single ledger by its index or a shortcut keyword (see Specifying Ledgers (opens in a new tab)).
    • binary (boolean; optional): if true, returns transactions as hex strings instead of JSON. Default: false.
    • forward (boolean; optional): if true, returns results indexed with the oldest ledger first; otherwise, the newest ledger first. Each page may not be internally ordered, but pages overall follow the chosen order. Default: false.
    • limit (integer; optional): limits the number of transactions to retrieve. The default varies depending on server configuration. The server is not required to honor this value.
    • marker (string — marker (opens in a new tab); optional): value from a previous paginated response; resumes retrieving data where that response left off. Stable even if the server’s available ledger range changes.

Iterating over queried data:

As with other paginated methods, you can use the marker field to return multiple pages of data.

In the time between requests, "ledger_index_min": -1 and "ledger_index_max": -1 may change to refer to different ledger versions than they did before. The marker field can safely paginate even if there are changes in the ledger range from the request, so long as the marker does not indicate a point outside the range of ledgers specified in the request.

Returns

API v2

  • account (string): Unique Address (opens in a new tab) identifying the related account.
  • ledger_index_min (integer — ledger index (opens in a new tab)): The ledger index of the earliest ledger actually searched for transactions.
  • ledger_index_max (integer — ledger index (opens in a new tab)): The ledger index of the most recent ledger actually searched for transactions.
  • limit (integer): The limit value used in the request. (This may differ from the actual limit value enforced by the server.)
  • marker (string — marker (opens in a new tab)): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off.
  • transactions (array): Array of transactions matching the request's criteria, as explained below.
  • validated (boolean): If included and set to true, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change.

The server may respond with different values of ledger_index_min and ledger_index_max than you provided in the request, for example if it did not have the versions you specified on hand.

Each transaction object includes the following fields, depending on whether it was requested in JSON or hex string ("binary": true) format:

  • close_time_iso (string): The ledger close time represented in ISO 8601 time format.
  • hash (string): The unique hash identifier of the transaction.
  • ledger_hash (string): A hex string of the ledger version that included this transaction.
  • ledger_index (integer): The ledger index (opens in a new tab) of the ledger version that included this transaction.
  • tx_json (object — JSON): (JSON mode) JSON object defining the transaction.
  • tx_blob (string — binary): (Binary mode) A unique hex string defining the transaction.
  • meta (object — JSON): (JSON mode) The transaction results metadata in JSON.
  • meta_blob (string — binary): (Binary mode) The transaction results metadata as a hex string.
  • validated (boolean): Whether the transaction is included in a validated ledger or not. Any transaction not yet in a validated ledger is subject to change.

API v1

  • account (string): Unique Address (opens in a new tab) identifying the related account.
  • ledger_index_min (integer — ledger index (opens in a new tab)): The ledger index of the earliest ledger actually searched for transactions.
  • ledger_index_max (integer — ledger index (opens in a new tab)): The ledger index of the most recent ledger actually searched for transactions.
  • limit (integer): The limit value used in the request. (This may differ from the actual limit value enforced by the server.)
  • marker (string — marker (opens in a new tab)): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off.
  • transactions (array): Array of transactions matching the request's criteria, as explained below.
  • validated (boolean): If included and set to true, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change.

The server may respond with different values of ledger_index_min and ledger_index_max than you provided in the request, for example if it did not have the versions you specified on hand.

Each transaction object includes the following fields, depending on whether it was requested in JSON or hex string ("binary": true) format.

  • ledger_index (integer): The ledger index (opens in a new tab) of the ledger version that included this transaction.
  • tx (object — JSON): (JSON mode) JSON object defining the transaction.
  • tx_blob (string — binary): (Binary mode) Hex string representing the transaction.
  • meta (object — JSON or string — binary): If binary is true, then this is a hex string of the transaction results metadata. Otherwise, the transaction results metadata is included in JSON format.
  • validated (boolean): Whether the transaction is included in a validated ledger or not. Any transaction not yet in a validated ledger is subject to change.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "account_tx",
      "params": [
        {
            "account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
            "binary": false,
            "forward": false,
            "ledger_index_max": -1,
            "ledger_index_min": -1,
            "limit": 2,
            "api_version": 2
        }
      ]
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w",
        "ledger_index_max": 100184671,
        "ledger_index_min": 99766025,
        "limit": 2,
        "status": "success",
        "transactions": [],
        "validated": true
    }
}

gateway_balances

Calculates total amounts issued by an account.

The gateway_balances method calculates the total balances issued by a given account, optionally excluding amounts held by operational addresses (opens in a new tab).

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • account (string — address (opens in a new tab)): The address of the account that issued the balances.
  • obligations (object; omitted if empty): Total amounts issued to addresses not excluded, as a map of currencies to the total value issued.
  • balances (object; omitted if empty): Amounts issued to the hotwallet addresses from the request. The keys are addresses and the values are arrays of currency amounts they hold.
  • assets (object; omitted if empty): Total amounts held that are issued by others. In the recommended configuration, the issuing address (opens in a new tab) should have none.
  • ledger_hash (string — hash (opens in a new tab); optional): The identifying hash of the ledger version that was used to generate this response.
  • ledger_index (number — ledger index (opens in a new tab); optional): The ledger index of the ledger version that was used to generate this response.
  • ledger_current_index (number — ledger index (opens in a new tab); optional): (Omitted if ledger_current_index is provided). The ledger index (opens in a new tab) of the current in-progress ledger version, which was used to retrieve this information.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "gateway_balances",
      "params": [
        {
            "account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
            "hotwallet": [
                "rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ",
                "ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt"
            ],
            "ledger_index": "validated",
            "strict": true
        }
      ]
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "account": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
        "assets": {
            "r9F6wk8HkXrgYWoJ7fsv4VrUBVoqDVtzkH": [
                {
                    "currency": "BTC",
                    "value": "5444166510000000e-26"
                }
            ],
            "rPU6VbckqCLW4kb51CWqZdxvYyQrQVsnSj": [
                {
                    "currency": "BTC",
                    "value": "1029900000000000e-26"
                }
            ],
            "rpR95n1iFkTqpoy1e878f4Z1pVHVtWKMNQ": [
                {
                    "currency": "BTC",
                    "value": "4000000000000000e-30"
                }
            ],
            "rwmUaXsWtXU4Z843xSYwgt1is97bgY8yj6": [
                {
                    "currency": "BTC",
                    "value": "8700000000000000e-30"
                }
            ]
        },
        "balances": {
            "rKm4uWpg9tfwbVSeATv4KxDe6mpE9yPkgJ": [
                {
                    "currency": "EUR",
                    "value": "144816.1965999999"
                }
            ],
            "ra7JkEzrgeKHdzKgo4EUUVBnxggY4z37kt": [
                {
                    "currency": "USD",
                    "value": "6677.38614"
                }
            ]
        },
        "frozen_balances": {
            "r4keXr5myiU4iTLh68ZqZ2CgsJ8dM9FSW6": [
                {
                    "currency": "BTC",
                    "value": "0.091207822800868"
                }
            ]
        },
        "ledger_hash": "9F04F45FC6A7B4BE8DA04580F7E4E23DCCE58A9FD73178296CA70319C5B799F1",
        "ledger_index": 100185180,
        "obligations": {
            "BTC": "1761.964986208178",
            "EUR": "813788.3511514511",
            "GBP": "4973.797603049582",
            "USD": "6734902.401181124"
        },
        "status": "success",
        "validated": true
    }
}

noripple_check

Gets recommended changes to an account's Default Ripple and No Ripple settings.

The noripple_check command provides a quick way to check the status of the Default Ripple field for an account and the No Ripple flag of its trust lines (opens in a new tab), compared with the recommended settings.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • account (string): A unique identifier for the account, most commonly the account's address.
    • role (string): Whether the address refers to a gateway or user. Recommendations depend on the role of the account. Issuers must have Default Ripple enabled and must disable No Ripple on all trust lines. Users should have Default Ripple disabled, and should enable No Ripple on all trust lines.
    • transactions (boolean; optional): If true, include an array of suggested transactions (opens in a new tab), as JSON objects, that you can sign and submit to fix the problems. The default is false.
    • limit (unsigned integer; optional): The maximum number of trust line problems to include in the results. Defaults to 300.
    • ledger_hash (string; optional): The unique hash of the ledger version to use. (See Specifying Ledgers (opens in a new tab).)
    • ledger_index (string or unsigned integer; optional): The ledger index (opens in a new tab) of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers (opens in a new tab).)

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • ledger_current_index (number): The ledger index (opens in a new tab) of the ledger used to calculate these results.
  • problems (array): Array of strings with human-readable descriptions of the problems. This includes up to one entry if the account's Default Ripple setting is not as recommended, plus up to limit entries for trust lines whose No Ripple setting is not as recommended.
  • transactions (array; optional): If the request specified transactions as true, this is an array of JSON objects, each of which is the JSON form of a transaction (opens in a new tab) that should fix one of the described problems. The length of this array is the same as the problems array, and each entry is intended to fix the problem described at the same index into that array.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "noripple_check",
      "params": [
        {
            "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
            "ledger_index": "current",
            "limit": 2,
            "role": "gateway",
            "transactions": true
        }
      ]
    }'

Response example

{
    "result": {
        "ledger_current_index": 100203014,
        "problems": [
            "You should immediately set your default ripple flag",
            "You should clear the no ripple flag on your USD line to rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
            "You should clear the no ripple flag on your EUR line to rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun",
            "You should clear the no ripple flag on your CNY line to rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK",
            "You should clear the no ripple flag on your XAU line to r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
            "You should clear the no ripple flag on your 015841551A748AD2C1F76FF6ECB0CCCD00000000 line to rs9M85karFkCRjvc6KMWn8Coigm9cbcgcx",
            "You should clear the no ripple flag on your AUX line to r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z",
            "You should clear the no ripple flag on your CNY line to razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA",
            "You should clear the no ripple flag on your JPY line to rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
            "You should clear the no ripple flag on your USD line to rfF3PNkwkq1DygW2wum2HK3RGfgkJjdPVD",
            "You should clear the no ripple flag on your USD line to r9vbV3EHvXWjSkeQ6CAcYVPGeq7TuiXY2X"
        ],
        "status": "success",
        "transactions": [
            {
                "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
                "Fee": 10,
                "Sequence": 1406,
                "SetFlag": 8,
                "TransactionType": "AccountSet"
            },
            {
                "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
                "Fee": 10,
                "Flags": 262144,
                "LimitAmount": {
                    "currency": "USD",
                    "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q",
                    "value": "5"
                },
                "Sequence": 1407,
                "TransactionType": "TrustSet"
            }
        ],
        "validated": false
    }
}

Ledger Methods:

A ledger version contains a header, a transaction tree, and a state tree, which contain account settings, trustlines, balances, transactions, and other data. Use these methods to retrieve ledger info.

ledger

Retrieves info on the ledger.

Retrieves information about the public ledger (opens in a new tab).

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • ledger_hash (string — hash (opens in a new tab); optional): A 32-byte hex string for the ledger version to use. (See Specifying Ledgers (opens in a new tab)).
    • ledger_index (number or string; optional): The ledger index (opens in a new tab) of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers (opens in a new tab)).
    • transactions (boolean; optional): If true, return information on transactions in the specified ledger version. The default is false. Ignored if you did not specify a ledger version.
    • expand (boolean; optional): Provide full JSON-formatted information for transaction/account information instead of only hashes. The default is false. Ignored unless you request transactions, accounts, or both.
    • owner_funds (boolean; optional): If true, include owner_funds field in the metadata of OfferCreate transactions in the response. The default is false. Ignored unless transactions are included and expand is true.
    • binary (boolean; optional): If true, and transactions and expand are both also true, return transaction information in binary format (hexadecimal string) instead of JSON format.
    • queue (boolean; optional): If true, and the command is requesting the current ledger, includes an array of queued transactions (opens in a new tab) in the results.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing information about the ledger, including the following fields:

  • ledger (object): The complete ledger header data (opens in a new tab) of this ledger, with some additional fields added for convenience.
  • ledger.account_hash (string): Hash (opens in a new tab) of all account state information in this ledger, as hexadecimal.
  • ledger.close_flags (number): A bit-map of flags relating to the closing of this ledger (opens in a new tab).
  • ledger.close_time (number): The time this ledger was closed, in seconds since the Ripple Epoch (opens in a new tab).
  • ledger.close_time_human (string): The time this ledger was closed, in human-readable format. Always uses the UTC time zone.
  • ledger.close_time_resolution (number): Ledger close times are rounded to within this many seconds.
  • ledger.closed (boolean): Whether this ledger has been closed or not.
  • ledger.ledger_hash (string): Unique identifying hash of the entire ledger.
  • ledger.ledger_index (string — API v1 (opens in a new tab); number — API v2 (opens in a new tab)): The Ledger Index (opens in a new tab) of this ledger.
  • ledger.parent_close_time (number): The time at which the previous ledger was closed.
  • ledger.parent_hash (string): The unique identifying hash of the ledger that came immediately before this one, as hexadecimal.
  • ledger.total_coins (string): Total number of XRP drops in the network, as a quoted integer. (This decreases as transaction costs destroy XRP.)
  • ledger.transaction_hash (string): Hash (opens in a new tab) of the transaction information included in this ledger.
  • ledger.transactions (array; optional): Transactions applied in this ledger version. By default, members are the transactions’ identifying Hash (opens in a new tab) strings. If the request specified expand as true, members are full representations of the transactions instead, in either JSON or binary depending on whether the request specified binary as true.
  • ledger_hash (string): The unique identifying hash of the entire ledger, as hexadecimal.
  • ledger_index (number): The Ledger Index (opens in a new tab) of this ledger.
  • validated (boolean; optional): If true, this is a validated ledger version. If omitted or set to false, this ledger’s data is not final.
  • queue_data (array; optional): (Omitted unless requested with the queue parameter) Array of objects describing queued transactions, in the same order as the queue. If the request specified expand as true, members contain full representations of the transactions, in either JSON or binary depending on whether the request specified binary as true.

Each member of the queue_data array represents one transaction in the queue. Some fields of this object may be omitted because they have not yet been calculated. The fields of this object are as follows:

  • account (string): The Address (opens in a new tab) of the sender for this queued transaction.
  • tx (string or object): By default, this is a string containing the identifying hash of the transaction. If transactions are expanded in binary format, this is an object whose only field is tx_blob, containing the binary form of the transaction as a decimal string. If transactions are expanded in JSON format, this is an object containing the transaction object including the transaction's identifying hash in the hash field.
  • retries_remaining (number): How many times this transaction can be retried before being dropped.
  • preflight_result (string): The tentative result from preliminary transaction checking. This is always tesSUCCESS.
  • last_result (string; optional): If this transaction was left in the queue after getting a retriable (ter) result (opens in a new tab), this is the exact ter result code it got.
  • auth_change (boolean; optional): Whether this transaction changes this address's ways of authorizing transactions (opens in a new tab).
  • fee (string; optional): The Transaction Cost (opens in a new tab) of this transaction, in drops of XRP (opens in a new tab).
  • fee_level (string; optional): The transaction cost of this transaction, relative to the minimum cost for this type of transaction, in fee levels.
  • max_spend_drops (string; optional): The maximum amount of XRP, in drops (opens in a new tab), this transaction could potentially send or destroy.

If the request specified "owner_funds": true and expanded transactions, the response has a field owner_funds in the metaData object of each OfferCreate transaction (opens in a new tab). The purpose of this field is to make it easier to track the funding status of offers (opens in a new tab) with each new validated ledger. This field is defined slightly differently than the version of this field in Order Book subscription streams (opens in a new tab):

  • owner_funds (string): Numeric amount of the TakerGets currency that the Account sending this OfferCreate transaction has after the execution of all transactions in this ledger. This does not check whether the currency amount is frozen (opens in a new tab).

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger",
      "params": [
        {
            "ledger_index": "validated",
            "transactions": false,
            "expand": false,
            "owner_funds": false
        }
      ]
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ledger": {
            "account_hash": "E8C6EF996B38EFC2E297B3165F6B687433B1DF137BDCF804C0B0F9E393E0D045",
            "close_flags": 0,
            "close_time": 816442750,
            "close_time_human": "2025-Nov-14 13:39:10.000000000 UTC",
            "close_time_iso": "2025-11-14T13:39:10Z",
            "close_time_resolution": 10,
            "closed": true,
            "ledger_hash": "344AC8FCFC579E9EAC59CAFEBCC1E2EA36A261F4EB2A6CC649380C351F402397",
            "ledger_index": "100204822",
            "parent_close_time": 816442741,
            "parent_hash": "ADA5D8A5A554881A9E45A8EC88FBDADD5D4D47213F0FFBCE23001AD7E37B5768",
            "total_coins": "99985759346884737",
            "transaction_hash": "03E26EC74BFBEEFEBD19FD512A16809C1A165B1A2F9CFF4BFD987994FCA60334"
        },
        "ledger_hash": "344AC8FCFC579E9EAC59CAFEBCC1E2EA36A261F4EB2A6CC649380C351F402397",
        "ledger_index": 100204822,
        "status": "success",
        "validated": true
    }
}

ledger_closed

Retrieves the latest closed ledger version.

The ledger_closed method returns the unique identifiers of the most recently closed ledger. (This ledger is not necessarily validated and immutable yet.)

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_closed",
      "params": [
        {}
      ]
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ledger_hash": "3E6CF37B032E232ED6D77900C937647A275C8FE1F9F784F361B1022BB4608172",
        "ledger_index": 100204931,
        "status": "success"
    }
}

ledger_current

Retrieves the current working ledger version.

The ledger_current method returns the unique identifiers of the current in-progress ledger (opens in a new tab). This command is mostly useful for testing, because the ledger returned is still in flux.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following field:

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_current",
      "params": [
        {}
      ]
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ledger_current_index": 100205074,
        "status": "success"
    }
}

ledger_data

Retrieves the raw contents of a ledger version.

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.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • ledger_hash (string — hash (opens in a new tab); optional): A 20-byte hex string identifying the ledger version to use.
    • ledger_index (number or string; optional): The ledger index (opens in a new tab) of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers (opens in a new tab).)
    • binary (boolean; optional): If true, return ledger entries as hexadecimal strings instead of JSON. The default is false.
    • limit (number; optional): Limit the number of ledger entries to retrieve. The server may return fewer than this number of entries. Cannot be more than 2048 (when requesting binary) or 256 (when requesting JSON). Positive values outside this range are replaced with the closest valid option. The default is the maximum.
    • marker (string — marker (opens in a new tab); optional): Value from a previous paginated response. Resume retrieving data where that response left off.
    • type (string; optional): Filter results to a specific type of ledger entry. This field accepts canonical names of ledger entry types (opens in a new tab) (case-insensitive) or short names (opens in a new tab). If omitted, return ledger entries of all types.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • ledger_index (unsigned integer — ledger index (opens in a new tab)): The ledger index of this ledger version.
  • ledger_hash (string — hash (opens in a new tab)): Unique identifying hash of this ledger version.
  • state (array): Array of JSON objects containing data from the ledger's state tree, as defined below.
  • marker (string — marker (opens in a new tab)): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off.

If a type field is mentioned in the request, the state array will be empty if the first set of array objects does not match the type requested. In such cases, you can use the marker from this response to paginate and retrieve further data.

The format of each object in the state array depends on whether binary was set to true or not in the request. Each state object may include the following fields:

  • data (string): (Only included if "binary": true) Hex representation of the requested data.
  • LedgerEntryType (string): (Only included if "binary": false) String indicating what type of ledger object this object represents. See ledger object types (opens in a new tab) for the full list.
  • (Additional fields) (various): (Only included if "binary": false) Additional fields describing this object, depending on which ledger object type (opens in a new tab) it is.
  • index (string): Unique identifier for this ledger entry, as hex.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_data",
      "params": [
        {
            "binary": true,
            "ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
            "limit": 5
        }
      ]
    }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "error": "lgrNotFound",
        "error_code": 21,
        "error_message": "ledgerNotFound",
        "request": {
            "binary": true,
            "command": "ledger_data",
            "ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8",
            "limit": 5
        },
        "status": "error"
    }
}

ledger_entry

Retrieves a single item from a ledger version.

The ledger_entry method returns a single ledger entry from the XRP Ledger in its raw format. See ledger format (opens in a new tab) for information on the different types of entries you can retrieve.

Request format

This method can retrieve several distinct types of data. You can select which type of item to retrieve by passing the appropriate parameters, comprised of the general and type-specific fields listed below, and following the standard request formatting (opens in a new tab). (For example, a WebSocket request always has the command field and optionally an id field, and a JSON-RPC request uses the method and params fields.)

General fields

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • binary (boolean; optional): If true, return the requested ledger entry's contents as a hex string in the XRP Ledger's binary format (opens in a new tab). Otherwise, return data in JSON format. The default is false.
    • ledger_hash (string; optional): The unique hash of the ledger version to use. (See Specifying Ledgers (opens in a new tab).)
    • ledger_index (string or unsigned integer; optional): The ledger index (opens in a new tab) of the ledger to use, or a shortcut string (e.g. "validated", "closed", or "current") to choose a ledger automatically. (See Specifying Ledgers (opens in a new tab).)
    • include_deleted (boolean; optional, Clio servers only): If set to true and the queried object has been deleted, returns its complete data as it was prior to its deletion. If set to false or not provided, and the queried object has been deleted, returns objectNotFound (current behavior).

Specific fields

In addition to the general fields above, you must specify exactly 1 of the specific fields to indicate what type of entry to retrieve, along with its sub-fields as appropriate. The valid fields are:

Get Ledger Entry by ID

Retrieve any type of ledger entry by its unique ID.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
        {
            "index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4",
            "ledger_index": "validated"
        }
      ]
    }'
Response example
{
    "result": {
        "index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4",
        "ledger_hash": "0F7D2D0313C7A3D69433AEAB715D8034A7B5F9E07534FDEB211EBD25A99753DE",
        "ledger_index": 100449979,
        "node": {
            "Amendments": [
                "42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE",
                "4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373",
                "6781F8368C4771B83E8B821D88F580202BCB4228075297B19E4FDC5233F1EFDC",
                "740352F2412A9909880C23A559FCECEDA3BE2126FED62FC7660D628A06927F11"
            ],
            "Flags": 0,
            "LedgerEntryType": "Amendments",
            "PreviousTxnID": "14853FF2D09D198B576A531C50883C59D71474BA9072C1F5C0ED1DD57882B922",
            "PreviousTxnLgrSeq": 99226369,
            "index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4"
        },
        "status": "success",
        "validated": true
    }
}

Get AccountRoot Entry

Retrieve an AccountRoot entry by its address. This is roughly equivalent to the account_info method.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
        {
            "account_root": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
            "ledger_index": "validated"
        }
      ]
    }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
        "ledger_hash": "F12172CAE7E0B4E9283323ACFEC6FA41212A7B10F2D530FD0D891D4044533E01",
        "ledger_index": 100469352,
        "node": {
            "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
            "AccountTxnID": "932CC7E9BAC1F7B9FA5381679F293EEC0A646E5E7F2F6D14C85FEE2102F0E66C",
            "Balance": "1138222650",
            "Domain": "6D64756F31332E636F6D",
            "EmailHash": "98B4375E1D753E5B91627516F6D70977",
            "Flags": 9568256,
            "LedgerEntryType": "AccountRoot",
            "MessageKey": "0000000000000000000000070000000300",
            "OwnerCount": 17,
            "PreviousTxnID": "E5C3578BDBEBDCDE7E1697E3BA6A1CF04B17CCEBDE4939200680FEF530C7978E",
            "PreviousTxnLgrSeq": 94448149,
            "RegularKey": "rD9iJmieYHn8jTtPjwwkW2Wm9sVDvPXLoJ",
            "Sequence": 393,
            "TicketCount": 5,
            "TransferRate": 4294967295,
            "index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8"
        },
        "status": "success",
        "validated": true
    }
}

Get AMM Entry

Retrieve an Automated Market-Maker (AMM) object from the ledger. This is similar to amm_info method but the ledger_entry version returns only the ledger entry as stored.

Parameters
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
        {
          "amm": {
            "asset": {
              "currency": "string"
            },
            "asset2": {
              "currency" : "string",
              "issuer" : "string"
            }
          },
          "ledger_index": "string"
        }
      ]
    }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ledger_hash": "string",
        "ledger_index": integer,
        "node": {
            "LedgerEntryType": "string",
            "index": "string",
            "AMM": {
                "Asset": {
                    "currency": "string",
                    "issuer": "string"
                },
                "Asset2": {
                    "currency": "string",
                    "issuer": "string"
                },
                "LPTokenBalance": "string",
                "TradingFee": integer,
                "VoteSlots": [
                    {
                        "Account": "string",
                        "TradingFee": integer,
                        "VoteWeight": "string"
                    }
                ],
                "AuctionSlot": {
                    "Account": "string",
                    "Price": {
                        "value": "string",
                        "currency": "string",
                        "issuer": "string"
                    },
                    "Expiration": integer
                }
            },
            "Flags": integer
        },
        "validated": boolean
    }
}

Get Bridge Entry

(Requires the XChainBridge amendment (opens in a new tab).)

Retrieve a Bridge entry (opens in a new tab) which represents a single cross-chain bridge that connects the XRP Ledger with another blockchain.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • bridge_account (string): The account that submitted the XChainCreateBridge transaction on the blockchain.
    • bridge (object): The Bridge (opens in a new tab) to retrieve. Includes the door accounts and assets on the issuing and locking chain.
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
              "bridge_account": "string",
              "bridge": {
                  "locking_chain_door": "string",
                  "locking_chain_issue": {
                      "currency": "string",
                      "issuer": "string"
                  },
                  "issuing_chain_door": "string",
                  "issuing_chain_issue": {
                      "currency": "string",
                      "issuer": "string"
                  }
              }
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ledger_hash": "string",
        "ledger_index": integer,
        "node": {
            "LedgerEntryType": "string",
            "index": "string",
            "Bridge": {
                "LockingChainDoor": "string",
                "LockingChainIssue": {
                    "currency": "string",
                    "issuer": "string"
                },
                "IssuingChainDoor": "string",
                "IssuingChainIssue": {
                    "currency": "string",
                    "issuer": "string"
                }
            },
            "Flags": integer,
            "OwnerNode": "string"
        },
        "validated": boolean
    }
}

Get Credential Entry

Retrieve a Credential entry (opens in a new tab), which represents an attestation by one account about another account.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • credential (object or string; required): Specify the Credential to retrieve. If a string, must be the ledger entry ID of the entry, as hexadecimal. If an object, requires subject, issuer, and credential_type sub-fields.
      • credential.subject (string — address (opens in a new tab); required): The account that is the subject of the credential.
      • credential.issuer (string — address (opens in a new tab); required): The account that issued the credential.
      • credential.credential_type (string — hexadecimal; required): The type of the credential, as issued.
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "credential": {
              "subject": "string",
              "issuer": "string",
              "credential_type": "string"
            },
            "ledger_index": "validated"
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ledger_hash": "string",
        "ledger_index": integer,
        "node": {
            "LedgerEntryType": "string",
            "index": "string",
            "Credential": {
                "Subject": "string",
                "Issuer": "string",
                "CredentialType": "string"
            },
            "Flags": integer
        },
        "validated": boolean
    }
}

Get DirectoryNode Entry

Retrieve a DirectoryNode (opens in a new tab) which contains a list of other ledger objects. Can be provided as string (object ID of the Directory) or as an object.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • directory (object or string): The DirectoryNode (opens in a new tab) to retrieve. If a string, must be the object ID (opens in a new tab) of the directory, as hexadecimal. If an object, requires either dir_root or owner as a sub-field, plus optionally a sub_index sub-field.
      • directory.sub_index (unsigned integer; optional): If provided, jumps to a later "page" of the DirectoryNode (opens in a new tab).
      • directory.dir_root (string; optional): Unique index identifying the directory to retrieve, as a hex string.
      • directory.owner (string; optional): Unique address of the account associated with this directory.
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "directory": {
              "owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
              "sub_index": 0
            },
            "ledger_index": "validated"
          }
      ]
  }'
Response example
{
    "result": {
        "index": "3B9C0CE77FCE7BCEE1A68F1E26AC467AF326239D0D816CE705E4A0E2DAD03F6D",
        "ledger_hash": "C36B922A1D7453928D8477DCE0F512DC914F3DBC8C099780895588A412CFB31D",
        "ledger_index": 100471753,
        "node": {
            "Flags": 0,
            "Indexes": [
                "0D9D9CDDB28263938B423CE74FF3B4F6D960BA0F16EB7CEB36AB7937439ED73A",
                "28ADCBD6F9A4B18949EC5CDBB3411F1D5826ED0ECB149AE14AED6D8784EA39EE",
                "556B13E58990CC22D3379BCC6D55F46237F11713AD809DF3E7860DAB55B7F3EF",
                "6451BF1D41FCDA846C4B60E6F4E4914F1C4EC3015FF978642B7358A14DAE1C26",
                "6C3556BE2D440A3BEE999CC77657BA8F5DC473DFE44D4E11A8EE45B49F15FD4A",
                "731A16474E86C07C62B3042BD2C223ED85EBD54E3B540E7E2739187EF9B483BA"
            ],
            "LedgerEntryType": "DirectoryNode",
            "Owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
            "PreviousTxnID": "DDA5BDDF8DA08065B36548BE127730CB160B106DCCF9476ABB2FABE61BA3135C",
            "PreviousTxnLgrSeq": 94384123,
            "RootIndex": "3B9C0CE77FCE7BCEE1A68F1E26AC467AF326239D0D816CE705E4A0E2DAD03F6D",
            "index": "3B9C0CE77FCE7BCEE1A68F1E26AC467AF326239D0D816CE705E4A0E2DAD03F6D"
        },
        "status": "success",
        "validated": true
    }
}

Get Offer Entry

Retrieve an Offer entry (opens in a new tab) which defines an offer to exchange currency. Can be provided as string (unique index of the Offer) or as an object.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

  • offer (object or string): If a string, interpret as ledger entry ID (opens in a new tab) of the Offer to retrieve. If an object, requires the sub-fields account and seq to uniquely identify the offer.

Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "offer": {
              "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
              "seq": 359
            },
            "ledger_index": "validated"
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "index": "D0A063DEE0B0EC9522CF35CD55771B5DCAFA19A133EE46A0295E4D089AF86438",
        "ledger_hash": "9D360371ABE2F2FA4AFE1FB489988E752792185975CE1CEEFACE1B86CB327AAD",
        "ledger_index": 100471866,
        "node": {
            "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
            "BookDirectory": "5A70682882F317175860A1188FAFF2757537D1A66B8500894E038D7EA4C68000",
            "BookNode": "0",
            "Flags": 0,
            "LedgerEntryType": "Offer",
            "OwnerNode": "0",
            "PreviousTxnID": "2B44EBE00728D04658E597A85EC4F71D20503B31ABBF556764AD8F7A80BA72F6",
            "PreviousTxnLgrSeq": 18555460,
            "Sequence": 359,
            "TakerGets": "1000000000",
            "TakerPays": {
                "currency": "FOO",
                "issuer": "rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v",
                "value": "100"
            },
            "index": "D0A063DEE0B0EC9522CF35CD55771B5DCAFA19A133EE46A0295E4D089AF86438"
        },
        "status": "success",
        "validated": true
    }
}

Get Oracle Entry

Retrieve an Oracle entry (opens in a new tab) which represents a single price oracle that can store token prices.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • oracle (object; required): The oracle identifier.
      • oracle.account (string — address (opens in a new tab); required): The account that controls the Oracle object.
      • oracle.oracle_document_id (number; required): A unique identifier of the price oracle for the Account.
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "oracle" : {
              "account": "string",
              "oracle_document_id": number
            },
            "ledger_index": "string"
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ledger_hash": "string",
        "ledger_index": integer,
        "node": {
            "LedgerEntryType": "string",
            "index": "string",
            "Oracle": {
                "Account": "string",
                "OracleDocumentID": number,
                "URI": "string",
                "LastUpdateTime": integer,
                "PriceDataSeries": [
                    {
                        "Price": "string",
                        "Scale": integer,
                        "Timestamp": integer
                    }
                ]
            },
            "Flags": integer
        },
        "validated": boolean
    }
}

Get RippleState Entry

Retrieve a RippleState entry (opens in a new tab) which tracks a (non-XRP) currency balance between two accounts.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • state (object; optional): Alias to ripple_state.
    • ripple_state (object; optional): Object specifying the RippleState (trust line) object to retrieve. The accounts and currency sub-fields are required to uniquely specify the RippleState entry to retrieve.
      • ripple_state.accounts (array; required if ripple_state is specified): 2-length array of account Addresses (opens in a new tab), defining the two accounts linked by this RippleState entry.
      • ripple_state.currency (string; required if ripple_state is specified): Currency Code (opens in a new tab) of the RippleState entry to retrieve.
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "ripple_state": {
              "accounts": [
                "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
                "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW"
              ],
              "currency": "USD"
            },
            "ledger_index": "validated"
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "index": "9CA88CDEDFF9252B3DE183CE35B038F57282BC9503CDFA1923EF9A95DF0D6F7B",
        "ledger_hash": "03983977B9497B624E8A735205FFF3729A9F06B5C7384E59638B8147F648EDF8",
        "ledger_index": 100472021,
        "node": {
            "Balance": {
                "currency": "USD",
                "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
                "value": "0"
            },
            "Flags": 8847360,
            "HighLimit": {
                "currency": "USD",
                "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
                "value": "110"
            },
            "HighNode": "0",
            "LedgerEntryType": "RippleState",
            "LowLimit": {
                "currency": "USD",
                "issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
                "value": "0"
            },
            "LowNode": "0",
            "PreviousTxnID": "5E089C0CD4C52D3ECD85E5E1F38FC255F43FAFAF4FD5C42DD48A8A1B6C36DF5E",
            "PreviousTxnLgrSeq": 61168278,
            "index": "9CA88CDEDFF9252B3DE183CE35B038F57282BC9503CDFA1923EF9A95DF0D6F7B"
        },
        "status": "success",
        "validated": true
    }
}

Get Check Entry

Retrieve a Check entry (opens in a new tab) which is a potential payment that can be cashed by its recipient.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • check (string): The object ID of a Check entry to retrieve.
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "check": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB",
            "ledger_index": "validated"
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "index": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB",
        "ledger_hash": "FD563CE753BAC24A385EDC5875AD57BE9074F0B9C9C1397441BCFA2569960C9A",
        "ledger_index": 100472064,
        "node": {
            "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
            "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
            "DestinationNode": "0",
            "DestinationTag": 13,
            "Flags": 0,
            "LedgerEntryType": "Check",
            "OwnerNode": "0",
            "PreviousTxnID": "4E0AA11CBDD1760DE95B68DF2ABBE75C9698CEB548BEA9789053FCB3EBD444FB",
            "PreviousTxnLgrSeq": 61965653,
            "SendMax": {
                "currency": "USD",
                "issuer": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
                "value": "10"
            },
            "Sequence": 384,
            "index": "C4A46CCD8F096E994C4B0DEAB6CE98E722FC17D7944C28B95127C2659C47CBEB"
        },
        "status": "success",
        "validated": true
    }
}

Get Escrow Entry

Retrieve an Escrow entry (opens in a new tab) which holds XRP until a specific time or condition is met. Can be provided as string (object ID of the Escrow) or as an object.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • escrow (object or string): The Escrow to retrieve. If a string, must be the object ID (opens in a new tab) of the Escrow, as hexadecimal. If an object, requires owner and seq sub-fields.
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "escrow": {
              "owner": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK",
              "seq": 126
            },
            "ledger_index": "validated"
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "index": "917ACF1324F06D19239A03E4A6A3FE24F9313BB23337ECB801BDAD013BE27F83",
        "ledger_hash": "110D64E05F92F26624DAC3BC11294BD512306DEAE2F94717B7D6BA8ABB308361",
        "ledger_index": 100472121,
        "node": {
            "Account": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK",
            "Amount": "99750000",
            "Condition": "A0258020085D1EDF8045DC7F6E42B8DB09E05248502852FB3FF27815FC94433D1CB62198810120",
            "Destination": "rL4fPHi2FWGwRGRQSH7gBcxkuo2b9NTjKK",
            "FinishAfter": 3802143660,
            "Flags": 0,
            "LedgerEntryType": "Escrow",
            "OwnerNode": "1",
            "PreviousTxnID": "470DC630B0251FCCA740EA9CA7781A502608890FB123F14D0C4BE20C4D5D44DB",
            "PreviousTxnLgrSeq": 37088514,
            "index": "917ACF1324F06D19239A03E4A6A3FE24F9313BB23337ECB801BDAD013BE27F83"
        },
        "status": "success",
        "validated": true
    }
}

Get PayChannel Entry

Retrieve a PayChannel entry (opens in a new tab) which holds XRP for asynchronous payments.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "payment_channel": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7",
            "ledger_index": "validated"
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "index": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7",
        "ledger_hash": "BEC950D37F3B609CDC1F76047871DB1C5AC6DBEFA19AEA84D14AF1BF83BECE4E",
        "ledger_index": 100472165,
        "node": {
            "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
            "Amount": "1000",
            "Balance": "0",
            "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
            "DestinationNode": "0",
            "Flags": 0,
            "LedgerEntryType": "PayChannel",
            "OwnerNode": "0",
            "PreviousTxnID": "711C4F606C63076137FAE90ADC36379D7066CF551E96DA6FE2BDAB5ECBFACF2B",
            "PreviousTxnLgrSeq": 61965340,
            "PublicKey": "03CFD18E689434F032A4E84C63E2A3A6472D684EAF4FD52CA67742F3E24BAE81B2",
            "SettleDelay": 60,
            "index": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7"
        },
        "status": "success",
        "validated": true,
        "warning": "load"
    }
}

Get DepositPreauth Entry

Retrieve a DepositPreauth entry (opens in a new tab) which tracks preauthorization for payments to accounts requiring Deposit Authorization (opens in a new tab).

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • deposit_preauth (object or string; required): Specify the DepositPreauth to retrieve. If a string, must be the ledger entry ID of the DepositPreauth entry, as hexadecimal. If an object, requires owner sub-field and either authorized or authorize_credentials sub-field.
      • deposit_preauth.owner (string — address (opens in a new tab); required): The account that provided the preauthorization.
      • deposit_preauth.authorized (string — address (opens in a new tab); optional): The account that received the preauthorization.
      • deposit_preauth.authorized_credentials (array; optional): A set of credentials that received the preauthorization.

Each member of the deposit_preauth.authorized_credentials array, if provided, must include the following nested fields:

  • issuer (string — address (opens in a new tab); required): The address of the account that issued the credential.
  • credential_type (string — hexadecimal; required): The type of the credential, as issued.
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "deposit_preauth": {
              "owner": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
              "authorized": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX"
            },
            "ledger_index": "validated"
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "index": "A43898B685C450DE8E194B24D9D54E62530536A770CCB311BFEE15A27381ABB2",
        "ledger_hash": "C605C3E34DDBD8025844583B2EAEB75EE5CA933DB6B97646BDA736FED8D6A0A6",
        "ledger_index": 100472247,
        "node": {
            "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
            "Authorize": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
            "Flags": 0,
            "LedgerEntryType": "DepositPreauth",
            "OwnerNode": "0",
            "PreviousTxnID": "CB1BF910C93D050254C049E9003DA1A265C107E0C8DE4A7CFF55FADFD39D5656",
            "PreviousTxnLgrSeq": 61965405,
            "index": "A43898B685C450DE8E194B24D9D54E62530536A770CCB311BFEE15A27381ABB2"
        },
        "status": "success",
        "validated": true
    }
}

Get Ticket Entry

Retrieve a Ticket entry (opens in a new tab) which represents a sequence number set aside for future use.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • ticket (object or string): The Ticket to retrieve. If a string, must be the ledger entry ID (opens in a new tab) of the Ticket, as hexadecimal. If an object, the account and ticket_seq sub-fields are required to uniquely specify the Ticket entry.
      • ticket.account (string — address (opens in a new tab); required if ticket is an object): The owner of the Ticket.
      • ticket.ticket_seq (number; required if ticket is an object): The Ticket Sequence number of the Ticket to retrieve.
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "ticket": {
              "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
              "ticket_seq": 389
            },
            "ledger_index": "validated"
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "index": "B603682BC36F474F708E1A150B7C034C6C13D838C3F2F135CDB7BEA6E5B5ACEF",
        "ledger_hash": "2594A8BF2A0C52022EE4BD187FBB9345297DDB20C82FFBDDE87CFEA443440B98",
        "ledger_index": 100472816,
        "node": {
            "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
            "Flags": 0,
            "LedgerEntryType": "Ticket",
            "OwnerNode": "0",
            "PreviousTxnID": "7458B6FD22827B3C141CDC88F1F0C72658C9B5D2E40961E45AF6CD31DECC0C29",
            "PreviousTxnLgrSeq": 76567735,
            "TicketSequence": 389,
            "index": "B603682BC36F474F708E1A150B7C034C6C13D838C3F2F135CDB7BEA6E5B5ACEF"
        },
        "status": "success",
        "validated": true
    }
}

Get NFT Page

Return an NFT Page in its raw ledger format.

Parameters
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "nft_page": "255DD86DDF59D778081A06D02701E9B2C9F4F01DFFFFFFFFFFFFFFFFFFFFFFFF",
            "ledger_index": "validated"
          }
      ]
  }'
Response example
{
    "result": {
        "index": "255DD86DDF59D778081A06D02701E9B2C9F4F01DFFFFFFFFFFFFFFFFFFFFFFFF",
        "ledger_hash": "1C560CABB9E9556BEA3DE17DDCC4CB0F5FF82A533698744F0C339D3AE41391B1",
        "ledger_index": 100472871,
        "node": {
            "Flags": 0,
            "LedgerEntryType": "NFTokenPage",
            "NFTokens": [
                {
                    "NFToken": {
                        "NFTokenID": "000827100179C79A9CAACE945A5B77FCC291948F17A72A3F369B7C9400000A19",
                        "URI": "68747470733A2F2F78726F79616C74792E6D7970696E6174612E636C6F75642F697066732F516D534236344D5856614C7A46427757394847467969696243436D53554A4E7267753731735A38653742334D51452F323732392E6A736F6E"
                    }
                },
                {
                    "NFToken": {
                        "NFTokenID": "000827100179C79A9CAACE945A5B77FCC291948F17A72A3FBCE1D3AC000008F1",
                        "URI": "68747470733A2F2F78726F79616C74792E6D7970696E6174612E636C6F75642F697066732F516D534236344D5856614C7A46427757394847467969696243436D53554A4E7267753731735A38653742334D51452F323433332E6A736F6E"
                    }
                }
            ],
            "PreviousTxnID": "BB84C7F9FD90E7AC8A3178580F2F9BD2F00738F53060203025AF80CAF1C5D794",
            "PreviousTxnLgrSeq": 77102208,
            "index": "255DD86DDF59D778081A06D02701E9B2C9F4F01DFFFFFFFFFFFFFFFFFFFFFFFF"
        },
        "status": "success",
        "validated": true
    }
}

Get MPT Issuance Object

Return an MPTokenIssuance object.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • mpt_issuance (string): The 192-bit MPTokenIssuanceID that's associated with the MPTokenIssuance, as hexadecimal.
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
            "mpt_issuance": "string",
            "ledger_index": "validated"
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ledger_hash": "string",
        "ledger_index": integer,
        "node": {
            "LedgerEntryType": "string",
            "index": "string",
            "MPTIssuance": {
                "MPTIssuanceID": "string",
                "Owner": "string",
                "TransferFee": integer,
                "Flags": integer,
                "Taxon": integer,
                "URI": "string",
                "MPTSupply": "string"
            }
        },
        "validated": boolean
    }
}

Get MPToken Object

Return an MPToken object.

Parameters
  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • mptoken (object or string): If a string, interpret as ledger entry ID of the MPToken to retrieve. If an object, requires the sub-fields account and mpt_issuance_id to uniquely identify the MPToken.
      • mptoken.mpt_issuance_id (string; required if mptoken is an object): The 192-bit MPTokenIssuanceID that's associated with the MPTokenIssuance.
      • mptoken.account (string; required if mptoken is an object): The account that owns the MPToken.
Request example
curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger_entry",
      "params": [
          {
              "mptoken":{
                  "mpt_issuance_id": "string",
                  "account":"string"
              }
          }
      ]
  }'
Response example
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "ledger_hash": "string",
        "ledger_index": integer,
        "node": {
            "LedgerEntryType": "string",
            "index": "string",
            "MPToken": {
                "MPTIssuanceID": "string",
                "Owner": "string",
                "Flags": integer,
                "TransferFee": integer,
                "Taxon": integer,
                "QualityIn": integer,
                "QualityOut": integer,
                "Balance": "string",
                "PreviousTxnID": "string",
                "PreviousTxnLgrSeq": integer
            }
        },
        "validated": boolean
    }
}

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:


Transaction Methods:

Transactions are the only thing that can modify the shared state of the XRP Ledger. All business on the XRP Ledger takes the form of transactions. Use these methods to work with transactions.

simulate

Executes a dry run of any transaction type to preview results and metadata.

The simulate method executes a dry run of any transaction type, enabling you to preview the results and metadata of a transaction without committing them to the XRP Ledger. Since this command never submits a transaction to the network, it doesn't incur any fees.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • tx_blob (string; required): The transaction to simulate, in binary format. If you include this field, do not also include tx_json.
    • tx_json (object; required): The transaction to simulate, in JSON format. If you include this field, do not also include tx_blob.
    • binary (boolean; optional): The default value is false, which returns data and metadata in JSON format. If true, returns data and metadata in binary format, serialized to a hexadecimal string.

Note:

  • The simulated transaction must be unsigned.
  • If the Fee, Sequence, SigningPubKey, or NetworkID fields are provided, they will be used in the transaction. Otherwise, the server will autofill them.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • tx_json (object): The transaction that was simulated, including auto-filled values. Included if binary was false.
  • tx_blob (string): The serialized transaction that was simulated, including auto-filled values. Included if binary was true.
  • ledger_index (ledger index (opens in a new tab)): The ledger index of the ledger that would have included this transaction.
  • meta (object): Transaction metadata, which describes the results of the transaction. Not included if the transaction fails with a code that means it wouldn’t be included in the ledger (such as a non-TEC code). Included if binary was false.
  • meta_blob (string): Transaction metadata, which describes the results of the transaction. Not included if the transaction fails with a code that means it wouldn’t be included in the ledger (such as a non-TEC code). Included if binary was true.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "simulate",
      "params": [
          {
            "tx_json": {
              "TransactionType": "Payment",
              "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
              "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
              "Amount": {
                "currency": "USD",
                "value": "1",
                "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
              }
            }
          }
      ]
  }'

Response example

{
    "result": {
        "applied": false,
        "engine_result": "tesSUCCESS",
        "engine_result_code": 0,
        "engine_result_message": "The simulated transaction would have been applied.",
        "ledger_index": 100512217,
        "meta": {
            "AffectedNodes": [
                {
                    "ModifiedNode": {
                        "FinalFields": {
                            "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
                            "AccountTxnID": "42BDE75B7309C46BBA7FFC867DDA29DFCB2C066AA3866CF9076280A2DE63FE3C",
                            "Balance": "1138222640",
                            "Domain": "6D64756F31332E636F6D",
                            "EmailHash": "98B4375E1D753E5B91627516F6D70977",
                            "Flags": 9568256,
                            "MessageKey": "0000000000000000000000070000000300",
                            "OwnerCount": 17,
                            "RegularKey": "rD9iJmieYHn8jTtPjwwkW2Wm9sVDvPXLoJ",
                            "Sequence": 394,
                            "TicketCount": 5,
                            "TransferRate": 4294967295
                        },
                        "LedgerEntryType": "AccountRoot",
                        "LedgerIndex": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8",
                        "PreviousFields": {
                            "AccountTxnID": "932CC7E9BAC1F7B9FA5381679F293EEC0A646E5E7F2F6D14C85FEE2102F0E66C",
                            "Balance": "1138222650",
                            "Sequence": 393
                        },
                        "PreviousTxnID": "E5C3578BDBEBDCDE7E1697E3BA6A1CF04B17CCEBDE4939200680FEF530C7978E",
                        "PreviousTxnLgrSeq": 94448149
                    }
                }
            ],
            "TransactionIndex": 126,
            "TransactionResult": "tesSUCCESS"
        },
        "status": "success",
        "tx_json": {
            "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
            "Amount": {
                "currency": "USD",
                "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
                "value": "1"
            },
            "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
            "Fee": "10",
            "Sequence": 393,
            "SigningPubKey": "",
            "TransactionType": "Payment",
            "TxnSignature": "",
            "hash": "42BDE75B7309C46BBA7FFC867DDA29DFCB2C066AA3866CF9076280A2DE63FE3C"
        }
    }
}

submit

Sends a transaction to the network.

The submit method applies a transaction (opens in a new tab) and sends it to the network to be confirmed and included in future ledgers.

This command has two modes:

  • Submit-only mode takes a signed, serialized transaction as a binary blob, and submits it to the network as-is. Since signed transaction objects are immutable, no part of the transaction can be modified or automatically filled in after submission.

  • Sign-and-submit mode takes a JSON-formatted Transaction object, completes and signs the transaction in the same manner as the sign method (opens in a new tab), and then submits the signed transaction. We recommend only using this mode for testing and development.

To send a transaction as robustly as possible, you should construct and sign it in advance, persist it somewhere that you can access even after a power outage, then submit it as a tx_blob. After submission, monitor the network with the tx method command to see if the transaction was successfully applied; if a restart or other problem occurs, you can safely re-submit the tx_blob transaction: it won't be applied twice since it has the same sequence number as the old transaction.

Submit-only mode

Parameters

A submit-only request includes the following parameters:

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • tx_blob (string; required): Hex representation of the signed transaction to submit. This can be a multi-signed transaction (opens in a new tab).
    • fail_hard (boolean; optional): If true, and the transaction fails locally, do not retry or relay the transaction to other servers. The default is false.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • engine_result (string): Text result code (opens in a new tab) indicating the preliminary result of the transaction, for example tesSUCCESS.
  • engine_result_code (integer): Numeric version of the result code (opens in a new tab). Not recommended.
  • engine_result_message (string): Human-readable explanation of the transaction's preliminary result.
  • tx_blob (string): The complete transaction in hex string format.
  • tx_json (object): The complete transaction in JSON format.
  • accepted (boolean; omitted in sign-and-submit mode): The value true indicates that the transaction was applied, queued, broadcast, or kept for later. The value false indicates that none of those happened, so the transaction cannot possibly succeed as long as you do not submit it again and have not already submitted it another time.
  • account_sequence_available (number; omitted in sign-and-submit mode): The next Sequence Number (opens in a new tab) available for the sending account after all pending and queued transactions (opens in a new tab).
  • account_sequence_next (number; omitted in sign-and-submit mode): The next Sequence Number (opens in a new tab) for the sending account after all transactions that have been provisionally applied, but not transactions in the queue (opens in a new tab).
  • applied (boolean; omitted in sign-and-submit mode): The value true indicates that this transaction was applied to the open ledger. In this case, the transaction is likely, but not guaranteed, to be validated in the next ledger version.
  • broadcast (boolean; omitted in sign-and-submit mode): The value true indicates this transaction was broadcast to peer servers in the peer-to-peer XRP Ledger network. The value false indicates the transaction was not broadcast to any other servers.
  • kept (boolean; omitted in sign-and-submit mode): The value true indicates that the transaction was kept to be retried later.
  • queued (boolean; omitted in sign-and-submit mode): The value true indicates the transaction was put in the Transaction Queue (opens in a new tab), which means it is likely to be included in a future ledger version.
  • open_ledger_cost (string; omitted in sign-and-submit mode): The current open ledger cost (opens in a new tab) before processing this transaction. Transactions with a lower cost are likely to be queued (opens in a new tab).
  • validated_ledger_index (integer; omitted in sign-and-submit mode): The ledger index (opens in a new tab) of the newest validated ledger at the time of submission. This provides a lower bound on the ledger versions that the transaction can appear in as a result of this request.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "submit",
      "params": [
          {
            "tx_blob": "1200002280000000240000000361D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000A732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754"
        }
      ]
  }'

Response example

{
    "result": {
        "accepted": true,
        "account_sequence_available": 393,
        "account_sequence_next": 393,
        "applied": false,
        "broadcast": false,
        "engine_result": "tefPAST_SEQ",
        "engine_result_code": -190,
        "engine_result_message": "This sequence number has already passed.",
        "kept": true,
        "open_ledger_cost": "10",
        "queued": false,
        "status": "success",
        "tx_blob": "1200002280000000240000000361D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000A732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754",
        "tx_json": {
            "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
            "Amount": {
                "currency": "USD",
                "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
                "value": "1"
            },
            "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
            "Fee": "10",
            "Flags": 2147483648,
            "Sequence": 3,
            "SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
            "TransactionType": "Payment",
            "TxnSignature": "3045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE",
            "hash": "82230B9D489370504B39BC2CE46216176CAC9E752E5C1774A8CBEC9FBB819208"
        },
        "validated_ledger_index": 100512474
    }
}

Sign-and-Submit mode

This mode signs a transaction and immediately submits it. This mode is intended to be used for testing. You cannot use this mode for multi-signed transactions (opens in a new tab).

By default, sign-and-submit mode is admin-only (opens in a new tab). It can be used as a public method if the server has enabled public signing (opens in a new tab).

You can provide the secret key used to sign the transaction in the following ways:

  • Provide a secret value and omit the key_type field. This value can be formatted as an XRP Ledger base58 (opens in a new tab) seed, RFC-1751, hexadecimal, or as a string passphrase. (secp256k1 keys only)
  • Provide a key_type value and exactly one of seed, seed_hex, or passphrase. Omit the secret field. (Not supported by the commandline syntax.)

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • tx_json (object): Transaction definition (opens in a new tab) in JSON format, optionally omitting any auto-fillable fields.
    • secret (string; optional): Secret key of the account supplying the transaction, used to sign it. Do not send your secret to untrusted servers or through unsecured network connections. Cannot be used with key_type, seed, seed_hex, or passphrase.
    • seed (string; optional): Secret key of the account supplying the transaction, used to sign it. Must be in the XRP Ledger's base58 format. If provided, you must also specify the key_type. Cannot be used with secret, seed_hex, or passphrase.
    • seed_hex (string; optional): Secret key of the account supplying the transaction, used to sign it. Must be in hexadecimal format. If provided, you must also specify the key_type. Cannot be used with secret, seed, or passphrase.
    • passphrase (string; optional): Secret key of the account supplying the transaction, used to sign it, as a string passphrase. If provided, you must also specify the key_type. Cannot be used with secret, seed, or seed_hex.
    • key_type (string; optional): Type of cryptographic key provided in this request. Valid types are secp256k1 or ed25519. Defaults to secp256k1. Cannot be used with secret. Caution: Ed25519 support is experimental.
    • fail_hard (boolean; optional): If true, and the transaction fails locally, do not retry or relay the transaction to other servers. The default is false.
    • offline (boolean; optional): If true, when constructing the transaction, do not try to automatically fill in or validate values. The default is false.
    • build_path (boolean; optional): If this field is provided, the server auto-fills (opens in a new tab) the Paths field of a Payment transaction (opens in a new tab) before signing. You must omit this field if the transaction is a direct XRP payment (opens in a new tab) or if it is not a Payment-type transaction. Caution: The server looks for the presence or absence of this field, not its value. This behavior may change.
    • fee_mult_max (integer; optional): Sign-and-submit fails with the error rpcHIGH_FEE if the auto-filled Fee value (opens in a new tab) would be greater than the reference transaction cost (opens in a new tab) × fee_mult_max ÷ fee_div_max. This field has no effect if you explicitly specify the Fee field of the transaction. The default is 10.
    • fee_div_max (integer; optional): Sign-and-submit fails with the error rpcHIGH_FEE if the auto-filled Fee value (opens in a new tab) would be greater than the reference transaction cost (opens in a new tab) × fee_mult_max ÷ fee_div_max. This field has no effect if you explicitly specify the Fee field of the transaction. The default is 1.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • engine_result (string): Text result code (opens in a new tab) indicating the preliminary result of the transaction, for example tesSUCCESS.
  • engine_result_code (integer): Numeric version of the result code (opens in a new tab). Not recommended.
  • engine_result_message (string): Human-readable explanation of the transaction's preliminary result.
  • tx_blob (string): The complete transaction in hex string format.
  • tx_json (object): The complete transaction in JSON format.
  • accepted (boolean; omitted in sign-and-submit mode): The value true indicates that the transaction was applied, queued, broadcast, or kept for later. The value false indicates that none of those happened, so the transaction cannot possibly succeed as long as you do not submit it again and have not already submitted it another time.
  • account_sequence_available (number; omitted in sign-and-submit mode): The next Sequence Number (opens in a new tab) available for the sending account after all pending and queued transactions (opens in a new tab).
  • account_sequence_next (number; omitted in sign-and-submit mode): The next Sequence Number (opens in a new tab) for the sending account after all transactions that have been provisionally applied, but not transactions in the queue (opens in a new tab).
  • applied (boolean; omitted in sign-and-submit mode): The value true indicates that this transaction was applied to the open ledger. In this case, the transaction is likely, but not guaranteed, to be validated in the next ledger version.
  • broadcast (boolean; omitted in sign-and-submit mode): The value true indicates this transaction was broadcast to peer servers in the peer-to-peer XRP Ledger network. The value false indicates the transaction was not broadcast to any other servers.
  • kept (boolean; omitted in sign-and-submit mode): The value true indicates that the transaction was kept to be retried later.
  • queued (boolean; omitted in sign-and-submit mode): The value true indicates the transaction was put in the Transaction Queue (opens in a new tab), which means it is likely to be included in a future ledger version.
  • open_ledger_cost (string; omitted in sign-and-submit mode): The current open ledger cost (opens in a new tab) before processing this transaction. Transactions with a lower cost are likely to be queued (opens in a new tab).
  • validated_ledger_index (integer; omitted in sign-and-submit mode): The ledger index (opens in a new tab) of the newest validated ledger at the time of submission. This provides a lower bound on the ledger versions that the transaction can appear in as a result of this request.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "submit",
      "params": [
          {
            "offline": false,
            "api_version": 2,
            "secret": "s████████████████████████████",
            "tx_json": {
                "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
                "DeliverMax": {
                    "currency": "USD",
                    "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
                    "value": "1"
                },
                "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
                "TransactionType": "Payment"
            },
            "fee_mult_max": 1000
        }
      ]
  }'

submit_multisigned

Sends a multi-signed transaction to the network.

The submit_multisigned command applies a multi-signed (opens in a new tab) transaction and sends it to the network to be included in future ledgers.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • engine_result (string): Code indicating the preliminary result of the transaction, for example tesSUCCESS.
  • engine_result_code (integer): Numeric code indicating the preliminary result of the transaction, directly correlated to engine_result.
  • engine_result_message (string): Human-readable explanation of the preliminary transaction result.
  • tx_blob (string): The complete transaction (opens in a new tab) in hex string format.
  • tx_json (object): The complete transaction (opens in a new tab) in JSON format.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "submit_multisigned",
      "params": [
          {
            "tx_json": {
                "Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC",
                "Fee": "30000",
                "Flags": 262144,
                "LimitAmount": {
                    "currency": "USD",
                    "issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
                    "value": "0"
                },
                "Sequence": 4,
                "Signers": [
                    {
                        "Signer": {
                            "Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
                            "SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF",
                            "TxnSignature": "3045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B7"
                        }
                    },
                    {
                        "Signer": {
                            "Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
                            "SigningPubKey": "03398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C1",
                            "TxnSignature": "3045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D08"
                        }
                    }
                ],
                "SigningPubKey": "",
                "TransactionType": "TrustSet",
                "hash": "81A477E2A362D171BB16BE17B4120D9F809A327FA00242ABCA867283BEA2F4F8"
            }
          }
      ]
  }'

transaction_entry

Retrieves info on the transaction from a particular ledger version.

The transaction_entry method retrieves information on a single transaction from a specific ledger version. (The tx method by contrast, searches all ledgers for the specified transaction. We recommend using that method instead.)

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • ledger_hash (string; optional): The unique hash of the ledger version to use. (See Specifying Ledgers (opens in a new tab).)
    • ledger_index (string or unsigned integer; optional): The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers (opens in a new tab).)
    • tx_hash (string; required): Unique hash of the transaction you are looking up.

Returns (API v2)

  • close_time_iso (string): The ledger close time represented in ISO 8601 time format.
  • hash (string): The unique hash identifier of the transaction.
  • ledger_index (number — ledger index (opens in a new tab)): The ledger index of the ledger version the transaction was found in; this is the same as the one from the request.
  • ledger_hash (string — hash (opens in a new tab); optional): The identifying hash of the ledger version the transaction was found in; this is the same as the one from the request.
  • meta (object): The transaction metadata, which shows the exact results of the transaction in detail.
  • tx_json (object): JSON representation of the Transaction object.

Returns (API v1)

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "transaction_entry",
      "params": [
          {
            "tx_hash": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9",
            "ledger_index": 56865245
          }
      ]
  }'

tx

Retrieves info on the transaction from all the ledgers at hand.

The tx method retrieves information on a single transaction (opens in a new tab), by its identifying hash (opens in a new tab) or its CTID (opens in a new tab).

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • ctid (string; optional): The compact transaction identifier (opens in a new tab) of the transaction to look up. Must use uppercase hexadecimal only. (Not supported in Clio v2.0 and earlier).
    • transaction (string; optional): The 256-bit hash of the transaction to look up, as hexadecimal.
    • binary (boolean; optional): If true, return transaction data and metadata as binary serialized (opens in a new tab) to hexadecimal strings. If false, return transaction data and metadata as JSON. The default is false.
    • min_ledger (number; optional): Use this with max_ledger to specify a range of up to 1000 ledger indexes (opens in a new tab), starting with this ledger (inclusive). If the server cannot find the transaction, it confirms whether it was able to search all the ledgers in this range.
    • max_ledger (number; optional): Use this with min_ledger to specify a range of up to 1000 ledger indexes (opens in a new tab), ending with this ledger (inclusive). If the server cannot find the transaction, it confirms whether it was able to search all the ledgers in the requested range.

Returns (API v2)

The response follows the standard format (opens in a new tab), with a successful result containing the fields of the Transaction object (opens in a new tab) as well as the following additional fields:

Returns (API v1)

The response follows the standard format (opens in a new tab), with a successful result containing the fields of the Transaction object (opens in a new tab) as well as the following additional fields:

Request example (CTID)

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "tx",
      "params": [
           {
                "ctid": "C005523E00000000",
                "binary": false,
                "api_version": 2
           }
      ]
  }'

Request example (Hash)

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "tx",
      "params": [
           {
                "transaction": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9",
                "binary": false,
                "api_version": 2
           }
      ]
  }'

tx_history

Retrieves info on all recent transactions.

The tx_history method retrieves some of the most recent transactions made.

Caution: This method is removed in API v2 (opens in a new tab).

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • start (unsigned integer; required): Number of transactions to skip over.

Returns

  • txs (array): Array of transaction objects.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "tx_history",
      "params": [
           {
                "start": 0
           }
      ]
  }'

Response example

{
    "result": {
        "index": 0,
        "status": "success",
        "txs": [
            {
                "Account": "rUPWQfH9SoNnbYDMjq6cMoawQ4x2or6nGA",
                "Amount": "100000000000000",
                "DeliverMax": "100000000000000",
                "Destination": "rUPWQfH9SoNnbYDMjq6cMoawQ4x2or6nGA",
                "Fee": "10",
                "Flags": 131072,
                "LastLedgerSequence": 100581760,
                "SendMax": {
                    "currency": "USD",
                    "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
                    "value": "1000000000000000"
                },
                "Sequence": 0,
                "SigningPubKey": "EDE91272F3124216316CC04C798E7AE3A7395924FAF50533B01BCC0CE5CE71B122",
                "TicketSequence": 100371575,
                "TransactionType": "Payment",
                "TxnSignature": "A338BAEE8DCFA84DC5F6F8ABD81BC1F9D406F24C248A19465A83E7C9564894538A9F83C654DEFD748F7507FF8E134AC0F108A430BD2E21C1CF45F030C9678705",
                "hash": "45A8E1470A18F55FF9559700ABA643FE25E7E957CDB2D35F84B6B746A22C96FF",
                "inLedger": 100581753,
                "ledger_index": 100581753
            }
        ]
    }
}

Path and Order Book Methods:

Paths define a way for payments to flow through intermediary steps on their way from sender to receiver. Paths enable cross-currency payments by connecting sender and receiver through order books. Use these methods to work with paths and other books.

amm_info

Retrieves info on the Automated Market Maker (AMM) instance.

The amm_info method gets information about an Automated Market Maker (AMM) (opens in a new tab) instance.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

Note: You must specify either amm_account or both asset and asset2.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • amm (object): An AMM Description Object for the requested asset pair.
  • ledger_current_index (ledger index (opens in a new tab); optional): Omitted if ledger_index is provided instead. The ledger index (opens in a new tab) of the current in-progress ledger, which was used when retrieving this information.
  • ledger_hash (hash (opens in a new tab); optional): Omitted if ledger_current_index is provided instead. The identifying hash of the ledger version that was used when retrieving this data.
  • ledger_index (ledger index (opens in a new tab); optional): Omitted if ledger_current_index is provided instead. The ledger index (opens in a new tab) of the ledger version used when retrieving this information.
  • validated (boolean): If true, the ledger used for this request is validated and these results are final; if omitted or set to false, the data is pending and may change.

AMM Description Object

The amm field is an object describing the current status of an Automated Market Maker (AMM) in the ledger, and contains the following fields:

  • account (string): The Address (opens in a new tab) of the AMM Account.
  • amount (currency amount (opens in a new tab)): The total amount of one asset in the AMM's pool. (Note: This could be asset or asset2 from the request.)
  • amount2 (currency amount (opens in a new tab)): The total amount of the other asset in the AMM's pool. (Note: This could be asset or asset2 from the request.)
  • asset_frozen (boolean; omitted for XRP): If true, the amount currency is currently frozen (opens in a new tab).
  • asset2_frozen (boolean; omitted for XRP): If true, the amount2 currency is currently frozen (opens in a new tab).
  • auction_slot (object; optional): An Auction Slot Object describing the current auction slot holder, if there is one.
  • lp_token (currency amount (opens in a new tab)): The total amount of this AMM's LP Tokens outstanding. If the request specified a liquidity provider in the account field, instead, this is the amount of this AMM's LP Tokens held by that liquidity provider.
  • trading_fee (number): The AMM's current trading fee, in units of 1/100,000; a value of 1 is equivalent to a 0.001% fee.
  • vote_slots (array; optional): The current votes for the AMM's trading fee, as Vote Slot Objects.

Auction Slot Object

The auction_slot field of the amm object describes the current auction slot holder of the AMM, and contains the following fields:

  • account (string): The Address (opens in a new tab) of the account that owns the auction slot.
  • auth_accounts (array): A list of additional accounts that the auction slot holder has designated as being eligible of the discounted trading fee. Each member of this array is an object with one field, account, containing the address of the designated account.
  • discounted_fee (number): The discounted trading fee that applies to the auction slot holder, and any eligible accounts, when trading against this AMM. This is 1/10 of the AMM's normal trading fee.
  • expiration (string): The ISO 8601 UTC timestamp after which this auction slot expires. After expired, the auction slot does not apply (but the data can remain in the ledger until another transaction replaces it or cleans it up).
  • price (currency amount (opens in a new tab)): The amount, in LP Tokens, that the auction slot holder paid to win the auction slot. This affects the price to outbid the current slot holder.
  • time_interval (number): The current 72-minute time interval this auction slot is in, from 0 to 19. The auction slot expires after 24 hours (20 intervals of 72 minutes) and affects the cost to outbid the current holder and how much the current holder is refunded if someone outbids them.

Vote Slot Objects

Each entry in the vote_slots array represents one liquidity provider's vote to set the trading fee, and contains the following fields:

  • account (string): The Address (opens in a new tab) of this liquidity provider.
  • trading_fee (number): The trading fee this liquidity provider voted for, in units of 1/100,000.
  • vote_weight (number): How much this liquidity provider's vote counts towards the final trading fee. This is proportional to how much of the AMM's LP Tokens this liquidity provider holds. The value is equal to 100,000 times the number of this LP Tokens this liquidity provider holds, divided by the total number of LP Tokens outstanding. For example, a value of 1000 means that the liquidity provider holds 1% of this AMM's LP Tokens.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "amm_info",
      "params": [
           {
              "asset": {
                "currency": "XRP"
              },
              "asset2": {
                "currency": "TST",
                "issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
              }
           }
      ]
  }'

Response example

{
  "result": {
    "amm": {
      "account": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
      "amount": "296890496",
      "amount2": {
        "currency": "TST",
        "issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd",
        "value": "25.81656470648473"
      },
      "asset2_frozen": false,
      "auction_slot": {
        "account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
        "auth_accounts": [
          {
            "account": "r3f2WpQMsAd8k4Zoijv2PZ78EYFJ2EdvgV"
          },
          {
            "account": "rnW8FAPgpQgA6VoESnVrUVJHBdq9QAtRZs"
          }
        ],
        "discounted_fee": 0,
        "expiration": "2023-Jan-26 00:28:40.000000000 UTC",
        "price": {
          "currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
          "issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
          "value": "0"
        },
        "time_interval": 0
      },
      "lp_token": {
        "currency": "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
        "issuer": "rp9E3FN3gNmvePGhYnf414T2TkUuoxu8vM",
        "value": "87533.41976112682"
      },
      "trading_fee": 600,
      "vote_slots": [
        {
          "account": "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
          "trading_fee": 600,
          "vote_weight": 9684
        }
      ]
    },
    "ledger_current_index": 316745,
    "status": "success",
    "validated": false
  }
}

book_changes

Retrieves information on order book changes.

The book_changes method reports information about changes to the order books in the decentralized exchange (DEX) (opens in a new tab) compared with the previous ledger version. This may be useful for building "candlestick" charts.

Parameters

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • changes (array): List of Book Update Objects (opens in a new tab), containing one entry for each order book that was updated in this ledger version. The array is empty if no order books were updated.
  • ledger_hash (hash (opens in a new tab)): The identifying hash of the ledger version that was used when retrieving this data.
  • ledger_index (ledger index (opens in a new tab)): The ledger index of the ledger version that was used when retrieving this data.
  • ledger_time (number): The official close time of the ledger that was used when retrieving this data, in seconds since the Ripple Epoch (opens in a new tab).
  • type (string): The string bookChanges, which indicates that this is an order book update message.
  • validated (boolean; optional): If true, the information comes from a validated ledger version.

Book Update Objects

A Book Update Object represents the changes to a single order book in a single ledger version, and contains the following fields:

  • currency_a (string): An identifier for the first of the two currencies in the order book. For XRP, this is the string XRP_drops. For tokens (opens in a new tab), this is formatted as the address of the issuer in base58, followed by a forward-slash (/), followed by the Currency Code (opens in a new tab) for the token, which can be a 3-character standard code or a 20-character hexadecimal code.
  • currency_b (string): An identifier for the second of two currencies in the order book. This is in the same format as currency_a, except currency_b can never be XRP.
  • volume_a (string — number): The total amount, or volume, of the first currency (that is, currency_a) that moved as a result of trades through this order book in this ledger.
  • volume_b (string — number): The volume of the second currency (that is, currency_b) that moved as a result of trades through this order book in this ledger.
  • high (string — number): The highest exchange rate among all offers matched in this ledger, as a ratio of the first currency to the second currency. (In other words, currency_a : currency_b.)
  • low (string — number): The lowest exchange rate among all offers matched in this ledger, as a ratio of the first currency to the second currency.
  • open (string — number): The exchange rate at the top of this order book before processing the transactions in this ledger, as a ratio of the first currency to the second currency.
  • close (string — number): The exchange rate at the top of this order book after processing the transactions in this ledger, as a ratio of the first currency to the second currency.

For XRP-token order books, XRP is always currency_a. For token-token order books, the currencies are sorted alphabetically by the issuer and then currency code.

Exchange rates involving XRP are always calculated using drops of XRP (opens in a new tab). For example, if the rate from XRP to FOO is 1.0 XRP to 1 FOO, the rate reported by the API is 1000000 (1 million drops of XRP per 1 FOO).

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "book_changes",
      "params": [
           {
              "ledger_index": 88530953
           }
      ]
  }'

Response example

{
    "result" : {
       "changes" : [
          {
             "close" : "277777.7777777778",
             "currency_a" : "XRP_drops",
             "currency_b" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/CNY",
             "high" : "277777.7777777778",
             "low" : "277777.7777777778",
             "open" : "277777.7777777778",
             "volume_a" : "44082741",
             "volume_b" : "158.6978676"
          },
          {
             "close" : "202999.9948135647",
             "currency_a" : "XRP_drops",
             "currency_b" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/XLM",
             "high" : "202999.9948135647",
             "low" : "202999.9948135647",
             "open" : "202999.9948135647",
             "volume_a" : "44191586",
             "volume_b" : "217.6925474337355"
          },
          {
             "close" : "80475.34586323083",
             "currency_a" : "XRP_drops",
             "currency_b" : "rf5YPb9y9P3fTjhxNaZqmrwaj5ar8PG1gM/47414C4100000000000000000000000000000000",
             "high" : "80475.34586323083",
             "low" : "80475.34586323083",
             "open" : "80475.34586323083",
             "volume_a" : "100000000",
             "volume_b" : "1242.61659179386"
          },
          {
             "close" : "231974.7481608686",
             "currency_a" : "XRP_drops",
             "currency_b" : "rsoLo2S1kiGeCcn6hCUXVrCpGMWLrRrLZz/534F4C4F00000000000000000000000000000000",
             "high" : "231974.7481608686",
             "low" : "231974.7481608686",
             "open" : "231974.7481608686",
             "volume_a" : "33734",
             "volume_b" : "0.1454210006367"
          },
          {
             "close" : "7.290000000001503",
             "currency_a" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/CNY",
             "currency_b" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/USD",
             "high" : "7.290000000001503",
             "low" : "7.290000000001503",
             "open" : "7.290000000001503",
             "volume_a" : "158.6978670792",
             "volume_b" : "21.76925474337"
          },
          {
             "close" : "0.1",
             "currency_a" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/USD",
             "currency_b" : "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y/XLM",
             "high" : "0.1",
             "low" : "0.1",
             "open" : "0.1",
             "volume_a" : "21.76925474337355",
             "volume_b" : "217.6925474337355"
          }
       ],
       "ledger_hash" : "7AB08A2415C10E07201521F3260F77ADFF4902A528EA66378E259A07767A24B9",
       "ledger_index" : 88530953,
       "ledger_time" : 771100891,
       "status" : "success",
       "type" : "bookChanges"
    }
}

book_offers

Retrieves info on the currency exchange offers.

The book_offers method retrieves a list of offers (opens in a new tab) between two currencies, also known as an order book. The response omits unfunded offers (opens in a new tab) and reports how much of each remaining offer's total is currently funded.

Parameters

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • ledger_current_index (ledger index (opens in a new tab); optional): Omitted if ledger_index is provided. The ledger index (opens in a new tab) of the current in-progress ledger version, which was used to retrieve this information.
  • ledger_index (ledger index (opens in a new tab); optional): Omitted if ledger_current_index is provided. The ledger index of the ledger version that was used when retrieving this data, as requested.
  • ledger_hash (hash (opens in a new tab); optional): The identifying hash of the ledger version that was used when retrieving this data, as requested.
  • offers (array): Array of offer objects, as described below.

Each member of the offers array contains canonical fields of an Offer entry (opens in a new tab) and can also contain the following additional fields:

  • owner_funds (string): Amount of the TakerGets currency the side placing the offer has available to be traded. (XRP is represented as drops; any other currency is represented as a decimal value.) If a trader has multiple offers in the same book, only the highest-ranked offer includes this field.
  • taker_gets_funded (currency amount (opens in a new tab); optional): (Only included in partially-funded offers) The maximum amount of currency that the taker can get, given the funding status of the offer.
  • taker_pays_funded (currency amount (opens in a new tab); optional): (Only included in partially-funded offers) The maximum amount of currency that the taker would pay, given the funding status of the offer.
  • quality (string): The exchange rate, as the ratio taker_pays divided by taker_gets. For fairness, offers that have the same quality are automatically taken first-in, first-out. (In other words, if multiple people offer to exchange currency at the same rate, the oldest offer is taken first.)

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "book_offers",
      "params": [
           {
                "taker": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
                "taker_gets": {
                    "currency": "XRP"
                },
                "taker_pays": {
                    "currency": "USD",
                    "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
                },
                "limit": 10
           }
      ]
  }'

Response example

{
    "result": {
        "ledger_current_index": 100604206,
        "offers": [
            {
                "Account": "rdmZRvr9aBdGwzF2DwYBnHxTUDomJoiaQ",
                "BookDirectory": "DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4F07346FDFE9BD33",
                "BookNode": "0",
                "Flags": 0,
                "LedgerEntryType": "Offer",
                "OwnerNode": "8",
                "PreviousTxnID": "4F34894FC227EBC36B0469672C533DB245DB8CB9FAC59E49A7B058D3A0ED08F6",
                "PreviousTxnLgrSeq": 100604145,
                "Sequence": 99505926,
                "TakerGets": "9117876",
                "TakerPays": {
                    "currency": "USD",
                    "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
                    "value": "18.49086962"
                },
                "index": "8FA868A2EFF6B0CF195126639615DBE9251AE5E5559E428450D7F260E2D16CBA",
                "owner_funds": "16902114",
                "quality": "0.000002027979939626291"
            }
        ],
        "status": "success",
        "validated": false
    }
}

deposit_authorized

Checks whether an account is authorized to send money directly to another account.

The deposit_authorized command indicates whether one account is authorized to send payments directly to another. See Deposit Authorization (opens in a new tab) for information on how to require authorization to deliver money to your account.

Parameters

Note: If you provide a set of credentials that does not exactly match a set of credentials preauthorized by the destination, the payment is not authorized, even if the destination has preauthorized a subset of those credentials. This matches the behavior of transaction processing.

Returns

  • credentials (array of hash (opens in a new tab); optional): The credentials specified in the request, if any.
  • deposit_authorized (boolean; required): Whether the specified source account is authorized to send payments directly to the destination account. If true, either the destination account does not require deposit authorization (opens in a new tab) or the source account is preauthorized.
  • destination_account (string — address (opens in a new tab); required): The destination account specified in the request.
  • ledger_hash (string; optional): The identifying hash of the ledger that was used to generate this response.
  • ledger_index (number — ledger index (opens in a new tab); optional): The ledger index of the ledger version that was used to generate this response.
  • ledger_current_index (number — ledger index (opens in a new tab); optional): The ledger index of the current in-progress ledger version, which was used to generate this response.
  • source_account (string — address (opens in a new tab); required): The source account specified in the request.
  • validated (boolean; optional): If true, the information comes from a validated ledger version.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "deposit_authorized",
      "params": [
           {
              "source_account": "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de",
              "destination_account": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8",
              "credentials": [
                "A182EFBD154C9E80195082F86C1C8952FC0760A654B886F61BB0A59803B4387B",
                "383D269D6C7417D0A8716B09F5DB329FB17B45A5EFDBAFB82FF04BC420DCF7D5"
              ],
              "ledger_index": "validated"
           }
      ]
  }'

Response example

{
  "result": {
    "credentials": [
      "A182EFBD154C9E80195082F86C1C8952FC0760A654B886F61BB0A59803B4387B",
      "383D269D6C7417D0A8716B09F5DB329FB17B45A5EFDBAFB82FF04BC420DCF7D5"
    ],
    "deposit_authorized": true,
    "destination_account": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8",
    "ledger_hash": "BD03A10653ED9D77DCA859B7A735BF0580088A8F287FA2C5403E0A19C58EF322",
    "ledger_index": 8,
    "source_account": "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de",
    "status": "success",
    "validated": true
  }
}

get_aggregate_price

Calculates the aggregate price of specified Oracle instances.

The get_aggregate_price method retrieves the aggregate price of specified Oracle objects, returning three price statistics: mean, median, and trimmed mean.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • base_asset (string; required): The currency code of the asset to be priced.
    • quote_asset (string; required): The currency code of the asset to quote the price of the base asset.
    • trim (number; optional): The percentage of outliers to trim. Valid trim range is 1–25. If included, the API returns statistics for the trimmed mean.
    • trim_threshold (number; optional): Defines a time range in seconds for filtering out older price data. Default value is 0, which doesn't filter any data.
    • oracles (array; required): An array of oracle identifier objects. You must list between 1 and 200 oracle identifiers.

Each member of the oracles array is an oracle identifier object with the following fields:

  • account (string; required): The XRPL account that controls the Oracle object.
  • oracle_document_id (number; required): A unique identifier of the price oracle for the Account.

Returns

  • entire_set (object): The statistics from the collected oracle prices.
    • entire_set.mean (string — number): The simple mean.
    • entire_set.size (number): The size of the data set to calculate the mean.
    • entire_set.standard_deviation (string — number): The standard deviation.
  • trimmed_set (object; optional): The trimmed statistics from the collected oracle prices. Only appears if the trim field was specified in the request.
    • trimmed_set.mean (string — number): The simple mean of the trimmed data.
    • trimmed_set.size (number): The size of the data to calculate the trimmed mean.
    • trimmed_set.standard_deviation (string — number): The standard deviation of the trimmed data.
  • time (number): The most recent timestamp out of all LastUpdateTime values, represented in Unix time.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "get_aggregate_price",
      "params": [
           {
              "ledger_index": "current",
              "base_asset": "XRP",
              "quote_asset": "USD",
              "trim": 20,
              "oracles": [
                  {
                    "account": "rNZ9m6AP9K7z3EVg6GhPMx36V4QmZKeWds",
                    "oracle_document_id": 34
                  },
                  {
                    "account": "rMVKq8zrVsJZQFEiTARyC6WfZznhhLMcNi",
                    "oracle_document_id": 100
                  },
                  {
                    "account": "r92kJTnUbUUq15t2BBZYGYxY79RnNc7rLQ",
                    "oracle_document_id": 2
                  }
              ]
           }
      ]
  }'

Response example

{
    "result": {
        "entire_set": {
            "mean": "0.78",
            "size": 3,
            "standard_deviation": "0.03464101615137754"
        },
        "ledger_current_index": 3677185,
        "median": "0.8",
        "time": 1724877762,
        "trimmed_set": {
            "mean": "0.78",
            "size": 3,
            "standard_deviation": "0.03464101615137754"
        },
        "validated": false
    },
    "status": "success",
    "type": "response"
}

nft_buy_offers

Retrieves a list of all buy offers for the NFT specified.

The nft_buy_offers method returns a list of buy offers for a given NFToken object.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • nft_id (string; required): The unique identifier of a NFToken (opens in a new tab) object.
    • ledger_hash (string; optional): The unique hash of the ledger version to use. (See Specifying Ledgers (opens in a new tab))
    • ledger_index (string or number; optional): The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers (opens in a new tab))
    • limit (integer; optional): Limit the number of NFT buy offers to retrieve. This value cannot be lower than 50 or more than 500. Positive values outside this range are replaced with the closest valid option. The default is 250.
    • marker (marker (opens in a new tab); optional): Value from a previous paginated response. Resume retrieving data where that response left off.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • nft_id (string): The NFToken these offers are for, as specified in the request.
  • offers (array): A list of buy offers for the token. Each of these is formatted as a Buy Offer (see below).
  • limit (number; optional): The limit, as specified in the request.
  • marker (marker (opens in a new tab); optional): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. Omitted when there are no pages of information after this one.

Buy Offers

Each member of the offers array represents one NFTokenOffer object (opens in a new tab) to buy the NFT in question and has the following fields:

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "nft_buy_offers",
      "params": [
           {
              "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
              "ledger_index": "validated"
           }
      ]
  }'

Response example

{
  "result": {
    "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
    "offers": [
      {
        "amount": "1500",
        "flags": 0,
        "nft_offer_index": "3212D26DB00031889D4EF7D9129BB0FA673B5B40B1759564486C0F0946BA203F",
        "owner": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx"
      }
    ],
    "status": "success"
  }
}

nft_sell_offers

Retrieves a list of all sell offers for the NFT specified.

The nft_sell_offers method returns a list of sell offers for a given NFToken (opens in a new tab) object.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • nft_id (string; required): The unique identifier of a NFToken (opens in a new tab) object.
    • ledger_hash (string; optional): The unique hash of the ledger version to use. (See Specifying Ledgers (opens in a new tab))
    • ledger_index (string or number; optional): The ledger index (opens in a new tab) of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers (opens in a new tab))
    • limit (integer; optional): Limit the number of NFT sell offers to retrieve. This value cannot be lower than 50 or more than 500. Positive values outside this range are replaced with the closest valid option. The default is 250.
    • marker (marker; optional): Value from a previous paginated response. Resume retrieving data where that response left off.

Returns

  • nft_id (string): The NFToken these offers are for, as specified in the request.
  • offers (array): A list of buy offers for the token. Each of these is formatted as a Sell Offer (see below).
  • limit (number; optional): The limit, as specified in the request.
  • marker (marker; optional): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. Omitted when there are no pages of information after this one.

Sell Offers

Each member of the offers array represents one NFTokenOffer object (opens in a new tab) to buy the NFT in question and has the following fields:

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "nft_sell_offers",
      "params": [
           {
                "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007"
           }
      ]
  }'

Response example

{
  "result": {
    "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007",
    "offers": [
      {
        "amount": "1000",
        "flags": 1,
        "nft_offer_index": "9E28E366573187F8E5B85CE301F229E061A619EE5A589EF740088F8843BF10A1",
        "owner": "rLpSRZ1E8JHyNDZeHYsQs1R5cwDCB3uuZt"
      }
    ],
    "status": "success"
  }
}

ripple_path_find

Finds a path for payment between two accounts, once.

Although the rippled server tries to find the cheapest path or combination of paths for making a payment, it is not guaranteed that the paths returned by this method are, in fact, the best paths.

Caution: Be careful with the pathfinding results from untrusted servers. A server could be modified to return less-than-optimal paths to earn money for its operators. A server may also return poor results when under heavy load. If you do not have your own server that you can trust with pathfinding, you should compare the results of pathfinding from multiple servers run by different parties, to minimize the risk of a single server returning poor results.

Parameters

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • alternatives (array): Array of objects with possible paths to take, as described below. If empty, then there are no paths connecting the source and destination accounts.
  • destination_account (string): Unique address of the account that would receive a payment transaction.
  • destination_currencies (array): Array of strings representing the currencies that the destination accepts, as 3-letter codes like USD or as 40-character hex like 015841551A748AD2C1F76FF6ECB0CCCD00000000.

Each element in the alternatives array is an object that represents a path from one possible source currency (held by the initiating account) to the destination account and currency. This object has the following fields:

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ripple_path_find",
      "params": [
           {
                "destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
                "destination_amount": {
                    "currency": "USD",
                    "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
                    "value": "0.001"
                },
                "source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
                "source_currencies": [
                    {
                        "currency": "XRP"
                    },
                    {
                        "currency": "USD"
                    }
                ]
           }
      ]
  }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "alternatives": [
            {
                "paths_canonical": [],
                "paths_computed": [
                    [
                        {
                            "currency": "USD",
                            "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
                            "type": 48
                        }
                    ]
                ],
                "source_amount": "461"
            },
            {
                "paths_canonical": [],
                "paths_computed": [],
                "source_amount": {
                    "currency": "USD",
                    "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
                    "value": "0.0010015"
                }
            }
        ],
        "destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
        "destination_amount": {
            "currency": "USD",
            "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
            "value": "0.001"
        },
        "destination_currencies": [
            "JOE",
            "MXN",
            "USD",
            "DYM",
            "CNY",
            "015841551A748AD2C1F76FF6ECB0CCCD00000000",
            "EUR",
            "BTC",
            "XRP"
        ],
        "full_reply": true,
        "source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
        "status": "success"
    }
}

Payment Channel Methods:

Payment channels are a tool for facilitating repeated, unidirectional payments, or temporary credit between two parties. Use these methods to work with payment channels.

channel_verify

Checks a payment channel claim's signature.

The channel_verify method checks the validity of a signature that can be used to redeem a specific amount of XRP from a payment channel.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • amount (string; required): The amount of XRP, in drops (opens in a new tab), that the provided signature authorizes.
    • channel_id (string; required): The Channel ID of the channel that provides the amount. This is a 64-character hexadecimal string.
    • public_key (string; required): The public key of the channel and the key pair that was used to create the signature, in hexadecimal or the XRP Ledger's base58 format.
    • signature (string; required): The signature to verify, in hexadecimal.

Returns

  • signature_verified (boolean): If true, the signature is valid for the stated amount, channel, and public key.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "channel_verify",
      "params": [
           {
                "channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3",
                "signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064",
                "public_key": "aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3",
                "amount": "1000000"
           }
      ]
  }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "signature_verified": true,
        "status": "success"
    }
}

Server Info Methods:

Use these methods to retrieve information about the current state of the rippled server.

fee

Retrieves information on the transaction cost.

The fee command reports the current state of the open-ledger requirements for the transaction cost (opens in a new tab). This requires the FeeEscalation amendment (opens in a new tab) to be enabled.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • current_ledger_size (string — integer): Number of transactions provisionally included in the in-progress ledger.
  • current_queue_size (string — integer): Number of transactions currently queued for the next ledger.
  • drops (object): Various information about the transaction cost (the Fee field of a transaction), in drops of XRP (opens in a new tab).
    • drops.base_fee (string — integer): The transaction cost required for a reference transaction (opens in a new tab) to be included in a ledger under minimum load, represented in drops of XRP.
    • drops.median_fee (string — integer): An approximation of the median transaction cost among transactions included in the previous validated ledger, represented in drops of XRP.
    • drops.minimum_fee (string — integer): The minimum transaction cost for a reference transaction (opens in a new tab) to be queued for a later ledger, represented in drops of XRP. If greater than base_fee, the transaction queue is full.
    • drops.open_ledger_fee (string — integer): The minimum transaction cost that a reference transaction (opens in a new tab) must pay to be included in the current open ledger, represented in drops of XRP.
  • expected_ledger_size (string — integer): The approximate number of transactions expected to be included in the current ledger. This is based on the number of transactions in the previous ledger.
  • ledger_current_index (number): The Ledger Index of the current open ledger these stats describe.
  • levels (object): Various information about the transaction cost, in fee levels (opens in a new tab). The ratio in fee levels applies to any transaction relative to the minimum cost of that particular transaction.
    • levels.median_level (string — integer): The median transaction cost among transactions in the previous validated ledger, represented in fee levels (opens in a new tab).
    • levels.minimum_level (string — integer): The minimum transaction cost required to be queued for a future ledger, represented in fee levels (opens in a new tab).
    • levels.open_ledger_level (string — integer): The minimum transaction cost required to be included in the current open ledger, represented in fee levels (opens in a new tab).
    • levels.reference_level (string — integer): The equivalent of the minimum transaction cost, represented in fee levels (opens in a new tab).
  • max_queue_size (string — integer): The maximum number of transactions that the transaction queue (opens in a new tab) can currently hold.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "fee",
      "params": [{}]
  }'

Response example

{
    "result": {
        "current_ledger_size": "89",
        "current_queue_size": "0",
        "drops": {
            "base_fee": "10",
            "median_fee": "5000",
            "minimum_fee": "10",
            "open_ledger_fee": "10"
        },
        "expected_ledger_size": "396",
        "ledger_current_index": 100647307,
        "levels": {
            "median_level": "128000",
            "minimum_level": "256",
            "open_ledger_level": "256",
            "reference_level": "256"
        },
        "max_queue_size": "7920",
        "status": "success"
    }
}

feature

Retrieves information on the protocol amendments.

The feature command returns information about amendments (opens in a new tab) this server knows about, including whether they are enabled and if the server knows how to apply the amendments.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • feature (string; optional): The unique ID of an amendment, as hexadecimal; or the short name of the amendment. If provided, limits the response to one amendment. Otherwise, the response lists all amendments.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing a map of amendments as a JSON object.

The keys of the object are amendment IDs. The values for each key are amendment objects that describe the status of the amendment with that ID. If the request specified a feature, the map contains only the requested amendment object, after applying any changes from the request. Each amendment object has the following fields:

  • enabled (boolean): Whether this amendment is currently enabled in the latest ledger.
  • name (string; optional): The human-readable name for this amendment, if known.
  • supported (boolean): Whether the server knows how to apply this amendment. If this field is set to false (the server does not know how to apply this amendment) and enabled is set to true (this amendment is enabled in the latest ledger), this amendment may cause your server to be amendment blocked (opens in a new tab).

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "fee",
      "params": [
          {
              "feature": "4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373"
          }
      ]
  }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "current_ledger_size": "36",
        "current_queue_size": "0",
        "drops": {
            "base_fee": "10",
            "median_fee": "5000",
            "minimum_fee": "10",
            "open_ledger_fee": "10"
        },
        "expected_ledger_size": "396",
        "ledger_current_index": 100647615,
        "levels": {
            "median_level": "128000",
            "minimum_level": "256",
            "open_ledger_level": "256",
            "reference_level": "256"
        },
        "max_queue_size": "7920",
        "status": "success"
    }
}

manifest

Retrieves public information on a known validator.

The manifest method reports the current "manifest" information for a given validator public key. The "manifest" is a block of data that authorizes an ephemeral signing key with a signature from the validator's master key pair.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • public_key (string; required): The base58 (opens in a new tab)-encoded public key of the validator to look up. This can be the master public key or ephemeral public key.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following fields:

  • details (object; optional): The data contained in this manifest. Omitted if the server does not have a manifest for the public_key from the request. See Details Object below for a full description of its contents.
  • manifest (string; optional): The full manifest data in base64 format. This data is serialized to binary before being base64-encoded. Omitted if the server does not have a manifest for the public_key from the request.
  • requested (string): The public_key from the request.

Details Object

If provided, the details object contains the following fields:

  • domain (string): The domain name this validator claims to be associated with. If the manifest does not contain a domain, this is an empty string.
  • ephemeral_key (string): The ephemeral public key for this validator, in base58 (opens in a new tab).
  • master_key (string): The master public key for this validator, in base58 (opens in a new tab).
  • seq (number): The sequence number of this manifest. This number increases whenever the validator operator updates the validator's token to rotate ephemeral keys or change settings.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "manifest",
      "params": [
          {
              "public_key":"nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p"
          }
      ]
  }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "details": {
            "domain": "alloy.ee",
            "ephemeral_key": "n9LMfcjE6dMyshCqiftLFXpB9K3Mnd2r5bG7K8osmrkFpHUoR3c1",
            "master_key": "nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p",
            "seq": 4
        },
        "manifest": "JAAAAARxIe3AkJgOyqs3y+UuiAI27Ff3Mrfbt8e7mjdo06bnGEp5XnMhAu2LSAwZEQnm/mq9K6sSZJk5JkbcKCv6C7vQW2C8RnZVdkcwRQIhAI9uwQ1p58oyob1E+DaFLwjTdiRbVIKSMPqaaUwnJdN2AiB79DlPXHwztNULraVTkehbDsCAyDdf3VZB3FvkCZNOFHcIYWxsb3kuZWVwEkBf6A9ktcj2H4a61Av8ujQFL2KNcmr/FuEKbwlZEniJvhf0UqNiYc2bAsTJE5wMn00E0JBbw2m9OFwto50DcdkC",
        "requested": "nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p",
        "status": "success"
    }
}

server_definitions

Retrieves an SDK-compatible definitions.json generated from the currently running rippled instance.

The server_definitions command returns an SDK-compatible definitions.json, generated from the rippled instance currently running. You can use this to query a node in a network, quickly receiving the definitions necessary to serialize/deserialize its binary data.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Returns

To see a full definitions.json file and descriptions of the top-level fields, see the Definitions File (opens in a new tab).

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "server_definitions",
      "params": []
  }'

Response example

{
  "id": 1,
  "result": {
    "FIELDS": [
      [
        "Generic",
        {
          "isSerialized": false,
          "isSigningField": false,
          "isVLEncoded": false,
          "nth": 0,
          "type": "Unknown"
        }
      ],
      [
        "Invalid",
        {
          "isSerialized": false,
          "isSigningField": false,
          "isVLEncoded": false,
          "nth": -1,
          "type": "Unknown"
        }
      ],
      [
        "ObjectEndMarker",
        {
          "isSerialized": true,
          "isSigningField": true,
          "isVLEncoded": false,
          "nth": 1,
          "type": "STObject"
        }
      ],
      [
        "ArrayEndMarker",
        {
          "isSerialized": true,
          "isSigningField": true,
          "isVLEncoded": false,
          "nth": 1,
          "type": "STArray"
        }
      ]
      ...
    ]
  }
}

server_info (rippled)

Retrieves status of the server in human-readable format.

The server_info command asks the server for a human-readable version of various information about the rippled server (opens in a new tab) being queried.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • counters (boolean; optional): If true, return metrics about the job queue, ledger store, and API method activity. The default is false.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing an info object as its only field.

The info object may have some arrangement of the following fields:

  • amendment_blocked (boolean; may be omitted): If true, this server is amendment blocked. If the server is not amendment blocked (opens in a new tab), the response omits this field.
  • build_version (string): The version number of the running rippled server.
  • closed_ledger (object; may be omitted): Information on the most recently closed ledger that has not been validated by consensus, as a Server Ledger Object (opens in a new tab). If the most recently validated ledger is available, the response omits this field and includes validated_ledger instead.
  • complete_ledgers (string): Range expression indicating the sequence numbers of the ledger versions the local rippled has in its database. This may be a disjoint sequence such as 24900901-24900984,24901116-24901158. If the server does not have any complete ledgers (for example, it recently started syncing with the network), this is the string empty.
  • git (object; admin only): The Git details of your rippled build.
    • git.branch (string; admin only): The Git branch used to build your version of rippled.
    • git.hash (string; admin only): The Git hash of the commit used to build your version of rippled.
  • hostid (string): On an admin request, returns the hostname of the server running the rippled instance; otherwise, returns a single RFC-1751 (opens in a new tab) word based on the node public key (opens in a new tab).
  • io_latency_ms (number): Amount of time spent waiting for I/O operations, in milliseconds. If this number is not very, very low, then the rippled server is probably having serious load issues.
  • jq_trans_overflow (string — number): The number of times (since starting up) that this server has had over 250 transactions waiting to be processed at once. A large number here may mean that your server is unable to handle the transaction load of the XRP Ledger network. For detailed recommendations of future-proof server specifications, see Capacity Planning (opens in a new tab).
  • last_close (object): Information about the last time the server closed a ledger, including the amount of time it took to reach a consensus and the number of trusted validators participating.
    • last_close.converge_time_s (number): The amount of time it took to reach a consensus on the most recently validated ledger version, in seconds.
    • last_close.proposers (number): How many trusted validators the server considered (including itself, if configured as a validator) in the consensus process for the most recently validated ledger version.
  • load (object; admin only): Detailed information about the current load state of the server.
    • load.job_types (array; admin only): Information about the rate of different types of jobs the server is doing and how much time it spends on each.
    • load.threads (number; admin only): The number of threads in the server's main job pool.
  • load_factor (number): The multiplier to the transaction cost (opens in a new tab) the server is currently enforcing. For example, at 1000 load factor and a reference transaction cost of 10 drops of XRP, the load-scaled transaction cost is 10,000 drops (0.01 XRP). The load factor is determined by the highest of the individual server's load factor, the cluster's load factor, the open ledger cost, and the overall network's load factor.
  • load_factor_local (number; may be omitted): The current multiplier to the transaction cost based on load to this server.
  • load_factor_net (number; may be omitted): The current multiplier to the transaction cost being used by the rest of the network.
  • load_factor_cluster (number; may be omitted): The current multiplier to the transaction cost based on load to servers in this cluster (opens in a new tab).
  • load_factor_fee_escalation (number; may be omitted): The current multiplier to the transaction cost that a transaction must pay to get into the open ledger.
  • load_factor_fee_queue (number; may be omitted): The current multiplier to the transaction cost required to get into the queue, if the queue is full.
  • load_factor_server (number; may be omitted): The current multiplier based on server, cluster, and network load (not including open ledger cost).
  • network_ledger (string; may be omitted): When starting the server with the --net parameter (opens in a new tab), this field contains the string waiting while the server is syncing to the network.
  • peers (number): How many other rippled servers this one is currently connected to.
  • ports (array): A list of ports where the server is listening for API commands. Each entry is a Port Descriptor object (opens in a new tab).
  • pubkey_node (string): Public key used to verify this server for peer-to-peer communications. This node key pair (opens in a new tab) is automatically generated by the server the first time it starts up. (If deleted, the server can create a new pair of keys.) You can set a persistent value in the config file using the [node_seed] config option, which is useful for clustering (opens in a new tab).
  • pubkey_validator (string; admin only): Public key used by this node to sign ledger validations. This validation key pair is derived from the [validator_token] or [validation_seed] config field.
  • server_state (string): A string indicating to what extent the server is participating in the network. See Possible Server States (opens in a new tab) for more details.
  • server_state_duration_us (number): The number of consecutive microseconds the server has been in the current state.
  • state_accounting (object): A map of various server states (opens in a new tab) with information about the time the server spends in each. This can be useful for tracking the long-term health of your server's connectivity to the network. The contents of this field are formatted as State Accounting Objects (opens in a new tab).
  • uptime (number): Number of consecutive seconds that the server has been operational.
  • validated_ledger (object; may be omitted): Information about the most recent fully-validated ledger, as a Server Ledger Object (opens in a new tab). If not available, omitted and closed_ledger is included instead.
  • validation_quorum (number): Minimum number of trusted validations required to validate a ledger version.
  • validator_list_expires (string; admin only): Either the human-readable time, in UTC, when the current validator list expires, or the string unknown if the server has yet to load a published validator list, or the string never if the server uses a static validator list.
  • counters (object): Performance metrics regarding RPC calls, JobQueue, and nodestore details (node_writes, node_reads_total, node_reads_hit, etc.).
  • current_activity (object): Lists items currently being run in the job queue and contains two arrays for jobs and methods.

Port Descriptor Object

Each member of the ports array is an object with the following fields:

  • port (string — number): A port number where the server is listening.
  • protocol (array of string): A list of protocols being served on this port. Valid protocols include http or https for JSON-RPC, ws, ws2, wss, wss2 for WebSocket, grpc for gRPC, and peer for the XRP Ledger Peer Protocol (opens in a new tab).

State Accounting Object

Each field in the state_accounting object has a key that refers to a specific server state (opens in a new tab), and a value that is an object with the following fields:

  • duration_us (string — number): The number of microseconds the server has spent in this state. (This is updated whenever the server transitions into another state.)
  • transitions (string — number): The number of times the server has changed into this state.

Server Ledger Object

The response provides either a validated_ledger field or a closed_ledger field. Either field contains an object with the following fields:

  • age (number): The time since the ledger was closed, in seconds.
  • base_fee_xrp (number): Base fee, in XRP (not drops). This may be represented in scientific notation such as 1e-05 for 0.00001.
  • hash (string — hash (opens in a new tab)): Unique hash for the ledger, as hexadecimal.
  • reserve_base_xrp (number): Minimum amount of XRP (not drops) necessary for every account to keep in reserve.
  • reserve_inc_xrp (number): Amount of XRP (not drops) added to the account reserve for each object an account owns in the ledger.
  • seq (number): The ledger index (opens in a new tab) of the latest validated ledger.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "server_info",
      "params": [{"counters" : false}]
  }'

Response example

{
    "result": {
        "info": {
            "build_version": "2.6.2",
            "complete_ledgers": "100146025-100650763",
            "hostid": "SAD",
            "initial_sync_duration_us": "292599227",
            "io_latency_ms": 1,
            "jq_trans_overflow": "0",
            "last_close": {
                "converge_time_s": 3,
                "proposers": 35
            },
            "load_factor": 1,
            "peer_disconnects": "18440",
            "peer_disconnects_resources": "3",
            "peers": 49,
            "ports": [
                {
                    "port": "51235",
                    "protocol": [
                        "peer"
                    ]
                },
                {
                    "port": "51234",
                    "protocol": [
                        "http"
                    ]
                },
                {
                    "port": "51233",
                    "protocol": [
                        "ws"
                    ]
                },
                {
                    "port": "50051",
                    "protocol": [
                        "grpc"
                    ]
                }
            ],
            "pubkey_node": "n94B86FddoyYsndK6N8gZwcD5xoMonptkHxmWnNqc22naS5V1pF8",
            "server_state": "full",
            "server_state_duration_us": "99692864611",
            "state_accounting": {
                "connected": {
                    "duration_us": "283465932",
                    "transitions": "2"
                },
                "disconnected": {
                    "duration_us": "1040136",
                    "transitions": "2"
                },
                "full": {
                    "duration_us": "99692864611",
                    "transitions": "1"
                },
                "syncing": {
                    "duration_us": "8093158",
                    "transitions": "1"
                },
                "tracking": {
                    "duration_us": "0",
                    "transitions": "1"
                }
            },
            "time": "2025-Dec-04 15:01:28.199321 UTC",
            "uptime": 99985,
            "validated_ledger": {
                "age": 4,
                "base_fee_xrp": 1e-05,
                "hash": "DC9E71BB38F18D5202594FA800230B0B080199704D7CA02BD2524ED49170DA2F",
                "reserve_base_xrp": 1,
                "reserve_inc_xrp": 0.2,
                "seq": 100650763
            },
            "validation_quorum": 28
        },
        "status": "success"
    }
}

server_state

Retrieves status of the server in machine-readable format.

The server_state command asks the server for various machine-readable information about the rippled server's current state. The response is almost the same as the server_info rippled method, but uses units that are easier to process instead of easier to read. (For example, XRP values are given in integer drops instead of scientific notation or decimal values, and time is given in milliseconds instead of seconds.)

The Clio server does not support server_state directly, but you can ask for the server_state of the rippled server that Clio is connected to. Specify "ledger_index": "current" (WebSocket) or "params": [{"ledger_index": "current"}] (JSON-RPC).

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing a state object as its only field.

The state object may have some arrangement of the following fields:

  • amendment_blocked (boolean): (May be omitted) If true, this server is amendment blocked (opens in a new tab). If the server is not amendment blocked, the response omits this field.
  • build_version (string): The version number of the running rippled version.
  • complete_ledgers (string): Range expression indicating the sequence numbers of the ledger versions the local rippled has in its database. It is possible to be a disjoint sequence, e.g. "2500-5000,32570-7695432". If the server does not have any complete ledgers (for example, it recently started syncing with the network), this is the string empty.
  • closed_ledger (object): (May be omitted) Information on the most recently closed ledger that has not been validated by consensus, as a Server Ledger Object (opens in a new tab). If the most recently validated ledger is available, the response omits this field and includes validated_ledger instead.
  • io_latency_ms (number): Amount of time spent waiting for I/O operations, in milliseconds. If this number is not very, very low, then the rippled server is probably having serious load issues.
  • jq_trans_overflow (string — number): The number of times this server has had over 250 transactions waiting to be processed at once. A large number here may mean that your server is unable to handle the transaction load of the XRP Ledger network. For detailed recommendations of future-proof server specifications, see Capacity Planning (opens in a new tab).
  • last_close (object): Information about the last time the server closed a ledger, including the amount of time it took to reach a consensus and the number of trusted validators participating.
    • last_close.converge_time (number): The amount of time it took to reach a consensus on the most recently validated ledger version, in milliseconds.
    • last_close.proposers (number): How many trusted validators the server considered (including itself, if configured as a validator) in the consensus process for the most recently validated ledger version.
  • load (object): (Admin only) Detailed information about the current load state of the server.
    • load.job_types (array): (Admin only) Information about the rate of different types of jobs the server is doing and how much time it spends on each.
    • load.threads (number): (Admin only) The number of threads in the server's main job pool.
  • load_base (number): The baseline amount of server load used in transaction cost (opens in a new tab) calculations. If the load_factor is equal to the load_base, then only the base transaction cost is enforced. If the load_factor is higher than the load_base, then transaction costs are multiplied by the ratio between them. For example, if the load_factor is double the load_base, then transaction costs are doubled.
  • load_factor (number): The load factor the server is currently enforcing. The ratio between this value and the load_base determines the multiplier for transaction costs. The load factor is determined by the highest of the individual server's load factor, the cluster's load factor, the open ledger cost, and the overall network's load factor.
  • load_factor_fee_escalation (number): (May be omitted) The current multiplier to the transaction cost to get into the open ledger, in fee levels (opens in a new tab).
  • load_factor_fee_queue (number): (May be omitted) The current multiplier to the transaction cost to get into the queue, if the queue is full, in fee levels.
  • load_factor_fee_reference (number): (May be omitted) The transaction cost with no load scaling, in fee levels.
  • load_factor_server (number): (May be omitted) The load factor the server is enforcing, based on load to the server, cluster, and network, but not factoring in the open ledger cost.
  • network_ledger (string): (May be omitted) When starting the server with the --net parameter (opens in a new tab), this field contains the string waiting while the server is syncing to the network. The field is omitted otherwise.
  • peers (number): How many other rippled servers this one is currently connected to.
  • ports (array): A list of ports where the server is listening for API commands. Each entry in the array is a Port Descriptor object (opens in a new tab).
  • pubkey_node (string): Public key used to verify this server for peer-to-peer communications. This node key pair is automatically generated by the server the first time it starts up. (If deleted, the server can create a new pair of keys.) You can set a persistent value in the config file using the [node_seed] config option, which is useful for clustering (opens in a new tab).
  • pubkey_validator (string): (Admin only) Public key used by this node to sign ledger validations. This validation key pair is derived from the [validator_token] or [validation_seed] config field.
  • server_state (string): A string indicating to what extent the server is participating in the network. See Possible Server States (opens in a new tab) for more details.
  • server_state_duration_us (number): The number of consecutive microseconds the server has been in the current state.
  • state_accounting (object): A map of various server states (opens in a new tab) with information about the time the server spends in each. This can be useful for tracking the long-term health of your server's connectivity to the network. The contents of this field are formatted as State Accounting Objects (opens in a new tab).
  • time (string): The current time in UTC, according to the server's clock.
  • uptime (number): Number of consecutive seconds that the server has been operational.
  • validated_ledger (object): (May be omitted) Information about the most recent fully-validated ledger, as a Server Ledger Object (opens in a new tab). If the most recent validated ledger is not available, the response omits this field and includes closed_ledger instead.
  • validation_quorum (number): Minimum number of trusted validations required to validate a ledger version. Some circumstances may cause the server to require more validations.
  • validator_list_expires (number): (Admin only) When the current validator list expires, in seconds since the Ripple Epoch (opens in a new tab), or 0 if the server has yet to load a published validator list.

Port Descriptor Object

Each member of the ports array is an object with the following fields:

  • port (string — number): A port number where the server is listening.
  • protocol (array of string): A list of protocols being served on this port. Valid protocols include http or https for JSON-RPC, ws, ws2, wss, wss2 for WebSocket, grpc for gRPC, and peer for the XRP Ledger Peer Protocol (opens in a new tab).

State Accounting Object

Each field in the state_accounting object has a key that refers to a specific server state (opens in a new tab), and a value that is an object with the following fields:

  • duration_us (string — number): The number of microseconds the server has spent in this state. (This is updated whenever the server transitions into another state.)
  • transitions (string — number): The number of times the server has changed into this state.

Server Ledger Object

The response provides either a validated_ledger field or a closed_ledger field. Either field contains an object with the following fields:

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "server_state",
      "params": []
  }'

Response example

{
    "result": {
        "state": {
            "build_version": "2.6.2",
            "complete_ledgers": "100145467-100651296",
            "initial_sync_duration_us": "397921122",
            "io_latency_ms": 1,
            "jq_trans_overflow": "0",
            "last_close": {
                "converge_time": 3001,
                "proposers": 35
            },
            "load_base": 256,
            "load_factor": 256,
            "load_factor_fee_escalation": 256,
            "load_factor_fee_queue": 256,
            "load_factor_fee_reference": 256,
            "load_factor_server": 256,
            "peer_disconnects": "15089",
            "peer_disconnects_resources": "7",
            "peers": 24,
            "ports": [
                {
                    "port": "51235",
                    "protocol": [
                        "peer"
                    ]
                },
                {
                    "port": "51234",
                    "protocol": [
                        "http"
                    ]
                },
                {
                    "port": "51233",
                    "protocol": [
                        "ws"
                    ]
                },
                {
                    "port": "50051",
                    "protocol": [
                        "grpc"
                    ]
                }
            ],
            "pubkey_node": "n94B86FddoyYsndK6N8gZwcD5xoMonptkHxmWnNqc22naS5V1pF8",
            "server_state": "full",
            "server_state_duration_us": "101916702241",
            "state_accounting": {
                "connected": {
                    "duration_us": "391641811",
                    "transitions": "2"
                },
                "disconnected": {
                    "duration_us": "2071962",
                    "transitions": "2"
                },
                "full": {
                    "duration_us": "101916702241",
                    "transitions": "1"
                },
                "syncing": {
                    "duration_us": "4207345",
                    "transitions": "1"
                },
                "tracking": {
                    "duration_us": "1",
                    "transitions": "1"
                }
            },
            "time": "2025-Dec-04 15:35:55.844094 UTC",
            "uptime": 102314,
            "validated_ledger": {
                "base_fee": 10,
                "close_time": 818177751,
                "hash": "883E90590C94615CA601D2B9C577FE9AD382ADD5065550EA8021B8088AFD4581",
                "reserve_base": 1000000,
                "reserve_inc": 200000,
                "seq": 100651296
            },
            "validation_quorum": 28
        },
        "status": "success"
    }
}

version

Retrieves API version information.

The version command retrieves the API version information for the rippled server. For Clio servers, see version (clio) instead.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing a version object as its only field.

The version object returns some arrangement of the following fields:

  • first (string): Lowest supported API release.
  • last (string): Highest supported API release.
  • good (string): Default API if none specified.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "version",
      "params": []
  }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "status": "success",
        "version": {
            "first": "1.0.0",
            "good": "1.0.0",
            "last": "1.0.0"
        }
    }
}

Clio Methods:

These API methods are provided only by the Clio server, not rippled.

server_info

Retrieves status of the Clio server in human-readable format.

The server_info command asks the Clio server (opens in a new tab) for a human-readable version of various information about the Clio server being queried. For rippled servers, see server_info (rippled) instead.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing an info object as its only field.

The info object may have some arrangement of the following fields:

  • complete_ledgers (string): Range expression indicating the sequence numbers of the ledger versions the local rippled has in its database. This may be a disjoint sequence such as 24900901-24900984,24901116-24901158. If the server does not have any complete ledgers (for example, it recently started syncing with the network), this is the string empty.
  • counters (object; optional): Stats on API calls handled since server startup. This is present only if the client connects to the Clio server over localhost.
  • rpc (object; optional): Stats on each API call handled by the Clio server since startup. Since this is nested within the counters object, this is also present only if the client connects to the Clio server over localhost. The rpc object is a map of API method names to API Stats Objects.
  • subscriptions (object; optional): Number of current subscribers for each stream type. Since this is nested within the counters object, this is also present only if the client connects to the Clio server over localhost.
    • subscriptions.ledger
    • subscriptions.transactions
    • subscriptions.transactions_proposed
    • subscriptions.manifests
    • subscriptions.validations
    • subscriptions.account
    • subscriptions.accounts_proposed
    • subscriptions.books
  • time (string): The current time in UTC, according to the server's clock.
  • uptime (number): Number of consecutive seconds that the server has been operational.
  • amendment_blocked (boolean; optional): Whether the Clio server is Amendment Blocked.
  • load_factor (number): The load-scaled open ledger transaction cost the server is currently enforcing, as a multiplier on the base transaction cost. For example, at 1000 load factor and a reference transaction cost of 10 drops of XRP, the load-scaled transaction cost is 10,000 drops (0.01 XRP). The load factor is determined by the highest of the individual server's load factor (opens in a new tab), the cluster's load factor, the open ledger cost (opens in a new tab), and the overall network's load factor.
  • clio_version (string): The version number of the running Clio server.
  • libxrpl_version (string): The version number of the libxrpl library this Clio server was built against.
  • validation_quorum (number; optional): Minimum number of trusted validations required to validate a ledger version. Some circumstances may cause the server to require more validations. This value is obtained from rippled. This field may be omitted from the response if the Clio server is unable to connect to rippled for some reason.
  • rippled_version (string; optional): The version number of the running rippled server that the Clio server is connected to. This field may be omitted from the response if the Clio server is unable to connect to rippled for some reason.
  • network_id (string; optional): The network ID of the network that the rippled this Clio server is connected to is operating on. This field may be omitted from the response if the Clio server is unable to connect to rippled for some reason.
  • validated_ledger (object; optional): Information about the most recent fully-validated ledger. If the most recent validated ledger is not available, the response omits this field and includes closed_ledger instead.
    • validated_ledger.age (number): The time since the ledger was closed, in seconds.
    • validated_ledger.base_fee_xrp (number): Base fee, in XRP. This may be represented in scientific notation such as 1e-05 for 0.00001.
    • validated_ledger.hash (string): Unique hash for the ledger, as hexadecimal.
    • validated_ledger.reserve_base_xrp (number): Minimum amount of XRP (not drops) necessary for every account to keep in reserve. This may be represented in scientific notation such as 1e-05 for 0.00001.
    • validated_ledger.reserve_inc_xrp (number): Amount of XRP (not drops) added to the account reserve for each object an account owns in the ledger. This may be represented in scientific notation such as 1e-05 for 0.00001.
    • validated_ledger.seq (number): The ledger index (opens in a new tab) of the latest validated ledger.
    • validator_list_expires (string): (Admin only) Either the human-readable time, in UTC, when the current validator list expires, the string unknown if the server has yet to load a published validator list or the string never if the server uses a static validator list.
  • cache (object): Information on Clio's state data cache.
    • cache.size (number): Number of state data objects currently in the cache.
    • cache.is_full (boolean): True if cache contains all state data for a specific ledger, false otherwise. Some API calls, such as the book_offers method, process much faster when the cache is full.
    • cache.latest_ledger_seq (number): The ledger index of the latest validated ledger stored in the cache.
  • etl (object): The rippled sources (ETL sources) that the Clio server is connected to. This is present only if the client connects to the Clio server over localhost.
    • etl.etl_sources (array): List the rippled sources (ETL sources) that the Clio server is connected to and extracts data from.
      • etl.etl_sources.validated_range (string): The validated ledger range retrieved by the P2P rippled server.
      • etl.etl_sources.is_connected (boolean): True if Clio is connected to this source via websocket, false otherwise. A value of false here could indicate a networking issue, or that rippled is not running, amongst other things.
      • etl.etl_sources.ip (number): IP of the rippled server.
      • etl.etl_sources.ws_port (number): Websocket port of the rippled server.
      • etl.etl_sources.grpc_port (number): The gRPC connection port of the P2P rippled server that the Clio server is connected to.
      • etl.etl_sources.last_msg_age_seconds (number): Total seconds that have elapsed since Clio last heard anything from rippled. This should not be higher than 8.
    • etl.is_writer (boolean): true if this Clio server is currently writing data to the database, false otherwise.
    • etl.read_only (boolean): true if this Clio server is configured in read-only mode, false otherwise.
    • etl.last_publish_age_seconds (number): Time in seconds that have elapsed since this Clio server last published a ledger. This should not be more than 8.
  • validated (boolean): When true, this indicates that the response uses a ledger version that has been validated by consensus. In Clio, this is always true as Clio stores and returns validated ledger data. If a request was forwarded to rippled and the server returns current data, a missing or false value indicates that this ledger's data is not final.
  • status (string): Returns the status of the API request: success when the request completes successfully.

API Stats Objects

An API Stats object provides key metrics for every API call handled by the Clio server since startup. It includes the following fields:

  • started (number): Number of API calls of this type that the Clio server has started processing since startup.
  • finished (number): Number of API calls of this type that the Clio server has finished processing since startup.
  • errored (number): Number of API calls of this type that have resulted in some sort of error since startup.
  • forwarded (number): Number of API calls of this type that the Clio server has forwarded to a rippled P2P server since startup.
  • duration_us (number): The total number of microseconds spent processing API calls of this type since startup.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "server_info",
      "params": []
  }'

Response example

{
    "result": {
        "info": {
            "build_version": "2.6.2",
            "complete_ledgers": "100146025-100669999",
            "hostid": "SAD",
            "initial_sync_duration_us": "292599227",
            "io_latency_ms": 1,
            "jq_trans_overflow": "0",
            "last_close": {
                "converge_time_s": 3,
                "proposers": 35
            },
            "load_factor": 1,
            "peer_disconnects": "25682",
            "peer_disconnects_resources": "10",
            "peers": 50,
            "ports": [
                {
                    "port": "51235",
                    "protocol": [
                        "peer"
                    ]
                },
                {
                    "port": "51234",
                    "protocol": [
                        "http"
                    ]
                },
                {
                    "port": "51233",
                    "protocol": [
                        "ws"
                    ]
                },
                {
                    "port": "50051",
                    "protocol": [
                        "grpc"
                    ]
                }
            ],
            "pubkey_node": "n94B86FddoyYsndK6N8gZwcD5xoMonptkHxmWnNqc22naS5V1pF8",
            "server_state": "full",
            "server_state_duration_us": "174432150738",
            "state_accounting": {
                "connected": {
                    "duration_us": "283465932",
                    "transitions": "2"
                },
                "disconnected": {
                    "duration_us": "1040136",
                    "transitions": "2"
                },
                "full": {
                    "duration_us": "174432150738",
                    "transitions": "1"
                },
                "syncing": {
                    "duration_us": "8093158",
                    "transitions": "1"
                },
                "tracking": {
                    "duration_us": "0",
                    "transitions": "1"
                }
            },
            "time": "2025-Dec-05 11:47:07.485428 UTC",
            "uptime": 174724,
            "validated_ledger": {
                "age": 4,
                "base_fee_xrp": 1e-05,
                "hash": "88DD7DD8994E83A178D341FB9621610CD56B4576384FCA3A962A675E9C1A4003",
                "reserve_base_xrp": 1,
                "reserve_inc_xrp": 0.2,
                "seq": 100669999
            },
            "validation_quorum": 28
        },
        "status": "success"
    }
}

ledger

Retrieves info on the ledger version.

The ledger command retrieves information about the public ledger (opens in a new tab).

Note that the Clio server returns validated ledger data by default.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    • ledger_hash (hash (opens in a new tab); optional): The unique hash of the ledger version to use. (See Specifying Ledgers (opens in a new tab)).
    • ledger_index (ledger index (opens in a new tab); optional): The ledger index (opens in a new tab) of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers (opens in a new tab))
    • transactions (boolean; optional): If true, return information on transactions in the specified ledger version. Defaults to false. Ignored if you did not specify a ledger version.
    • expand (boolean; optional): Provide full JSON-formatted information for transaction/account information instead of only hashes. Defaults to false. Ignored unless you request transactions.
    • owner_funds (boolean; optional): If true, include owner_funds field in the metadata of OfferCreate transactions in the response. Defaults to false. Ignored unless transactions are included and expand is true.
    • binary (boolean; optional): If true, and transactions and expand are both also true, return transaction information in binary format (hexadecimal string) instead of JSON format.
    • diff (boolean; optional): If true, returns all objects that were added, modified, or deleted as part of applying transactions in the specified ledger.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing information about the ledger, including the following fields:

  • ledger (object): The complete header data of this ledger.
    • ledger.account_hash (string): Hash of all account state information in this ledger, as hex.
    • ledger.accountState (array; optional): All the account-state information (opens in a new tab) in this ledger.
    • ledger.close_flags (integer): A bit-map of flags relating to the closing of this ledger (opens in a new tab).
    • ledger.close_time (integer): The time this ledger was closed, in seconds since the Ripple Epoch (opens in a new tab).
    • ledger.close_time_human (string): The time this ledger was closed, in human-readable format. Always uses the UTC time zone.
    • ledger.close_time_resolution (integer): Ledger close times are rounded to within this many seconds.
    • ledger.closed (boolean): Whether this ledger has been closed or not.
    • ledger.ledger_hash (string): Unique identifying hash of the entire ledger.
    • ledger.ledger_index (string): The Ledger Index (opens in a new tab) of this ledger, as a quoted integer.
    • ledger.parent_close_time (integer): The time at which the previous ledger was closed.
    • ledger.parent_hash (string): Unique identifying hash of the ledger that came immediately before this one.
    • ledger.total_coins (string): Total number of XRP drops in the network, as a quoted integer. (This decreases as transaction costs destroy XRP.)
    • ledger.transaction_hash (string): Hash of the transaction information included in this ledger, as hex.
    • ledger.transactions (array; optional): Transactions applied in this ledger version. By default, members are the transactions' identifying Hash (opens in a new tab) strings. If the request specified expand as true, members are full representations of the transactions instead, in either JSON or binary depending on whether the request specified binary as true.
  • ledger_hash (string): Unique identifying hash of the entire ledger.
  • ledger_index (number): The Ledger Index (opens in a new tab) of this ledger.
  • validated (boolean; optional): If true, this is a validated ledger version. If omitted or set to false, this ledger's data is not final.
  • diff (object; optional): Object containing an array of hashes that were added, modified, or deleted as part of applying transactions for the ledger.

If the request specified "owner_funds": true and expanded transactions, the response has a field owner_funds in the metaData object of each OfferCreate transaction (opens in a new tab). The purpose of this field is to make it easier to track the funding status of offers (opens in a new tab) with each new validated ledger.

  • owner_funds (string): Numeric amount of the TakerGets currency that the Account sending this OfferCreate transaction has after the execution of all transactions in this ledger. This does not check whether the currency amount is frozen (opens in a new tab).

If the request specified "diff": true, the response has an object diff. The fields of this object are as follows:

  • object_id (string): The object identifier.
  • Hashes (object or string): Depending on whether the request set binary to true or false, this field returns the contents of the object that was created, the new value of an object that was modified, or an empty string if the object was deleted.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ledger",
      "params": [
          {
              "ledger_index": "validated",
              "transactions": false,
              "expand": false,
              "owner_funds": false,
              "diff": false
          }
      ]
  }'

Response example

{
    "result": {
        "ledger": {
            "account_hash": "F16BD4873733F45AA69A22E16669701FA6382BE5465EDA7B9B77AFCFBE9BB335",
            "close_flags": 0,
            "close_time": 818251651,
            "close_time_human": "2025-Dec-05 12:07:31.000000000 UTC",
            "close_time_iso": "2025-12-05T12:07:31Z",
            "close_time_resolution": 10,
            "closed": true,
            "ledger_hash": "57FAE517644B0E528D331D105D5E06071742CD7E35BE77C4F775E6FA98B38A83",
            "ledger_index": "100670317",
            "parent_close_time": 818251650,
            "parent_hash": "ECEB12B2CC088D735BA64F05DF424833B9CD1821FDFE72C8608FA0895BF8DA87",
            "total_coins": "99985745812732275",
            "transaction_hash": "B3440C9462D83D4CD22208538DA257974A99AC132EBE976CE7B581C36F8B8825"
        },
        "ledger_hash": "57FAE517644B0E528D331D105D5E06071742CD7E35BE77C4F775E6FA98B38A83",
        "ledger_index": 100670317,
        "status": "success",
        "validated": true
    }
}

mpt_holders

Retrieves the holders of a given MPT issuance for a given ledger.

For a given MPTokenIssuanceID and ledger sequence, mpt_holders returns all holders of that MPT (opens in a new tab) and their balance. This method likely returns very large data sets, so you should expect to implement paging via the marker field. This API is only available using Clio, not rippled.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

Returns

  • mpt_issuance_id (string): The MPTokenIssuance queried.
  • mptokens (array): An array of MPTokens (opens in a new tab). Includes all relevant fields in the underlying MPToken object.
  • marker (marker (opens in a new tab); optional): Used to continue querying where we left off when paginating. Omitted if there are no more entries after this result.
  • limit (number): The limit, as specified in the request.
  • ledger_index (ledger index (opens in a new tab)): The index of the ledger used.
  • validated (boolean): If true, the ledger has been validated by the consensus process and is immutable. Otherwise, the contents of the ledger are not final and may change. In Clio, this is always true as Clio stores and returns validated ledger data.

MPToken

An MPToken object has the following parameters:

  • account (string): The account address of the holder who owns the MPToken.
  • flags (number): The flags assigned to the MPToken object.
  • mpt_amount (string — number (opens in a new tab)): Specifies a positive amount of tokens currently held by the owner.
  • mptoken_index (string): Key of the MPToken object.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "mpt_holders",
      "params": [
          {
            "mpt_issuance_id": "0024D204E07DDDFBCD83B1649C07FE27FD536A3A32E6FDD8",
            "ledger_index": "validated"
          }
      ]
  }'

Response example

{
  "result": {
    "mpt_issuance_id": "0024D204E07DDDFBCD83B1649C07FE27FD536A3A32E6FDD8",
    "limit": 50,
    "ledger_index": 2415033,
    "mptokens": [
      {
        "account": "rfyWeQpYM3vCXRHA9cMLs2ZEdZv1F1jzm9",
        "flags": 0,
        "mpt_amount": "200",
        "mptoken_index": "22F99DCD55BCCF3D68DC3E4D6CF12602006A7563A6BE93FC57FD63298BCCEB13"
      }
    ],
    "validated": true,
    "status": "success"
  },
  "warnings": [
    {
      "id": 2001,
      "message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request"
    }
  ]
}

version

Retrieves API version information.

The version command retrieves the API version information of the Clio server (opens in a new tab). For rippled servers, see version (rippled) instead.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing an info object as its only field.

The version object returns some arrangement of the following fields:

  • first (integer): Lowest supported API release.
  • last (integer): Highest supported API release.
  • good (integer): Default API if none specified.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "version",
      "params": []
  }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "status": "success",
        "version": {
            "first": "1.0.0",
            "good": "1.0.0",
            "last": "1.0.0"
        }
    }
}

Utility Methods:

Use these methods to perform convenient tasks, such as ping and random number generation.

ping

Confirms connectivity with the server.

The ping command returns an acknowledgement, so that clients can test the connection status and latency.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing no fields. The client can measure the round-trip time from request to response as latency.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "ping",
      "params": []
  }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "status": "success"
    }
}

random

Generates a random number.

The random command provides a random number to be used as a source of entropy for random number generation by clients.

Parameters

  • id (integer; required): a request ID (example: 1).
  • jsonrpc (string; required): a JSON-RPC spec used (example: 2.0).
  • method (string; required): a method used for the request.
  • params (array; required): none.

Returns

The response follows the standard format (opens in a new tab), with a successful result containing the following field:

  • random (string): Random 256-bit hex value.

Request example

curl 'https://rpc.ankr.com/xrp_mainnet/{your_token}' \
-d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "random",
      "params": []
  }'

Response example

{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "random": "3060417EAEBDB220E2CBED2B4BCBAEDD805D8A1A8D7C405A868F11ABB7249B2A",
        "status": "success"
    }
}