Skip to main content

book_offers RPC Method

Retrieves a list of offers in a specified order book on the XRP Ledger

Updated on
Oct 4, 2023

book_offers RPC Method

Parameters

taker
string
The account that is taking the offers
taker_gets
object
REQUIRED
The details of the asset the taker wants to acquire. It contains the following properties:
currency
string
The currency code of the asset
taker_pays
object
REQUIRED
The details of the asset the taker is willing to give in exchange. It contains the following properties:
currency
string
The currency code of the asset
issuer
string
The issuer of the asset
limit
integer
The maximum number of offers to retrieve
ledger_index
string
The ledger index of the ledger to use
ledger_hash
string
A 20-byte hex string for identifying the ledger version

Returns

result
object
An object which contains the following fields:
ledger_hash
string
The hash of the ledger containing the offers
ledger_index
integer
The index of the ledger containing the offers
offers
array
A list of offers with the following properties:
owner_funds
integer
The amount of the currency that the offering side has available for trading
taker_gets_funded
integer
The maximum amount of currency that the taker can get provided the funding status
taker_pays_funded
integer
The maximum amount of currency that the taker would pay provided the funding status
quality
string
The exchange rate, as the ratio 'taker_pays' divided by 'taker_gets'
validated
boolean
It indicates whether the result has been validated
status
string
The status of the request
warnings
array
An array of warning objects, each containing the following fields:
id
integer
The ID of the warning
message
string
The warning message
Request
1
curl https://docs-demo.xrp-mainnet.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{
5
"method": "book_offers",
6
"params": [{
7
"taker": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
8
"taker_gets": {"currency": "XRP"},
9
"taker_pays": {
10
"currency": "USD",
11
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"},
12
"limit": 10
13
}],"id":1,"jsonrpc":"2.0"}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free