Docs
Supported ChainsAsset HubSubstrate APIState Methods

state_getRuntimeVersion - Asset Hub RPC Method

Get runtime version on Asset Hub. Essential for version checking and compatibility.

Returns the runtime version on Asset Hub.

Use Cases

  • Version checking - Verify runtime compatibility
  • Upgrade detection - Monitor for runtime upgrades on native stablecoin transfers (USDC, USDT), DOT staking and governance, and cross-chain asset management via XCM
  • Client compatibility - Ensure API compatibility

Request Parameters

Request
blockHashString

Block hash for historical version

Response Body

Response

Code Examples

Bash
curl https://api-asset-hub-polkadot.n.dwellir.com/<YOUR_API_KEY>/YOUR_API_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "state_getRuntimeVersion",
    "params": [],
    "id": 1
  }'
JavaScript
import { ApiPromise, WsProvider } from '@polkadot/api';

const provider = new WsProvider('wss://api-asset-hub-polkadot.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });

const version = await api.rpc.state.getRuntimeVersion();
console.log('Spec name:', version.specName.toString());
console.log('Spec version:', version.specVersion.toNumber());
console.log('Impl version:', version.implVersion.toNumber());

await api.disconnect();
Python
import requests

def get_runtime_version():
    url = 'https://api-asset-hub-polkadot.n.dwellir.com/<YOUR_API_KEY>/YOUR_API_KEY'

    payload = {
        'jsonrpc': '2.0',
        'method': 'state_getRuntimeVersion',
        'params': [],
        'id': 1
    }

    response = requests.post(url, json=payload)
    return response.json()['result']

version = get_runtime_version()
print(f"Spec: {version['specName']} v{version['specVersion']}")

On this page