state_getStorageSizeAt
Description
Read SCALE‑encoded storage for a key (optionally at a specific block). Use to fetch on‑chain state deterministically and to implement historical reads.
Returns the size (in bytes) of the storage value for the key at the given block.
Code Examples
- cURL
- Python
- JavaScript
curl -X POST https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY \
+ -H 'Content-Type: application/json' \
+ -d '{"jsonrpc":"2.0","method":"state_getStorageSizeAt","params":["0x3a636f6465", "0x1e8a700fa840157d8d5617eac90ecd3b795d6469ddb8a9ec7dd2d051d806e85d"],"id":1}'
import requests, json
url = 'https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY'
headers = {'Content-Type': 'application/json'}
payload = {
"jsonrpc": "2.0",
"method": "state_getStorageSizeAt",
"params": [
"0x3a636f6465",
"0x1e8a700fa840157d8d5617eac90ecd3b795d6469ddb8a9ec7dd2d051d806e85d"
],
"id": 1
}
res = requests.post(url, headers=headers, data=json.dumps(payload))
print(res.json()['result'])
const res = await fetch('https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"jsonrpc": "2.0",
"method": "state_getStorageSizeAt",
"params": [
"0x3a636f6465",
"0x1e8a700fa840157d8d5617eac90ecd3b795d6469ddb8a9ec7dd2d051d806e85d"
],
"id": 1
})
});
const data = await res.json();
console.log(data.result);