book_changes
Reports information about changes to the order books in the decentralized exchange compared with the previous ledger version. Useful for building candlestick charts.
This method will use 40 Compute Units.
Reference: Here
Parameters
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 asvalidated.
Returns
type(string) The stringbookChanges.ledger_hash(string) The identifying hash of the ledger version used.ledger_index(number) The ledger index of the ledger version used.ledger_time(number) The official close time of the ledger, in seconds since the Ripple Epoch.validated(boolean) Iftrue, the information comes from a validated ledger version.changes(array) One book update object per order book that was updated in this ledger, each withcurrency_a(XRP_dropsfor XRP, otherwiseissuer/currency),currency_b,volume_a,volume_b,high,low,openandclose. Empty if no order books were updated.
// Result
{
"result": {
"type": "bookChanges",
"ledger_hash": "925A0E8F39F21363E351A8F4551AEEC2751142B5997816FB722B7A1BF1D61F9A",
"ledger_index": 107292936,
"ledger_time": 843914960,
"validated": true,
"changes": [
{
"currency_a": "XRP_drops",
"currency_b": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De/524C555344000000000000000000000000000000",
"volume_a": "30601560",
"volume_b": "46.4167",
"high": "659279.0956703084",
"low": "659279.0956703084",
"open": "659279.0956703084",
"close": "659279.0956703084"
}
],
"status": "success"
}
}Over WebSocket, send {"id":1,"command":"book_changes","ledger_index":"validated"} to wss://mainnet.xrpl.validationcloud.io/v1/<YOUR_API_KEY_HERE>.
Last updated
Was this helpful?