debug_storageRangeAt
https://api.triport.io/v1/ethReturns a page of contract storage slots as they existed at a specific transaction within a given block.
debug_storageRangeAt reads the storage trie of a single contract and returns a
range (page) of its slots, reconstructed at the state that existed after a
chosen transaction in a chosen block. Each entry is a preimage key and its
32-byte value, indexed by the hash of the slot key. Because storage is a large
keyed map, the method is paginated: you give it a starting key and a maximum
count, and it returns the slots from that point plus a nextKey cursor to
continue from.
Use this when you need to inspect or snapshot raw contract state at a precise point in history — for example to audit a storage layout, diff a contract's slots across two transactions, or recover a value that is not exposed through a view function. Unlike a single-slot read, it walks the trie and hands back many slots in one call.
This is a debug-namespace method and is available on the Pro tier and
above. It is rate limited per tier (5 RPS on Pro, 15 RPS on Business) with a
short burst allowance; there is no daily quota.
Parameters
Five positional parameters, in order.
blockHashstringrequired0x-prefixed 32-byte hash of the block whose state is inspected.txIndexnumberrequired0 for the state at the start of the block.contractAddressstringrequired0x-prefixed 20-byte address of the contract whose storage is read.startKeystringrequired0x-prefixed 32-byte hash of the storage slot to start from (the trie is keyed by the hash of each slot key). Use 0x0000…0000 to start at the beginning.maxResultnumberrequiredResponse
Response fields
| Field | Type | Description |
|---|---|---|
result.storage | object | Map of storage entries for this page, keyed by the 0x-prefixed hash of the slot key. |
result.storage[hash].key | string | null | The 0x-prefixed preimage of the slot key, or null if the node could not recover the preimage. |
result.storage[hash].value | string | The 0x-prefixed 32-byte value stored in that slot. |
result.nextKey | string | null | Cursor: the 0x-prefixed hash to pass as startKey to fetch the next page, or null when this page is the last one. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
-32002 | tier_insufficient | Your API key's tier is below Pro; this debug-namespace method is not enabled for it. |
-32003 | rate_limited | You exceeded your tier's request rate (5 RPS on Pro, 15 RPS on Business) including burst. Retry after a short back-off. |
See the shared error envelope reference for the full error object shape and handling guidance.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/eth", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "debug_storageRangeAt",
params: [
"0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
0,
"0x6b175474e89094c44da98b954eedeac495271d0f",
"0x0000000000000000000000000000000000000000000000000000000000000000",
2,
],
}),
});
const { result } = await res.json();
console.log(result.storage, result.nextKey);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const page = await triport.eth.request("debug_storageRangeAt", [
"0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
0,
"0x6b175474e89094c44da98b954eedeac495271d0f",
"0x0000000000000000000000000000000000000000000000000000000000000000",
2,
]);
console.log(page.storage, page.nextKey);Python (triport-sdk)
import os
from triport import Triport
triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])
page = triport.eth.request("debug_storageRangeAt", [
"0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331",
0,
"0x6b175474e89094c44da98b954eedeac495271d0f",
"0x0000000000000000000000000000000000000000000000000000000000000000",
2,
])
print(page["storage"], page["nextKey"])Notes
- Pagination. Keep calling with
startKeyset to the previous response'snextKeyuntilnextKeycomes backnull. ChoosemaxResultto balance response size against the number of round-trips. - State point.
txIndexselects the state after that transaction in the block; pass0to read the storage as it stood at the start of the block. keymay benull. The node returns the slot-key preimage when it has it; for some slots only the hashed key is known, in which casekeyisnullwhilevalueis still returned.- Archive history. Reconstructing storage at an old block requires archive state; very old blocks may be unavailable depending on retention.
- For tracing execution rather than reading state, see
debug_traceTransaction; for a contract's full storage proof at a block, seeeth_getProof.