Docs

state_getKeys

List storage keys under a given prefix in Bifrost's state, useful for enumerating omnipool or staking data.

Description

Returns all storage keys with a given prefix. Use this to discover accounts, vToken positions, or other on-chain items before fetching values with state_getStorage.

Request Example

JSON
{
  "jsonrpc": "2.0",
  "method": "state_getKeys",
  "params": [
    "0x26aa394eea5630e07c48ae0c9558cef7",
    null
  ],
  "id": 1
}

Code Examples

Python
keys = substrate.rpc_request(
    method='state_getKeys',
    params=['0x26aa394eea5630e07c48ae0c9558cef7', None]
)["result"]
print(len(keys))

Tips

  • For large datasets prefer state_getKeysPaged to avoid stress-testing nodes.
  • Combine with Bifrost-specific prefixes (e.g., Omnipool or Farming) to iterate liquidity pools and reward schedules.