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: Treasury Account Snapshot#

The Mythos treasury pallet maps to the 20-byte account 0xef96002999670d623b6aa36f771d89ad527aff8b. Query its System.Account entry to verify balances before scheduling disbursements.

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

Sample response (2025-10-03):

{
"jsonrpc": "2.0",
"id": 42,
"result": "0x000000000000000001000000000000000000c16ff28623000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080"
}

Decode the SCALE payload as AccountInfo<AccountData> to obtain free = 0.01 MYTH, reserved = 0, and flags = 0x80.

Decoding in JavaScript#

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

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

const accountId = '0xef96002999670d623b6aa36f771d89ad527aff8b';
const info = await api.query.system.account(accountId);
console.log('Free balance (plancks):', info.data.free.toString());
}

treasuryBalance().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.