openapi: 3.0.0
info:
title: Substrate API Sidecar accounts contracts API
description: '> ⚠️ **Deprecation Notice** — `substrate-api-sidecar` is deprecated in favor of
> [`polkadot-rest-api`](https://github.com/paritytech/polkadot-rest-api), a ground-up Rust rewrite
> built on [`subxt`](https://github.com/paritytech/subxt) with 1:1 API compatibility (endpoints
> served under `/v1/`, e.g. `/v1/blocks/head`), stable memory under sustained load, significantly
> lower latency and higher throughput, and native SCALE decoding via `parity-scale-codec`.
>
> **Migrate today:** Docker `paritytech/polkadot-rest-api:v0.1.0` ·
> [crate](https://crates.io/crates/polkadot-rest-api) ·
> [migration guide](https://github.com/paritytech/polkadot-rest-api/blob/main/docs/guides/MIGRATION.md) ·
> [docs](https://paritytech.github.io/polkadot-rest-api/) ·
> [issues](https://github.com/paritytech/polkadot-rest-api/issues)
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
license:
name: GPL-3.0-or-later
url: https://github.com/paritytech/substrate-api-sidecar/blob/master/LICENSE
version: 20.14.1
servers:
- url: https://polkadot-public-sidecar.parity-chains.parity.io/
description: Polkadot Parity public sidecar
- url: https://kusama-public-sidecar.parity-chains.parity.io/
description: Kusama Parity public sidecar
- url: https://polkadot-asset-hub-public-sidecar.parity-chains.parity.io/
description: Polkadot Asset Hub Parity public sidecar
- url: https://kusama-asset-hub-public-sidecar.parity-chains.parity.io/
description: Kusama Asset Hub Parity public sidecar
- url: http://localhost:8080
description: Localhost
tags:
- name: contracts
paths:
/contracts/ink/{address}/query:
post:
tags:
- contracts
summary: Query an !Ink contract with a given message (method).
description: Will return a valid or invalid result.
operationId: callContractQuery
requestBody:
$ref: '#/components/requestBodies/ContractMetadata'
parameters:
- name: address
in: path
description: SS58 or Hex address of the account associated with the contract.
required: true
schema:
type: string
- name: method
in: query
description: The message or method used to query.
required: false
schema:
type: string
default: get
- name: gasLimit
in: query
description: The gas limit to be used as an option for the queried message.
required: false
schema:
default: -1
type: number
- name: storageDepositLimit
in: query
description: The storage deposit limit to be used as an option for the queried message.
required: false
schema:
default: null
type: number
- name: args
in: query
description: Abi params used as args specified in the metadata to be passed into a query. The format to use this query param is ?args[]=1&args[]=2&args[]=3.
required: false
schema:
type: array
items:
type: string
description: An array of Abi params.
responses:
'200':
description: succesful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ContractsInkQuery'
'400':
description: Invalid Method
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
requestBodies:
ContractMetadata:
content:
application/json:
schema:
$ref: '#/components/schemas/ContractMetadata'
schemas:
Error:
type: object
properties:
code:
type: number
message:
type: string
stack:
type: string
level:
type: string
ContractMetadata:
type: object
description: Metadata used to instantiate a ContractPromise. This metadata can be generated by compiling the contract you are querying.
ContractsInkQuery:
type: object
description: Result from calling a query to a Ink contract.
properties:
debugMessage:
type: string
gasConsumed:
type: string
gasRequired:
type: string
output:
type: boolean
result:
type: object
description: Will result in an Ok or Err object depending on the result of the query.
storageDeposit:
type: object