⚠️Blast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip Alchemy's expensive compute units.
Switch Today →
Skip to main content

state_getStorage – Mythos JSON-RPC Method

state_getStorage retrieves runtime storage values at a given block state. On Mythos, use it to monitor NFT collection configs, marketplace order books, and token issuance without waiting for events.

Parameters

ParameterTypeRequiredDescription
keystringYesHex-encoded storage key (Twox/Blake hashed)
blockHashstringNoBlock hash to query historical state

Example: Next NFT Collection ID

Mythos uses an incrementing NextCollectionId counter in pallet_nfts. Query it to determine the next available collection slot before launching a new drop.

curl https://api-mythos-archive.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "state_getStorage",
"params": [
"STORAGE_KEY_HEX",
"0x608b663e3bcc47c0678baf6dbe449ac49e6ac6ddd5119ef494ca5b3b2dc2e5bb"
],
"id": 42
}'

Replace STORAGE_KEY_HEX with the output of api.query.nfts.nextCollectionId.key() or an equivalent tooling pipeline before running the request.

Decoding in JavaScript

import { ApiPromise, WsProvider } from '@polkadot/api';
import { u128 } from '@polkadot/types';

async function nextCollectionId() {
const api = await ApiPromise.create({
provider: new WsProvider('wss://api-mythos-archive.n.dwellir.com/YOUR_API_KEY')
});

const key = api.query.nfts.nextCollectionId.key();
const raw = await api.rpc.state.getStorage(key);
if (raw.isNone) throw new Error('Storage key missing');

const id = new u128(api.registry, raw.unwrap());
console.log('Next Mythos collection ID:', id.toString());
}

nextCollectionId().catch(console.error);

Tips

  • Snapshot state_getStorage alongside marketplace events to reconcile escrow balances.
  • Use blockHash when auditing DAO proposals or NFT drops that may have been reverted.
  • Combine with state_queryStorageAt for successive key updates during live events.