{
  "$schema": "http://json-schema.org/draft-07/schema",
  "type": "object",
  "title": "ContractSearchResult",
  "description": "Contract search result",
  "required": ["found", "result"],
  "additionalProperties": false,
  "properties": {
    "found": {
      "type": "boolean",
      "description": "Indicates if the requested object was found or not",
      "default": true
    },
    "result": {
      "type": "object",
      "description": "This object carries the search result",
      "required": ["entity_id", "entity_type"],
      "additionalProperties": false,
      "properties": {
        "entity_id": {
          "type": "string",
          "description": "The id used to search this query."
        },
        "entity_type": {
          "type": "string",
          "enum": ["contract_address"]
        },
        "tx_data": {
          "type": "object",
          "description": "Returns basic search result information about the requested id",
          "additionalProperties": false,
          "properties": {
            "canonical": {
              "type": "boolean",
              "description": "If the transaction lies within the canonical chain"
            },
            "block_hash": {
              "type": "string",
              "description": "Refers to the hash of the block for searched transaction"
            },
            "burn_block_time": {
              "type": "integer"
            },
            "block_height": {
              "type": "integer"
            },
            "tx_type": {
              "type": "string"
            },
            "tx_id": {
              "type": "string",
              "description": "Corresponding tx_id for smart_contract"
            }
          }
        },
        "metadata": {
          "type": "object",
          "anyOf": [
            {
              "$ref": "../../entities/mempool-transactions/transaction.schema.json"
            },
            {
              "$ref": "../../entities/transactions/transaction.schema.json"
            }
          ],
          "additionalItems": false
        }
      }
    }
  }
}
