Consts

Get a list of constants for a pallet.

get

Returns a list of const item metadata for constant items of the specified palletId.

Path parameters
palletIdstringRequired

Name or index of the pallet to read constant metadata for. Note: the pallet name must match what is specified in the runtime metadata.

Query parameters
onlyIdsbooleanOptional

Only return the names (IDs) of the const items instead of every constant's metadata.

atstring · unsignedInteger or $hexOptional

Block identifier, as the block height or block hash.

Responses
200
successful operation
application/json
get
GET /pallets/{palletId}/consts HTTP/1.1
Host: dot-playbook.nownodes.io
Accept: */*
{
  "at": {
    "hash": "text",
    "height": "text"
  },
  "pallet": "democracy",
  "palletIndex": "14",
  "items": [
    {
      "name": "VotingPeriod",
      "type": "4",
      "value": "0x00270600",
      "docs": "Information concerning any given constant.\n\n TWOX-NOTE: SAFE as indexes are not under an attacker’s control."
    }
  ]
}

Get the value of a constant item.

get

Returns the value stored under the constantItemId.

Path parameters
palletIdstringRequired

Name or index of the pallet to read constant metadata for. Note: the pallet name must match what is specified in the runtime metadata.

constantItemIdstringRequired

Id of the const item to query for.

Query parameters
atstring · unsignedInteger or $hexOptional

Block identifier, as the block height or block hash.

metadatabooleanOptional

Include the const items metadata (including documentation) if set to true.

Default: false
Responses
200
successful operation
application/json
get
GET /pallets/{palletId}/consts/{constantItemId} HTTP/1.1
Host: dot-playbook.nownodes.io
Accept: */*
{
  "pallet": "democracy",
  "palletIndex": "14",
  "errorItem": "EnactmentPeriod",
  "metadata": {
    "name": "VotingPeriod",
    "type": "4",
    "value": "0x00270600",
    "docs": "Information concerning any given constant.\n\n TWOX-NOTE: SAFE as indexes are not under an attacker’s control."
  }
}