{
  "swagger": "2.0",
  "info": {
    "version": "1.0.1",
    "title": "Astar token statistics API",
    "description": "Provides Astar networks statistic information."
  },
  "host": "api.astar.network",
  "basePath": "/",
  "schemes": [
    "https",
    "http"
  ],
  "paths": {
    "/api/token/stats": {
      "get": {
        "description": "Test endpoint, returns token stats for Astar Network",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/token/price/{symbol}": {
      "get": {
        "tags": [
          "Token"
        ],
        "description": "Retrieves current token price",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Token symbol (eg. ASTR or SDN)",
            "enum": [
              "ASTR",
              "SDN"
            ]
          },
          {
            "name": "currency",
            "in": "query",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/token/stats": {
      "get": {
        "tags": [
          "Token"
        ],
        "description": "Retrieves token statistics for a given network.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/token/extendedstats": {
      "get": {
        "tags": [
          "Token"
        ],
        "description": "Retrieves token statistics for a given network.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/{network}/token/circulation": {
      "get": {
        "tags": [
          "Token"
        ],
        "description": "Retrieves a token circulation supply for a given network.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/token/circulation": {
      "get": {
        "tags": [
          "Token"
        ],
        "description": "Retrieves token circulation for a given network.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/token/supply": {
      "get": {
        "tags": [
          "Token"
        ],
        "description": "Retrieves a token total supply for a given network.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/token/price/{period}": {
      "get": {
        "tags": [
          "Token"
        ],
        "description": "Retrieves token price for a given network and period.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The period type. Supported values: 7 days 30 days, 90 days, 1 year",
            "enum": [
              "7 days",
              "30 days",
              "90 days",
              "1 year"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/token/tvl/{period}": {
      "get": {
        "tags": [
          "Token"
        ],
        "description": "Retrieves token TVL for a given network and period.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The period type. Supported values: 7 days 30 days, 90 days, 1 year",
            "enum": [
              "7 days",
              "30 days",
              "90 days",
              "1 year"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/token/holders": {
      "get": {
        "tags": [
          "Token"
        ],
        "description": "Retrieves number of token holders",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/dapps-staking/apr": {
      "get": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Retrieves dapp staking APR for a given network.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/dapps-staking/apy": {
      "get": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Retrieves dapp staking APY for a given network.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/dapps-staking/earned/{address}": {
      "get": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Retrieves earned staking rewards for dapps staking",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Wallet address. Supported address format: SS58"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/dapps-staking/dapps": {
      "get": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Retrieves list of dapps (full model) registered for dapps staking",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar, development",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/dapps-staking/dappssimple": {
      "get": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Retrieves list of dapps (basic info) registered for dapps staking",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar, development",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/dapps-staking/dapps/{address}": {
      "get": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Retrieves dapp with the given address",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar, development",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The dapp address"
          },
          {
            "name": "forEdit",
            "in": "query",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/dapps-staking/register": {
      "post": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Registers a new dapp",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar, development",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar",
              "development"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request"
          }
        }
      }
    },
    "/api/v1/{network}/dapps-staking/stats/dapp/{contractAddress}/{period}": {
      "get": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Retrieves number of calls and unique users per era statistics.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden",
            "enum": [
              "astar",
              "shiden"
            ]
          },
          {
            "name": "contractAddress",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Contract address to get stats for"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Period to get stats for. Supported periods: 7 eras, 30 eras, 90 eras, all",
            "enum": [
              "7 eras",
              "30 eras",
              "90 eras",
              "all"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/dapps-staking/stats/user/{userAddress}/{period}": {
      "get": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Retrieves user transactions.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden",
            "enum": [
              "astar",
              "shiden"
            ]
          },
          {
            "name": "userAddress",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "User address to get stats for"
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The period type. Supported values: 7 days 30 days, 90 days, 1 year",
            "enum": [
              "7 days",
              "30 days",
              "90 days",
              "1 year"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v3/{network}/dapps-staking/chaindapps": {
      "get": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Retrieves list of dapps (basic info) registered for dapps staking",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya",
            "enum": [
              "astar",
              "shiden",
              "shibuya"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v3/{network}/dapps-staking/stake-info/{address}": {
      "get": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Retrieves the amount of stake of participant",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya",
            "enum": [
              "astar",
              "shiden",
              "shibuya"
            ]
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Participant address to get stats for"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v3/{network}/dapps-staking/get-period-range/{period}": {
      "get": {
        "tags": [
          "Dapps Staking"
        ],
        "description": "Retreives the start and end block numbers for the given dApp staking period.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar",
            "enum": [
              "astar",
              "shiden",
              "shibuya"
            ]
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "dApp staking period."
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/node/tx-perblock/total": {
      "get": {
        "tags": [
          "Node"
        ],
        "description": "Retreives total (valid and failed) number of transfers (number of balance.Transfer events).",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/node/tx-perblock/{period}": {
      "get": {
        "tags": [
          "Node"
        ],
        "description": "Retreives number of successful transfers (number of balance.Transfer events) per day for a given period.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The period type. Supported values: 7 days 30 days, 90 days, 1 year",
            "enum": [
              "7 days",
              "30 days",
              "90 days",
              "1 year"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/tx/transfer": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "description": "Return the transfer transaction detail of a given hash",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          },
          {
            "name": "hash",
            "in": "query",
            "description": "Transaction hash",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/tx/xvm-transfer": {
      "get": {
        "tags": [
          "Transactions"
        ],
        "description": "Return the xvm-transfer transactionhistory of a given sender and contract address",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar, shiden, shibuya, rocstar",
            "enum": [
              "astar",
              "shiden",
              "shibuya",
              "rocstar"
            ]
          },
          {
            "name": "senderAddress",
            "in": "query",
            "description": "SS58 wallet address",
            "required": true,
            "type": "string"
          },
          {
            "name": "contractAddress",
            "in": "query",
            "description": "SS58 XVM Transfer contract address",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/maw/daily/{period}": {
      "get": {
        "tags": [
          "MAW"
        ],
        "description": "Retreives daily wallets statistics in CSV format",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar",
            "enum": [
              "astar"
            ]
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The period type. Supported values: 7 days, 30 days",
            "enum": [
              "7 days",
              "30 days"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/maw/daily/unique/{period}": {
      "get": {
        "tags": [
          "MAW"
        ],
        "description": "Retreives daily unique wallets statistics.",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar",
            "enum": [
              "astar"
            ]
          },
          {
            "name": "period",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The period type. Supported values: 7 days, 30 days",
            "enum": [
              "7 days",
              "30 days"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/{network}/maw/monthly/{numberOfMonths}": {
      "get": {
        "tags": [
          "MAW"
        ],
        "description": "Retreives monthly wallets statistics in CSV format",
        "parameters": [
          {
            "name": "network",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "The network name. Supported networks: astar",
            "enum": [
              "astar"
            ]
          },
          {
            "name": "numberOfMonths",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "Max. number of months to retrieve (greater than 0)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}