THORChain Smart Contracts API

The Smart Contracts API from THORChain — 2 operation(s) for smart contracts.

OpenAPI Specification

thorchain-smart-contracts-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Thornode Auth Smart Contracts API
  version: 3.19.1
  contact:
    email: devs@thorchain.org
  description: Thornode REST API.
tags:
- name: Smart Contracts
paths:
  /thorchain/contracts:
    parameters:
    - $ref: '#/components/parameters/queryHeight'
    - $ref: '#/components/parameters/contract'
    - $ref: '#/components/parameters/version'
    get:
      description: Returns type and version for all contracts with stored `contract_info`
      operationId: contractInfos
      tags:
      - Smart Contracts
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractInfosResponse'
  /thorchain/contract/{address}:
    parameters:
    - $ref: '#/components/parameters/queryHeight'
    - $ref: '#/components/parameters/address'
    get:
      description: Returns type and version from `contract_info` for requested address
      operationId: contractInfo
      tags:
      - Smart Contracts
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractInfoResponse'
components:
  schemas:
    ContractInfo:
      type: object
      required:
      - address
      - contract
      - version
      properties:
        address:
          type: string
          example: thor17cawwg2lsnvcne69fek6nsqkf8snma6gc5ccceshul86rl0u3q4s5l5d0a
        contract:
          type: string
          example: rujira-fin
        version:
          type: string
          example: 2.0.0
    ContractInfosResponse:
      type: object
      required:
      - infos
      properties:
        infos:
          type: array
          items:
            $ref: '#/components/schemas/ContractInfo'
    ContractInfoResponse:
      type: object
      required:
      - info
      properties:
        info:
          $ref: '#/components/schemas/ContractInfo'
  parameters:
    queryHeight:
      name: height
      in: query
      description: optional block height, defaults to current tip
      required: false
      schema:
        type: integer
        format: int64
        minimum: 0
    contract:
      name: contract
      in: query
      required: false
      description: optional contract type prefix to filter results
      schema:
        type: string
        example: rujira-fin
    address:
      name: address
      in: path
      required: true
      schema:
        type: string
        example: thor1zupk5lmc84r2dh738a9g3zscavannjy3nzplwt
    version:
      name: version
      in: query
      required: false
      description: optional contract version prefix to filter results
      schema:
        type: string
        example: 2.0.0