state_getRuntimeVersion
Provides the current runtime version numbers and supported API hashes. Use this to detect when an upgrade occurs so you can refresh metadata, regenerate types, or recompile Wasm bindings.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
at | string | No | Optional block hash for historical runtime versions. |
Returns#
| Field | Type | Description |
|---|---|---|
result.specName | string | Runtime name (e.g., manta). |
result.specVersion | number | Runtime spec version. Increments on logic changes. |
result.implVersion | number | Implementation version. |
result.transactionVersion | number | Transaction version for extrinsic encoding. |
result.apis | array | Supported runtime API hashes and versions. |
Response Snapshot (2 Oct 2025)#
{
"jsonrpc": "2.0",
"result": {
"specName": "manta",
"implName": "manta",
"authoringVersion": 1,
"specVersion": 4730,
"implVersion": 1,
"transactionVersion": 10,
"stateVersion": 1,
"apis": [
["0xdf6acb689907609b", 4],
["0x37e397fc7c91f5e4", 2],
["0xf78b278be53f454c", 2],
["0x2aa62120049dd2d2", 1]
]
},
"id": 1
}
Code Example#
import { ApiPromise, WsProvider } from '@polkadot/api';
const provider = new WsProvider('wss://api-manta-atlantic-mainnet.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });
const version = await api.rpc.state.getRuntimeVersion();
console.log(`Runtime ${version.specName.toString()} v${version.specVersion.toNumber()}`);
Operational Tips#
- Watch for
specVersionincrements to trigger automatic metadata regeneration in your pipelines. - Compare
transactionVersionwhen caching signed payloads—if the value changes, rebuild extrinsics. - Track API hash changes if you rely on custom runtime APIs such as
mantaSBT_*orzenlinkProtocol_*.