Skip to main content

state_getRuntimeVersion - JSON-RPC Method

Description#

Returns the active runtime metadata versions for an Enjin Matrix node, including the specVersion and transactionVersion. These values are essential when caching metadata, selecting type bundles, or ensuring extrinsic encoding compatibility after runtime upgrades.

Parameters#

No parameters are required.

Returns#

FieldTypeDescription
specNamestringRuntime identifier (matrix-enjin)
implNamestringImplementation identifier
specVersionnumberRuntime specification version (increments on upgrades)
implVersionnumberImplementation version
transactionVersionnumberTransaction encoding version
apisarrayRPC API versions exposed by the runtime

Request Example#

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

Response Example#

{
"jsonrpc": "2.0",
"result": {
"specName": "matrix-enjin",
"implName": "matrix-enjin",
"authoringVersion": 0,
"specVersion": 1022,
"implVersion": 0,
"apis": [
["0xfbc577b9d747efd6", 1],
["0xdf6acb689907609b", 5],
["0x37e397fc7c91f5e4", 2],
["0x40fe3ad401f8959a", 6],
["0xd7bdd8a272ca0d65", 1],
["0xd2bc9897eed08f15", 3],
["0xf78b278be53f454c", 2],
["0xab3c0572291feb8b", 1],
["0xdd718d5cc53262d4", 1],
["0xea93e3f16f3d6962", 2],
["0xbc9d89904f5b923f", 1],
["0x37c8bb1350a9a2a8", 4],
["0xf3ff14d5ab527059", 3],
["0x37242681f96a7abd", 1],
["0xc90bb9b17b276147", 1]
],
"transactionVersion": 11,
"stateVersion": 0
},
"id": 1
}

Code Examples#

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

Upgrade Playbook#

  • Cache metadata keyed by specVersion and refresh whenever this value increases.
  • Regenerate type bundles or schema definitions after runtime upgrades to account for breaking changes.
  • Monitor transactionVersion to validate that transaction payload formats are still supported by your SDK version.