THORChain Block API

The Block API from THORChain — 1 operation(s) for block.

OpenAPI Specification

thorchain-block-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Thornode Auth Block API
  version: 3.19.1
  contact:
    email: devs@thorchain.org
  description: Thornode REST API.
tags:
- name: Block
paths:
  /thorchain/block:
    parameters:
    - $ref: '#/components/parameters/queryHeight'
    get:
      description: Returns verbose details of the block.
      operationId: block
      tags:
      - Block
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlockResponse'
components:
  schemas:
    BlockTx:
      type: object
      required:
      - hash
      - tx
      - result
      properties:
        hash:
          type: string
          example: 223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C
        tx:
          type: object
          additionalProperties: true
        result:
          type: object
          properties:
            code:
              type: integer
              format: int64
              example: 0
            data:
              type: string
              example: ''
            log:
              type: string
              example: not enough gas
            info:
              type: string
              example: ''
            gas_wanted:
              type: string
              example: '100'
            gas_used:
              type: string
              example: '100'
            events:
              type: array
              nullable: true
              items:
                type: object
                additionalProperties:
                  type: string
            codespace:
              type: string
              example: ibc
    BlockResponse:
      type: object
      required:
      - id
      - header
      - begin_block_events
      - end_block_events
      - finalize_block_events
      - txs
      properties:
        id:
          type: object
          required:
          - hash
          - parts
          properties:
            hash:
              type: string
              example: 112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7
            parts:
              type: object
              required:
              - total
              - hash
              properties:
                total:
                  type: integer
                  format: int64
                  example: 1
                hash:
                  type: string
                  example: 38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD
        header:
          type: object
          required:
          - version
          - chain_id
          - height
          - time
          - last_block_id
          - last_commit_hash
          - data_hash
          - validators_hash
          - next_validators_hash
          - consensus_hash
          - app_hash
          - last_results_hash
          - evidence_hash
          - proposer_address
          properties:
            version:
              required:
              - block
              - app
              properties:
                block:
                  type: string
                  example: '10'
                app:
                  type: string
                  example: '0'
              type: object
            chain_id:
              type: string
              example: cosmoshub-2
            height:
              type: integer
              format: int64
              example: 123
            time:
              type: string
              example: '2019-04-22T17:01:51.701356223Z'
            last_block_id:
              type: object
              required:
              - hash
              - parts
              properties:
                hash:
                  type: string
                  example: 112BC173FD838FB68EB43476816CD7B4C6661B6884A9E357B417EE957E1CF8F7
                parts:
                  type: object
                  required:
                  - total
                  - hash
                  properties:
                    total:
                      type: integer
                      format: int64
                      example: 1
                    hash:
                      type: string
                      example: 38D4B26B5B725C4F13571EFE022C030390E4C33C8CF6F88EDD142EA769642DBD
            last_commit_hash:
              type: string
              example: 21B9BC845AD2CB2C4193CDD17BFC506F1EBE5A7402E84AD96E64171287A34812
            data_hash:
              type: string
              example: 970886F99E77ED0D60DA8FCE0447C2676E59F2F77302B0C4AA10E1D02F18EF73
            validators_hash:
              type: string
              example: D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0
            next_validators_hash:
              type: string
              example: D658BFD100CA8025CFD3BECFE86194322731D387286FBD26E059115FD5F2BCA0
            consensus_hash:
              type: string
              example: 0F2908883A105C793B74495EB7D6DF2EEA479ED7FC9349206A65CB0F9987A0B8
            app_hash:
              type: string
              example: 223BF64D4A01074DC523A80E76B9BBC786C791FB0A1893AC5B14866356FCFD6C
            last_results_hash:
              type: string
              example: ''
            evidence_hash:
              type: string
              example: ''
            proposer_address:
              type: string
              example: D540AB022088612AC74B287D076DBFBC4A377A2E
        finalize_block_events:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
        begin_block_events:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
        end_block_events:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
        txs:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/BlockTx'
  parameters:
    queryHeight:
      name: height
      in: query
      description: optional block height, defaults to current tip
      required: false
      schema:
        type: integer
        format: int64
        minimum: 0