Skip to content
openapi-v1.yaml 51.3 KiB
Newer Older
  title: Substrate API Sidecar v1.
  description: Substrate API Sidecar is a REST service that makes it easy to
    interact with blockchain nodes built using Substrate's FRAME framework.
  contact:
    url: https://github.com/paritytech/substrate-api-sidecar
    name: GPL-3.0-or-later
    url: https://github.com/paritytech/substrate-api-sidecar/blob/master/LICENSE
  version: 1.0.0-oas3
tags:
- name: accounts
- name: blocks
- name: node
  description: node connected to sidecar
- name: pallets
  description: pallets employed in the runtime
- name: runtime
- name: transaction
paths:
  /accounts/{accountId}/balance-info:
    get:
      tags:
      - accounts
      summary: Get balance information for an account.
      description: Returns information about an account's balance.
        Replaces `/balance/{address}` from versions < v1.0.0.
      operationId: getAccountBalanceInfo
      parameters:
      - name: accountId
        in: path
        description: SS58 address of the account.
        required: true
        schema:
          type: string
          pattern: '^[1-9A-HJ-NP-Za-km-z]{8,64}$'
      - name: at
        in: query
        description: Block at which to query balance info for the
          specified account.
        required: false
        schema:
          type: string
          description: Block height (as a non-negative integer) or hash
            (as a hex string).
          format: unsignedInteger or $hex
      responses:
        "200":
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountBalanceInfo'
        "400":
          description: invalid blockId supplied for at query param
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        "404":
          description: account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /accounts/{accountId}/staking-info:
    get:
      tags:
      - staking
      summary: Get staking information for a _Stash_ account.
      description: Returns information about a _Stash_ account's staking activity.
        Replaces `/staking/{address}` from versions < v1.0.0.
      operationId: getStakingSummaryByAccountId
      parameters:
      - name: accountId
        in: path
        description: SS58 address of the account. Must be a _Stash_ account.
        required: true
        schema:
          pattern: '^[1-9A-HJ-NP-Za-km-z]{8,64}$'
          type: string
      - name: at
        in: query
        description: Block at which to query the staking info for the
          specified account.
        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/AccountStakingInfo'
        "400":
          description: invalid blockId supplied for at query param
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        "404":
          description: account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /accounts/{accountId}/staking-payouts:
    get:
      tags:
      - staking
      summary: Get payout information for a _Stash_ account.
      description: Returns payout information for the last specified eras. If
        specifying both the depth and era query params, this endpoint will
        return information for (era - depth) through era. (i.e. if depth=5 and
        era=20 information will be returned for eras 16 through 20). N.B. You
        cannot query eras less then `current_era - HISTORY_DEPTH`. N.B. The 
        `nominator*` fields correspond to the address being queried, even if it
        is a validator's _Stash_ address. This is because a validator is technically
        nominating itself.
      operationId: getStakingPayoutsByAccountId
      parameters:
      - name: accountId
        in: path
        description: SS58 address of the account. Must be a _Stash_ account.
        required: true
        schema:
          pattern: '^[1-9A-HJ-NP-Za-km-z]{8,64}$'
          type: string
      - name: depth
        in: query
        description: The number of eras to query for payouts of. Must be less
          than or equal to `HISTORY_DEPTH`. In cases where `era - (depth -1)` is 
          less than 0, the first era queried will be 0.
        required: false
        schema:
          type: string
          format: unsignedInteger
        description: The era to query at.
        required: false
        schema:
          type: string
          default: '`active_era - 1`'
      - name: unclaimedOnly
        in: query
        description: Only return unclaimed rewards.
        required: false
        schema:
          type: string
          format: boolean
          default: true
      responses:
        "200":
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountStakingPayouts'
        "400":
          description: invalid blockId supplied for at query param
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        "404":
          description: account not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /accounts/{accountId}/vesting-info:
    get:
      tags:
      - accounts
      summary: Get vesting information for an account.
      description: Returns the vesting schedule for an account.
        Replaces `/vesting/{address}` from versions < v1.0.0.
      operationId: getVestingSummaryByAccountId
      parameters:
      - name: accountId
        in: path
        description: SS58 address of the account.
        required: true
        schema:
          pattern: '^[1-9A-HJ-NP-Za-km-z]{8,64}$'
          type: string
      - name: at
        in: query
        description: Block at which to query the vesting info for the
          specified account.
        required: false
        schema:
          type: string
Loading full blame...