openapi: 3.1.0
info:
  title: 'NEAR Protocol RPC: Get block effects'
  description: >-
    Returns changes in block for given block height or hash over all
    transactions for all types
  version: 1.0.0
servers:
  - url: https://rpc.mainnet.fastnear.com
    description: Mainnet
  - url: https://rpc.testnet.fastnear.com
    description: Testnet
paths:
  /:
    post:
      operationId: block_effects
      summary: Get block effects
      description: >-
        Returns changes in block for given block height or hash over all
        transactions for all types
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - id
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                id:
                  type: string
                  example: fastnear
                method:
                  type: string
                  enum:
                    - block_effects
                params:
                  type: object
                  description: One of multiple possible types
            examples:
              mainnet:
                summary: Get block effects (Mainnet)
                value:
                  jsonrpc: '2.0'
                  id: fastnear
                  method: block_effects
                  params:
                    block_id: 186561182
              testnet:
                summary: Get block effects (Testnet)
                value:
                  jsonrpc: '2.0'
                  id: fastnear
                  method: block_effects
                  params:
                    block_id: 237911138
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponse'
components:
  schemas:
    JsonRpcResponse:
      type: object
      required:
        - jsonrpc
        - id
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        id:
          oneOf:
            - type: string
            - type: number
        result:
          type: object
          properties:
            block_hash:
              type: string
              description: Base58-encoded hash
            changes:
              type: array
              items:
                type: object
                description: One of multiple possible types
          required:
            - block_hash
            - changes
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            data:
              type: object
