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
{
"jsonrpc": "2.0",
"method": "state_getKeys",
"params": [
"0x26aa394eea5630e07c48ae0c9558cef7",
null
],
"id": 1
}Code Examples
keys = substrate.rpc_request(
method='state_getKeys',
params=['0x26aa394eea5630e07c48ae0c9558cef7', None]
)["result"]
print(len(keys))Tips
- For large datasets prefer
state_getKeysPagedto avoid stress-testing nodes. - Combine with Bifrost-specific prefixes (e.g.,
OmnipoolorFarming) to iterate liquidity pools and reward schedules.
state_call
Call a runtime API function on Bifrost. Execute on-chain computations like account nonce lookups, fee estimation, and custom runtime logic without submitting a transaction.
state_getKeysPaged
Enumerate storage keys with pagination on Bifrost. Iterate over storage maps like accounts, validators, and assets efficiently with cursor-based pagination.