Skip to main content
Retrieves a list of offers between two currencies, also known as an order book. The response omits unfunded offers and reports how much of each remaining offer is funded. This method will use 40 Compute Units.

Reference: Here

Parameters

  • taker_gets (object, required) The asset the account taking the offer would receive, as a currency object without an amount (currency, plus issuer for tokens).
  • taker_pays (object, required) The asset the account taking the offer would pay, in the same format.
  • domain (string, optional) The ledger entry ID of a permissioned domain. If provided, return offers from the corresponding permissioned DEX instead of the open DEX.
  • ledger_hash (string, optional) The unique hash of the ledger version to use.
  • ledger_index (number or string, optional) The ledger index of the ledger to use, or a shortcut string such as validated, closed or current.
  • limit (number, optional) The maximum number of offers to return. The response may include fewer results.
  • taker (string, optional) The address of an account to use as a perspective. The response includes this account’s offers even if they are unfunded.

Returns

  • ledger_current_index (number) Omitted if ledger_index is provided.
  • ledger_index (number) The ledger index of the ledger version used.
  • ledger_hash (string) The identifying hash of the ledger version used.
  • offers (array) Array of Offer ledger entries, each with the additional fields owner_funds (how much of TakerGets the owner can trade), quality (taker_pays divided by taker_gets) and, for partially funded offers, taker_gets_funded and taker_pays_funded.
Over WebSocket, send {"id":1,"command":"book_offers","taker_gets":{"currency":"XRP"},"taker_pays":{"currency":"524C555344000000000000000000000000000000","issuer":"rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De"},"ledger_index":"validated","limit":2} to wss://mainnet.xrpl.validationcloud.io/v1/<YOUR_API_KEY_HERE>.