Skip to content
openapi-v1.yaml 90.7 KiB
Newer Older
  title: Substrate API Sidecar
  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
Tarik Gul's avatar
Tarik Gul committed
  version: 9.1.11
tags:
- name: accounts
- name: blocks
- name: node
  description: node connected to sidecar
- name: pallets
  description: pallets employed in the runtime
- name: runtime
- name: transaction
- name: paras
Tarik Gul's avatar
Tarik Gul committed
  /accounts/{accountId}/asset-balances:
    get:
      tags:
      - accounts
      summary: Get an array of asset-balances for an account.
      description: Returns information about an account's asset-balances. This is 
        specific to the assets pallet for parachains. If no `assets` query parameter
        is provided, all asset-balances for the given account will be returned. 
      operationId: getAssetBalances
      parameters:
      - name: accountId
        in: path
        description: SS58 address of the account.
        required: true
        schema:
          type: string
          format: SS58
      - name: at
        in: query
        description: Block at which to query asset-balance info for the 
          specified account.
        required: false
        schema:
          type: string
          description: Block height (as a positive integer) or hash
            (as a hex string).
          format: unsignedInteger or $hex
      - name: assets
        in: query
        description: An array of AssetId's to be queried. If not supplied, defaults to providing
          all asset balances associated with the `accountId` will be returned. The array query param
          format follows Express 4.x API. ex:`?assets[]=1&assets[]=2&assets[]=3`.
        required: false
        schema:
          type: array
          items: 
            type: string
          description: An array of assetId numbers represented as strings
          format: Array of unsignedInteger's
      responses:
        "200": 
          description: successfull operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountAssetsBalances'
  /accounts/{accountId}/asset-approvals:
    get:
      tags:
      - accounts
      summary: Get an asset approval for an account.
      description: Returns information about an account's asset approval transaction.
        It is required to pass in a delegate and an assetId as query parameters.
      operationId: getAssetApprovals
      parameters:
      - name: accountId
        in: path
        description: SS58 address of the account.
        required: true
        schema:
          type: string
          format: SS58
      - name: at
        in: query
        description: Block at which to query asset approval 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
      - name: assetId
        in: query
        description: The `assetId` associated with the asset-approval.
        required: true
        schema:
          type: string
          description: An assetId represented as an unsignedInteger.
          format: unsignedInteger
      - name: delegate
        in: query
        description: The delegate's `accountId` associated with an asset-approval.
        required: true
        schema:
          type: string
          format: SS58
      responses:
        "200": 
          description: successfull operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountAssetsApproval'
  /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
Tarik Gul's avatar
Tarik Gul committed
          format: SS58
      - 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
      - name: token
        in: query
        description: 'Token to query the balance of. If not specified it will query
          the chains native token (e.g. DOT for Polkadot). Note: this is only relevant
          for chains that support multiple tokens through the ORML tokens pallet.'
        required: false
        schema:
          type: string
          description: Token symbol
      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.
Tarik Gul's avatar
Tarik Gul committed
          format: SS58
          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:
Loading full blame...