Honeycluster's edge routes historical queries to Clio, which indexes the entire ledger into a column store. This tutorial walks through fetching an arbitrary historical ledger and inspecting the transactions it contained.
Before writing any code, try the JSON-RPC version of the request interactively. The public endpoint is keyless, so this button works without any setup:
curl -X POST 'https://honeycluster.io'Bashpnpm add xrpl
TypeScriptimport { Client } from 'xrpl' const client = new Client('wss://honeycluster.io') await client.connect() const response = await client.request({ command: 'ledger', ledger_index: 30_000_000, transactions: true, expand: true, }) const ledger = response.result.ledger console.log('close time:', ledger.close_time_human) console.log('tx count:', ledger.transactions?.length ?? 0)
transactions: true asks rippled for the list of transaction hashes;
expand: true tells Clio to return full transaction objects instead of just
their hashes. Combining the two is only efficient against Clio — against
rippled it would be rejected for ancient ledgers.
TypeScriptfor (const tx of ledger.transactions ?? []) { if (typeof tx === 'string') continue // shouldn't happen with expand:true console.log( tx.TransactionType, tx.hash, tx.Account, '→', 'Destination' in tx ? tx.Destination : '—' ) }
TypeScriptawait client.disconnect()
Ledgers during network peaks can contain 1,000+ transactions. If you only
need a subset, use ledger_data with binary: false, limit: 200 and
paginate through via the returned marker field:
TypeScriptlet marker: unknown = undefined do { const page = await client.request({ command: 'ledger_data', ledger_index: 30_000_000, limit: 200, marker, }) // ...handle page.result.state... marker = page.result.marker } while (marker)
Paginating keeps individual responses small and predictable, which is friendlier on slow networks and easier to checkpoint if your worker crashes mid-scan.
A single historical ledger call with expand:true is charged against your
Clio quota. Watch the X-Credits-Remaining header on the response — or see
Rate Limits for the full cost model.