For the complete documentation index, see llms.txt. This page is also available as Markdown.

state_getkeyspagedat - Midnight

Example code for the state_getkeyspagedat JSON-RPC method. Complete guide on how to use state_getkeyspagedat JSON-RPC in GetBlock Web3 documentation.

This method is the same as state_getKeysPaged but takes the block hash as a required parameter, returning keys at that specific block.

Parameters

Parameter
Type
Required
Description

prefix

string

Yes

Hex-encoded storage key prefix

count

integer

Yes

Maximum number of keys to return

startKey

string

No

Hex-encoded key to start from (exclusive)

hash

string

Yes

Block hash at which to query

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "state_getKeysPagedAt",
    "params": [
        "0x26aa394eea5630e07c48ae0c9558cef7",
        100,
        null,
        "0x87f5c08ba8334e4ee1642ff9646e94dd46080b71fff03714be8b36f22e481b95"
    ],
    "id": "getblock.io"
}'

Response Example

Response Parameters

Field
Type
Description

result

array of string

Array of hex-encoded storage keys at the given block

Use Cases

  • Reading historical state pages at a specific block

  • Archival indexers that need consistent snapshots

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?