state_getKeysPaged – Mythos JSON-RPC Method
Retrieves a page of storage keys for a given prefix. This call is the preferred way to iterate large maps (such as player inventory or marketplace listings) without overloading the RPC endpoint.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
keyPrefix | string | Yes | Hex-encoded storage prefix. |
count | number | Yes | Maximum number of keys to return. |
startKey | string | No | Key to start after (exclusive). |
at | string | No | Block hash. Defaults to latest. |
Request Example#
{
"jsonrpc": "2.0",
"method": "state_getKeysPaged",
"params": [
"0x26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da9",
100,
null,
null
],
"id": 1
}
Recommendations#
- Choose a page size based on workload; 100 keys keeps responses manageable while covering most use cases.
- Record the last key returned and provide it in the next request to resume iteration.
- Pair with
state_getStorageHashwhen you need key existence checks without downloading full values.