> For the complete documentation index, see [llms.txt](https://docs.bifrostnetwork.com/bifrost-network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bifrostnetwork.com/bifrost-network/developer-documentations/client-api/json-rpc-api/state.md).

# state

### **call(method: `Text`, data: `Bytes`, at?: `BlockHash`): `Bytes`**

* **interface**: `api.rpc.state.call`
* **jsonrpc**: `state_call` (alias=`state_callAt`)
* **summary**: Calls a contract (pallet) at a block's state.

### **getChildReadProof(childStorageKey: `PrefixedStorageKey`, keys: `Vec<StorageKey>`, at?: `BlockHash`): `ReadProof`**

* **interface**: `api.rpc.state.getChildReadProof`
* **jsonrpc**: `state_getChildReadProof`
* **summary**: Returns proof of storage for child key entries at a specific block state.

### **getKeys(key: `StorageKey`, at?: `BlockHash`): `Vec<StorageKey>`**

* **interface**: `api.rpc.state.getKeys`
* **jsonrpc**: `state_getKeys`
* **summary**: Retrieves the keys with a certain prefix.
* **deprecated**: Use `api.rpc.state.getKeysPaged` to retrieve keys.

### **getKeysPaged(key: `StorageKey`, count: `u32`, startKey?: `StorageKey`, at?: `BlockHash`): `Vec<StorageKey>`**

* **interface**: `api.rpc.state.getKeysPaged`
* **jsonrpc**: `state_getKeysPaged` (alias=`state_getKeysPagedAt`)
* **summary**: Returns the keys with prefix with pagination support.

### **getMetadata(at?: `BlockHash`): `Metadata`**

* **interface**: `api.rpc.state.getMetadata`
* **jsonrpc**: `state_getMetadata`
* **summary**: Returns the runtime metadata.

### **getPairs(prefix: `StorageKey`, at?: `BlockHash`): `Vec<KeyValue>`**

* **interface**: `api.rpc.state.getPairs`
* **jsonrpc**: `state_getPairs`
* **summary**: Returns the keys with prefix, leaves empty to get all the keys (deprecated: Use getKeysPaged).
* **deprecated**: Use `api.rpc.state.getKeysPaged` to retrieve keys.

### **getReadProof(keys: `Vec<StorageKey>`, at?: `BlockHash`): `ReadProof`**

* **interface**: `api.rpc.state.getReadProof`
* **jsonrpc**: `state_getReadProof`
* **summary**: Returns proof of storage entries at a specific block state.

### **getRuntimeVersion(at?: `BlockHash`): `RuntimeVersion`**

* **interface**: `api.rpc.state.getRuntimeVersion`
* **jsonrpc**: `state_getRuntimeVersion` (alias=`chain_getRuntimeVersion`)
* **summary**: Gets the runtime version.

### **getStorage(key: `StorageKey`, at?: `BlockHash`): `StorageData`**

* **interface**: `api.rpc.state.getStorage`
* **jsonrpc**: `state_getStorage` (alias=`state_getStorageAt`)
* **summary**: Retrieves the storage for a key.

### **getStorageHash(key: `StorageKey`, at?: `BlockHash`): `Hash`**

* **interface**: `api.rpc.state.getStorageHash`
* **jsonrpc**: `state_getStorageHash` (alias=`state_getStorageHashAt`)
* **summary**: Retrieves the storage hash.

### **getStorageSize(key: `StorageKey`, at?: `BlockHash`): `u64`**

* **interface**: `api.rpc.state.getStorageSize`
* **jsonrpc**: `state_getStorageSize` (alias=`state_getStorageSizeAt`)
* **summary**: Retrieves the storage size.

### **queryStorage(keys: `Vec<StorageKey>`, fromBlock: `Hash`, toBlock?: `BlockHash`): `Vec<StorageChangeSet>`**

* **interface**: `api.rpc.state.queryStorage`
* **jsonrpc**: `state_queryStorage`
* **summary**: Queries historical storage entries (by key) starting from a start block.

### **queryStorageAt(keys: `Vec<StorageKey>`, at?: `BlockHash`): `Vec<StorageChangeSet>`**

* **interface**: `api.rpc.state.queryStorageAt`
* **jsonrpc**: `state_queryStorageAt`
* **summary**: Queries storage entries (by key) starting at block hash given as the second parameter.

### **subscribeRuntimeVersion(): `RuntimeVersion`**

* **interface**: `api.rpc.state.subscribeRuntimeVersion`
* **jsonrpc**: `state_subscribeRuntimeVersion`
* **summary**: Retrieves the runtime version via subscription.

### **subscribeStorage(keys?: `Vec<StorageKey>`): `StorageChangeSet`**

* **interface**: `api.rpc.state.subscribeStorage`
* **jsonrpc**: `state_subscribeStorage`
* **summary**: Subscribes to storage changes for the provided keys.

### **traceBlock(block: `Hash`, targets: `Option<Text>`, storageKeys: `Option<Text>`, methods: `Option<Text>`): `TraceBlockResponse`**

* **interface**: `api.rpc.state.traceBlock`
* **jsonrpc**: `state_traceBlock`
* **summary**: Provides a way to trace the re-execution of a single block.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bifrostnetwork.com/bifrost-network/developer-documentations/client-api/json-rpc-api/state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
