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

state_getRuntimeVersion

Description

Returns the runtime API versioning information for the current block. Use this to decide when to refresh metadata, regenerate type bundles, or deploy runtime-dependent logic.

Parameters

PositionTypeDescription
0 (optional)stringBlock hash to query. Defaults to the latest block when omitted.

Returns

FieldTypeDescription
specNamestringRuntime name (e.g., astar)
implNamestringImplementation identifier
specVersionnumberRuntime spec version
implVersionnumberImplementation version
transactionVersionnumberExtrinsic format version
apisarraySupported runtime APIs and versions

Request Example

{
"jsonrpc": "2.0",
"method": "state_getRuntimeVersion",
"params": [],
"id": 1
}

Response Example

Captured 2025-10-03

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"specName": "astar",
"implName": "astar",
"authoringVersion": 1,
"specVersion": 1700,
"implVersion": 0,
"transactionVersion": 3,
"apis": [
["0xdf6acb689907609b", 5],
["0x37e397fc7c91f5e4", 2],
"… truncated …"
]
}
}

Code Examples

cURL

curl https://api-astar.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "state_getRuntimeVersion",
"params": [],
"id": 1
}'

JavaScript (polkadot.js)

const api = await ApiPromise.create({ provider: new WsProvider('wss://api-astar.n.dwellir.com/YOUR_API_KEY') });
const runtime = await api.rpc.state.getRuntimeVersion();
console.log(`spec=${runtime.specVersion} tx=${runtime.transactionVersion}`);

Python (py-substrate-interface)

from substrateinterface import SubstrateInterface

substrate = SubstrateInterface(url="wss://api-astar.n.dwellir.com/YOUR_API_KEY", ss58_format=5)
version = substrate.get_runtime_version()
print(version['specVersion'], version['transactionVersion'])