{
  "openapi": "3.0.3",
  "info": {
    "title": "GMAChain Explorer API",
    "version": "1.0.0",
    "description": "REST API powering GMAScan — the official GMAChain block explorer. Read-only endpoints for blocks, transactions, accounts, validators, tokenomics and the TGX ecosystem."
  },
  "servers": [{ "url": "https://api.gmascan.io/v1" }],
  "paths": {
    "/stats": {
      "get": {
        "summary": "Network statistics",
        "description": "Live network statistics: height, TPS, supply, validators, TVL and volume.",
        "responses": { "200": { "description": "Network stats object" } }
      }
    },
    "/blocks": {
      "get": {
        "summary": "List latest blocks",
        "parameters": [
          { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 25 } },
          { "name": "cursor", "in": "query", "schema": { "type": "string" } }
        ],
        "responses": { "200": { "description": "Paginated list of blocks" } }
      }
    },
    "/blocks/{height}": {
      "get": {
        "summary": "Get block by height",
        "parameters": [{ "name": "height", "in": "path", "required": true, "schema": { "type": "integer" } }],
        "responses": { "200": { "description": "Block object" }, "404": { "description": "Block not found" } }
      }
    },
    "/blocks/{height}/transactions": {
      "get": {
        "summary": "List transactions in a block",
        "parameters": [{ "name": "height", "in": "path", "required": true, "schema": { "type": "integer" } }],
        "responses": { "200": { "description": "List of transactions" } }
      }
    },
    "/transactions/{hash}": {
      "get": {
        "summary": "Get transaction by hash",
        "parameters": [{ "name": "hash", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Transaction object" }, "404": { "description": "Transaction not found" } }
      }
    },
    "/accounts/{address}": {
      "get": {
        "summary": "Get account/wallet by address",
        "parameters": [{ "name": "address", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Account object" } }
      }
    },
    "/accounts/{address}/transactions": {
      "get": {
        "summary": "List transaction history for an account",
        "parameters": [
          { "name": "address", "in": "path", "required": true, "schema": { "type": "string" } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 25 } }
        ],
        "responses": { "200": { "description": "List of transactions" } }
      }
    },
    "/validators": {
      "get": {
        "summary": "List the Proof-of-Authority validator set",
        "responses": { "200": { "description": "List of validators" } }
      }
    },
    "/validators/{id}": {
      "get": {
        "summary": "Get validator by id",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Validator object" } }
      }
    },
    "/token/distribution": {
      "get": { "summary": "Token supply & distribution breakdown", "responses": { "200": { "description": "Distribution object" } } }
    },
    "/richlist": {
      "get": { "summary": "Top GMA holders", "responses": { "200": { "description": "List of top holders" } } }
    },
    "/treasury/wallets": {
      "get": { "summary": "List treasury wallets and balances", "responses": { "200": { "description": "List of treasury wallets" } } }
    },
    "/burns": {
      "get": { "summary": "List burn events", "responses": { "200": { "description": "List of burn events" } } }
    },
    "/unlocks": {
      "get": { "summary": "Vesting & unlock calendar", "responses": { "200": { "description": "List of unlock events" } } }
    },
    "/tgx/pools": {
      "get": { "summary": "List TGX liquidity pools", "responses": { "200": { "description": "List of pools" } } }
    },
    "/tgx/swaps": {
      "get": { "summary": "List recent TGX swaps", "responses": { "200": { "description": "List of swaps" } } }
    },
    "/search": {
      "get": {
        "summary": "Universal search",
        "description": "Resolves a query to a block, transaction, address or validator.",
        "parameters": [{ "name": "q", "in": "query", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Search result" } }
      }
    }
  }
}
