TriportRPC

debug_storageRangeAt

POSThttps://api.triport.io/v1/eth

Returns a page of contract storage slots as they existed at a specific transaction within a given block.

Ethereumeth_debugPro — 5 RPS · Business — 15 RPS

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.

blockHashstringrequired
0x-prefixed 32-byte hash of the block whose state is inspected.
txIndexnumberrequired
Index of the transaction within that block. State is reconstructed as of after this transaction executes; use 0 for the state at the start of the block.
contractAddressstringrequired
0x-prefixed 20-byte address of the contract whose storage is read.
startKeystringrequired
0x-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.
maxResultnumberrequired
Maximum number of storage slots to return in this page.

Response

Response fields

FieldTypeDescription
result.storageobjectMap of storage entries for this page, keyed by the 0x-prefixed hash of the slot key.
result.storage[hash].keystring | nullThe 0x-prefixed preimage of the slot key, or null if the node could not recover the preimage.
result.storage[hash].valuestringThe 0x-prefixed 32-byte value stored in that slot.
result.nextKeystring | nullCursor: the 0x-prefixed hash to pass as startKey to fetch the next page, or null when this page is the last one.

Errors

CodeMeaningWhen it happens
-32002tier_insufficientYour API key's tier is below Pro; this debug-namespace method is not enabled for it.
-32003rate_limitedYou 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 startKey set to the previous response's nextKey until nextKey comes back null. Choose maxResult to balance response size against the number of round-trips.
  • State point. txIndex selects the state after that transaction in the block; pass 0 to read the storage as it stood at the start of the block.
  • key may be null. The node returns the slot-key preimage when it has it; for some slots only the hashed key is known, in which case key is null while value is 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, see eth_getProof.