Polkadot rc pallets API

The rc pallets API from Polkadot — 13 operation(s) for rc pallets.

OpenAPI Specification

polkadot-rc-pallets-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Polkadot REST Account rc pallets API
  description: High-performance Rust REST API for Substrate/Polkadot blockchain data. Drop-in replacement for substrate-api-sidecar.
  contact:
    url: https://github.com/paritytech/polkadot-rest-api
  license:
    name: GPL-3.0-or-later
  version: 0.1.3
servers:
- url: http://localhost:8080/v1
  description: Localhost
tags:
- name: rc pallets
paths:
  /rc/pallets/on-going-referenda:
    get:
      tags:
      - rc pallets
      summary: Get relay chain ongoing referenda.
      description: Returns information about ongoing referenda in the relay chain.
      operationId: getRcPalletsOnGoingReferenda
      parameters:
      - name: at
        in: query
        description: Block at which to retrieve relay chain referenda information.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PalletsOnGoingReferenda'
        '400':
          description: invalid blockId supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/{palletId}/consts:
    get:
      tags:
      - rc pallets
      summary: Get a list of constants for a relay chain pallet.
      description: Returns a list of constant metadata for the specified relay chain pallet.
      operationId: getRcPalletsConsts
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet to read constants from.
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block at which to retrieve relay chain pallet constants.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: onlyIds
        in: query
        description: Only return constant IDs, not values and metadata.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PalletConstants'
        '400':
          description: invalid palletId supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/{palletId}/consts/{constantItemId}:
    get:
      tags:
      - rc pallets
      summary: Get a constant from a relay chain pallet by its ID.
      description: Returns information about a specific constant from the specified relay chain pallet.
      operationId: getRcPalletsConstsItem
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet to read the constant from.
        required: true
        schema:
          type: string
      - name: constantItemId
        in: path
        description: Name of the constant to retrieve.
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block at which to retrieve relay chain pallet constant.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: metadata
        in: query
        description: Include metadata for the constant.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PalletConstantsItem'
        '400':
          description: invalid palletId or constantItemId supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/{palletId}/dispatchables:
    get:
      tags:
      - rc pallets
      summary: Get a list of dispatchables for a relay chain pallet.
      description: Returns a list of dispatchable metadata for the specified relay chain pallet.
      operationId: getRcPalletsDispatchables
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet to read dispatchables from.
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block at which to retrieve relay chain pallet dispatchables.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: onlyIds
        in: query
        description: Only return dispatchable IDs, not values and metadata.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PalletDispatchables'
        '400':
          description: invalid palletId supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/{palletId}/dispatchables/{dispatchableItemId}:
    get:
      tags:
      - rc pallets
      summary: Get a dispatchable from a relay chain pallet by its ID.
      description: Returns information about a specific dispatchable from the specified relay chain pallet.
      operationId: getRcPalletsDispatchablesItem
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet to read the dispatchable from.
        required: true
        schema:
          type: string
      - name: dispatchableItemId
        in: path
        description: Name of the dispatchable to retrieve.
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block at which to retrieve relay chain pallet dispatchable.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: metadata
        in: query
        description: Include metadata for the dispatchable.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PalletDispatchablesItem'
        '400':
          description: invalid palletId or dispatchableItemId supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/{palletId}/errors:
    get:
      tags:
      - rc pallets
      summary: Get a list of errors for a relay chain pallet.
      description: Returns a list of error metadata for the specified relay chain pallet.
      operationId: getRcPalletsErrors
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet to read errors from.
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block at which to retrieve relay chain pallet errors.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: onlyIds
        in: query
        description: Only return error IDs, not values and metadata.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PalletErrors'
        '400':
          description: invalid palletId supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/{palletId}/errors/{errorItemId}:
    get:
      tags:
      - rc pallets
      summary: Get an error from a relay chain pallet by its ID.
      description: Returns information about a specific error from the specified relay chain pallet.
      operationId: getRcPalletsErrorsItem
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet to read the error from.
        required: true
        schema:
          type: string
      - name: errorItemId
        in: path
        description: Name of the error to retrieve.
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block at which to retrieve relay chain pallet error.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: metadata
        in: query
        description: Include metadata for the error.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PalletErrorsItem'
        '400':
          description: invalid palletId or errorItemId supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/{palletId}/events:
    get:
      tags:
      - rc pallets
      summary: Get a list of events for a relay chain pallet.
      description: Returns a list of event metadata for the specified relay chain pallet.
      operationId: getRcPalletsEvents
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet to read events from.
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block at which to retrieve relay chain pallet events.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: onlyIds
        in: query
        description: Only return event IDs, not values and metadata.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PalletEvents'
        '400':
          description: invalid palletId supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/{palletId}/events/{eventItemId}:
    get:
      tags:
      - rc pallets
      summary: Get an event from a relay chain pallet by its ID.
      description: Returns information about a specific event from the specified relay chain pallet.
      operationId: getRcPalletsEventsItem
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet to read the event from.
        required: true
        schema:
          type: string
      - name: eventItemId
        in: path
        description: Name of the event to retrieve.
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block at which to retrieve relay chain pallet event.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: metadata
        in: query
        description: Include metadata for the event.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PalletEventsItem'
        '400':
          description: invalid palletId or eventItemId supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/{palletId}/storage:
    get:
      tags:
      - rc pallets
      summary: Get a list of storage items for a relay chain pallet.
      description: Returns a list of storage item metadata for the specified relay chain pallet.
      operationId: getRcPalletsStorage
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet to read storage items from.
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block at which to retrieve relay chain pallet storage items.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: onlyIds
        in: query
        description: Only return storage item IDs, not values and metadata.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PalletStorage'
        '400':
          description: invalid palletId supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/{palletId}/storage/{storageItemId}:
    get:
      tags:
      - rc pallets
      summary: Get a storage item from a relay chain pallet by its ID.
      description: Returns the value stored under the specified storage item ID from the relay chain pallet. For maps, query parameter keys are required.
      operationId: getRcPalletsStorageItem
      parameters:
      - name: palletId
        in: path
        description: Name or index of the pallet to read the storage item from.
        required: true
        schema:
          type: string
      - name: storageItemId
        in: path
        description: Name of the storage item to retrieve.
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block at which to retrieve relay chain pallet storage item.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: keys
        in: query
        description: Storage map keys for map-type storage items. Required for map and double map storage items.
        required: false
        schema:
          type: array
          items:
            type: string
      - name: metadata
        in: query
        description: Include metadata for the storage item.
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PalletStorageItem'
        '400':
          description: invalid palletId, storageItemId, or keys supplied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/staking/progress:
    get:
      tags:
      - rc pallets
      summary: Get progress on the general Staking pallet system on Relay Chain.
      description: Returns information on the progress of key components of the staking system and estimates of future points of interest. If you are querying from Asset Hub for staking progress, this endpoint requires multi chain connections between the relay chain, and asset hub itself. Set the asset hub rpc to SAS_SUBSTRATE_URL, and add the relay chain to the SAS_SUBSTRATE_MULTI_CHAIN_URL env var. Refer to the README for the structure of the env vars. The `useRcBlock` parameter allows querying Asset Hub state using relay chain block numbers, enabling post-migration infrastructure to continue using relay chain block identifiers while accessing Asset Hub data.
      operationId: getRcStakingProgress
      parameters:
      - name: at
        in: query
        description: Block at which to retrieve a staking progress report.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/StakingProgress'
                - type: array
                  items:
                    $ref: '#/components/schemas/StakingProgress'
                description: Returns a single object when using standard parameters. Returns an array when using 'useRcBlock' parameter (array contains one object per Asset Hub block found, or empty array if none found).
        '400':
          description: invalid blockId supplied for at query param, or invalid parameter combination
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/pallets/staking/validators:
    get:
      tags:
      - rc pallets
      summary: Get all validators (active/waiting) of a specific chain.
      description: Returns a list of all validators addresses and their corresponding status which can be either active or waiting. For declared validators, it also includes their commission rate (as parts-per-billion) and nomination blocking status. It will also return a list of active validators that will not be part of the next era for staking. They will be under the key "validatorsToBeChilled". It's important to note, that addresses can be present in both the "validators" key, and "validatorsToBeChilled". Commission and blocked properties are not present for active validators that have been chilled.
      operationId: getRcStakingValidators
      parameters:
      - name: at
        in: query
        description: Block at which to retrieve the list of validators.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StakingValidators'
        '400':
          description: invalid blockId supplied for at query param, or invalid parameter combination
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PalletStorageItem:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        pallet:
          type: string
          description: Name of the pallet.
          example: democracy
        palletIndex:
          type: string
          description: Index of the pallet for looking up storage.
          example: '15'
        storageItem:
          type: string
          description: Name of the storage item.
          example: referendumInfoOf
        keys:
          type: array
          items:
            type: string
          description: N Storage keys passed in as the `keys` query param.
          example:
          - '0x00'
          - '0x01'
        value:
          type: object
          description: Value returned by this storage query.
          example:
            Ongoing:
              end: '1612800'
              proposalHash: '0x7de70fc8be782076d0b5772be77153d172a5381c72dd56d3385e25f62abf507e'
              threshold: Supermajorityapproval
              delay: '403200'
              tally:
                ayes: '41925212461400000'
                nays: '214535586500000'
                turnout: '34485320658000000'
        metadata:
          $ref: '#/components/schemas/PalletStorageItemMetadata'
        rcBlockHash:
          type: string
          description: The relay chain block hash used for the query. Only present when `useRcBlock` parameter is used.
        rcBlockNumber:
          type: string
          description: The relay chain block number used for the query. Only present when `useRcBlock` parameter is used.
        ahTimestamp:
          type: string
          description: The Asset Hub block timestamp. Only present when `useRcBlock` parameter is used.
    PalletErrorsItemMetadata:
      type: object
      properties:
        name:
          type: string
          example: InsufficientFunds
          description: The error item's name (which is the same as the error item's ID).
        fields:
          type: array
          items:
            type: string
        index:
          type: string
          example: '0'
          description: The index of the error item in the lists of pallet errors
        docs:
          type: string
          example: " Information concerning any given error.\n\n TWOX-NOTE: SAFE as indexes are not under an attacker’s control."
        args:
          type: array
          items:
            type: string
      description: Metadata of an error item from a FRAME pallet.
    PalletErrorsItem:
      type: object
      properties:
        pallet:
          type: string
          description: Name of the pallet.
          example: democracy
        palletIndex:
          type: string
          description: Index of the pallet for looking up errors.
          example: '14'
        errorItem:
          type: string
          description: Name of the error item.
          example: ValueLow
        metadata:
          $ref: '#/components/schemas/PalletErrorsItemMetadata'
        rcBlockHash:
          type: string
          description: The relay chain block hash used for the query. Only present when `useRcBlock` parameter is used.
        rcBlockNumber:
          type: string
          description: The relay chain block number used for the query. Only present when `useRcBlock` parameter is used.
        ahTimestamp:
          type: string
          description: The Asset Hub block timestamp. Only present when `useRcBlock` parameter is used.
    PalletConstantsItem:
      type: object
      properties:
        pallet:
          type: string
          description: Name of the pallet.
          example: democracy
        palletIndex:
          type: string
          description: Index of the pallet for looking up constants.
          example: '14'
        errorItem:
          type: string
          description: Name of the constant item.
          example: EnactmentPeriod
        metadata:
          $ref: '#/components/schemas/PalletConstantsItemMetadata'
        rcBlockHash:
          type: string
          description: The relay chain block hash used for the query. Only present when `useRcBlock` parameter is used.
        rcBlockNumber:
          type: string
          description: The relay chain block number used for the query. Only present when `useRcBlock` parameter is used.
        ahTimestamp:
          type: string
          description: The Asset Hub block timestamp. Only present when `useRcBlock` parameter is used.
    PalletEventsItemMetadata:
      type: object
      properties:
        name:
          type: string
          example: Tabled
          description: The event item's name (which is the same as the event item's ID).
        fields:
          type: array
          items:
            type: string
        index:
          type: string
          example: '0'
          description: The index of the error item in the lists of pallet events
        docs:
          type: string
          example: " Information concerning any given event.\n\n TWOX-NOTE: SAFE as indexes are not under an attacker’s control."
        args:
          type: array
          items:
            type: string
      description: Metadata of an event item from a FRAME pallet.
    Error:
      type: object
      properties:
        code:
          type: number
        message:
          type: string
        stack:
          type: string
        level:
          type: string
    PalletStorageItemMetadata:
      type: object
      properties:
        name:
          type: string
          example: ReferendumInfoOf
          description: The storage item's name (which is the same as the storage item's ID).
        modifier:
          type: string
          example: Optional
        type:
          $ref: '#/components/schemas/PalletStorageType'
        fallback:
          type: string
          example: '0x00'
        docs:
          type: string
          example: " Information concerning any given referendum.\n\n TWOX-NOTE: SAFE as indexes are not under an attacker’s control."
      description: Metadata of a storage item from a FRAME pallet.
    PalletStorage:
      type: object
      properties:
        pallet:
          type: string
          description: Name of the pallet.
          example: democracy
        palletIndex:
          type: string
          description: Index of the pallet for looking up storage.
          example: '15'
        items:
          type: array
          items:
            $ref: '#/components/schemas/PalletStorageItemMetadata'
          description: Array containing metadata for each storage entry of the pallet.
        rcBlockHash:
          type: string
          description: The relay chain block hash used for the query. Only present when `useRcBlock` parameter is used.
        rcBlockNumber:
          type: string
          description: The relay chain block number used for the query. Only present when `useRcBlock` parameter is used.
        ahTimestamp:
          type: string
          description: The Asset Hub block timestamp. Only present when `useRcBlock` parameter is used.
    UnappliedSlash:
      type: object
      properties:
        validator:
          type: string
          description: Stash account ID of the offending validator.
          format: ss58
        own:
          type: string
          description: The amount the validator will be slashed.
          format: unsignedInteger
        others:
          type: array
          description: Array of tuples(`[accountId, amount]`) representing all the stashes of other slashed stakers and the amount they will be slashed.
          items:
            type: string
            format: tuple[ss58, unsignedInteger]
        reporters:
          type: array
          description: Array of account IDs of the reporters of the offense.
          items:
            type: string
            format: ss58
        payout:
          type: string
          description: Amount of bounty payout to reporters.
          format: unsignedInteger
    PalletsOnGoingReferenda:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        referenda:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Referendum's id.
              decisionDeposit:
                type: object
                properties:
                  who:
                    type: string
                    description: The account who placed the referendum's decision deposit.
                  amount:
                    type: string
                    format: unsignedInteger
                    description: The amount of the decision deposit.
                description: A deposit which is required for a referendum to progress to the decision phase.
              enactment:
                type: string
                enum:
                - at
                - after
                description: The enactment period of the referendum. It can be defined using either the `at` option, which specifies the exact block height when the referendum will be enacted, or the `after` option, which indicates the number of blocks after which the enactment will occur.
              submitted:
                type: string
                format: unsignedInteger
                description: The block number at which the referendum was submitted.
              deciding:
                type: object
                properties:
                  since:
                    type: string
                    format: unsignedInteger
                    description: The block number at which the referendum started being `decided`.
                  confirming:
                    type: string
                    format: unsignedInteger
                    description: The block number at which the referendum's confirmation stage will end at as long as it doesn't lose its approval in the meantime.
          description: A list of ongoing referenda and their details.
        rcBlockHash:
          type: string
          description: The relay chain block hash used for the query. Only present when `useRcBlock` parameter is used.
        rcBlockNumber:
          type: string
          description: The relay chain block number used for the query. Only present when `useRcBlock` parameter is used.
        ahTimestamp:
          type: string
          description: The Asset Hub block timestamp. Only present when `useRcBlock` parameter is used.
    PalletDispatchablesItemMetadata:
      type: object
      properties:
        name:
          type: string
          example: propose
          description: The dispatchable item's name (which is the same as the dispatchable item's ID).
        fields:
          type: array
          items:
            type: string
        index:
          type: string
          example: '0'
          description: The index of the dispatchable item in the lists of pallet dispatchables.
        docs:
          type: string
          example: "Information concerning any given dispatchable.\n\n TWOX-NOTE: SAFE as indexes are not under an attacker’s control."
        args:
          type: array
          items:
            type: string
      description: Metadata of a dispatchable item from a FRAME pallet.
    PalletDispatchables:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        pallet:
          type: string
          description: Name of the pallet.
          example: democracy
        palletIndex:
          type: string
          description: Index of the pallet for looking up dispatchables.
          example: '14'
        items:
          type: array
          items:
            $ref: '#/components/schemas/PalletDispatchablesItemMetadata'
          description: Array containing metadata for each dispatchable entry of the pallet.
        rcBlockHash:
          type: string
          description: The relay chain block hash used for the query. Only present when `useRcBlock` parameter is used.
        rcBlockNumber:
          type: string
          description: The relay chain block number used for the query. Only present when `useRcBlock` parameter is used.
          format: unsignedInteger
        ahTimestamp:
          type: string
          description: The Asset Hub block timestamp. Only present when `useRcBlock` parameter is used.
          format: unsignedInteger
    PalletEventsItem:
      type: object
      properties:
        pallet:
          type: string
          description: Name of the pallet.
          example: democracy
        palletIndex:
          type: string
          description: Index of the pallet for looking up events.
          example: '14'
        eventItem:
          type: string
          description: Name of the events item.
          example: Proposed
        metadata:
          $ref: '#/components/schemas/PalletEventsItemMetadata'
        rcBlockHash:
          type: string
          description: The relay chain block hash used 

# --- truncated at 32 KB (42 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/polkadot/refs/heads/main/openapi/polkadot-rc-pallets-api-openapi.yml