openapi: 3.1.0
info:
  title: 'NEAR Protocol RPC: Transaction Status'
  description: Check the status and details of a transaction
  version: 1.0.0
servers:
  - url: https://rpc.mainnet.fastnear.com
    description: Mainnet
  - url: https://rpc.testnet.fastnear.com
    description: Testnet
paths:
  /:
    post:
      operationId: tx_status
      summary: Check transaction status
      description: Get the status and details of a transaction
      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:
                    - tx
                params:
                  type: object
                  properties:
                    wait_until:
                      type: string
                      enum:
                        - NONE
                        - INCLUDED
                        - INCLUDED_FINAL
                        - EXECUTED
                        - EXECUTED_OPTIMISTIC
                        - FINAL
                      description: Desired level of execution status guarantee
                      default: EXECUTED_OPTIMISTIC
                    signed_tx_base64:
                      type: string
                      description: Base64-encoded signed transaction
                    sender_account_id:
                      type: string
                      description: NEAR account ID
                    tx_hash:
                      type: string
                      description: Base58-encoded hash
            examples:
              mainnet:
                summary: Mainnet Example
                value:
                  jsonrpc: '2.0'
                  id: fastnear
                  method: tx
                  params:
                    tx_hash: 8a8HR2Gf8NkLLeNcuHet4JeEz9kWa1fhs6qAnBdiewrR
                    sender_account_id: 0-relay.hot.tg
              testnet:
                summary: Testnet Example
                value:
                  jsonrpc: '2.0'
                  id: fastnear
                  method: tx
                  params:
                    tx_hash: Ac5D9MWqo5wKmRBZiqQfyuJfz4SMsgc3tDCjMoQBBeRK
                    sender_account_id: relay.aurora
      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:
            final_execution_status:
              type: string
              enum:
                - NONE
                - INCLUDED
                - INCLUDED_FINAL
                - EXECUTED
                - EXECUTED_OPTIMISTIC
                - FINAL
              description: Desired level of execution status guarantee
            receipts:
              type: array
              items:
                type: object
              description: Receipts generated from the transaction
            receipts_outcome:
              type: array
              items:
                type: object
              description: The execution outcome of receipts.
            status:
              type: object
              description: One of multiple possible types
            transaction:
              type: object
              description: Signed Transaction
            transaction_outcome:
              type: object
              description: The execution outcome of the signed transaction.
          required:
            - final_execution_status
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            data:
              type: object
